Advertisement
Guest User

Chat Test

a guest
Dec 28th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <style>
  6. #chatwindow {
  7. background-color: #cccccc;
  8. width: 260px;
  9. height: 330px;
  10. position: absolute;
  11. left: 50%;
  12. margin-left: -130px;
  13. top: 50%;
  14. margin-top: -165px;
  15. }
  16.  
  17. #chatarea {
  18. width: 230px;
  19. height: 255px;
  20. background-color: #dddddd;
  21. position: absolute;
  22. left: 5px;
  23. top: 35px;
  24. font-family: Lucida sans unicode, arial;
  25. font-size: 12px;
  26. overflow: auto;
  27. padding-left: 10px;
  28. padding-right: 10px;
  29. }
  30.  
  31. #chatinput {
  32. width: 240px;
  33. height: 30px;
  34. background-color: #cccccc;
  35. padding-left: 5px;
  36. padding-right: 5px;
  37. position: absolute;
  38. bottom: 5px;
  39. left: 5px;
  40. }
  41.  
  42. #textinput {
  43. border: none;
  44. position: absolute;
  45. top: 0;
  46. left: 0;
  47. width: 240px;
  48. height: 28px;
  49. background-color: #dddddd;
  50. padding-left: 5px;
  51. padding-right: 5px;
  52. font-family: Lucida sans unicode, arial;
  53. font-size: 12px;
  54. }
  55.  
  56. #textinput:focus {
  57. outline: none;
  58. }
  59.  
  60. #submitchat {
  61. width: 30px;
  62. height: 30px;
  63. background-color: #dddddd;
  64. position: absolute;
  65. right: 0;
  66. top: 0;
  67. border-top: none;
  68. border-bottom: none;
  69. border-right: none;
  70. border-left: none;
  71. color: #505050;
  72. font-family: Lucida sans unicode, arial;
  73. font-weight: bold;
  74. font-size: 25px;
  75. text-align: center;
  76. }
  77.  
  78. #submitchat:focus {
  79. outline: none;
  80. }
  81.  
  82. #recipientpic {
  83. position: absolute;
  84. left: 5px;
  85. top: 5px;
  86. width: 25px;
  87. height: 25px;
  88. background-color: #dddddd;
  89. }
  90.  
  91. #recipientname {
  92. font-family: Lucida sans unicode, arial;
  93. font-size: 15px;
  94. position: absolute;
  95. top: -6px;
  96. right: 5px;
  97. color: #505050;
  98. }
  99.  
  100. .localchat {
  101. background-color: #ffffff;
  102. padding: 5px;
  103. border-top-right-radius: 5px;
  104. border-bottom-left-radius: 5px;
  105. color: #505050;
  106. word-wrap: break-word;
  107. float: bottom;
  108. }
  109. </style>
  110.  
  111. <script>
  112. document.onkeypress = enter;
  113. function enter(e) {
  114. if (e.which == 13){
  115. var msg = document.getElementById("textinput").value;
  116. var p = document.createElement("p");
  117. p.innerHTML = msg;
  118. p.className = "localchat"
  119. document.getElementById("chatarea").appendChild(p);
  120. document.getElementById("textinput").value = "";
  121. return false;
  122. }
  123. }
  124. </script>
  125.  
  126. <?php
  127. //php Here
  128. ?>
  129. </head>
  130.  
  131. <body>
  132. <p>Chat Window 1.0</p>
  133.  
  134. <div id="chatwindow">
  135. <div id="recipient">
  136. <img src="http://occarch.com/wp-content/uploads/2012/12/iconmonstr-user-icon-380x380.png" id="recipientpic">
  137. <p id="recipientname">Recipient</p>
  138. </div>
  139.  
  140. <div id="chatarea" name="chatarea">
  141. </div>
  142.  
  143.  
  144. <div id="chatinput">
  145. <form id="inputtext">
  146. <input type="text" id="textinput" placeholder="Enter your chat here.">
  147. </form>
  148. </div>
  149. </div>
  150. </body>
  151. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement