From 319da55b31b57557848fe6a60fed612532bff71a Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 14 Feb 2013 00:44:31 -0800 Subject: Chat restyled. --- css/chat.css | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++ includes/header.php | 14 +++++++ pages/chat.php | 110 +++++------------------------------------------- 3 files changed, 142 insertions(+), 99 deletions(-) create mode 100644 css/chat.css diff --git a/css/chat.css b/css/chat.css new file mode 100644 index 0000000..1af7c4d --- /dev/null +++ b/css/chat.css @@ -0,0 +1,117 @@ + +.chatInputMessage { + font-family:Comic Sans MS, Comic Sans MS5, cursive; + border: 1px solid gray; + background-color:#999; + width: 700px; + margin: 7px; + padding: 2px; + border-radius: 10px; + border-bottom-right-radius: 20px; + border-top-right-radius: 20px; +} +.chatButton { + margin: 4px; +} + +#chatContainer { + width:800px; + margin:0 auto; + height:400px; + overflow:auto; +} +#sendChat { + margin-left: 10px; +} + + + + +.chatBadge { + height:100%; + float:left; +} +.chatUsername { + font-family: 'Trebuchet MS1', 'Trebuchet MS', sans-serif; + font-size: 17px; + text-overflow: ellipsis; + overflow:hidden; + float: left; + padding-top: 5px; + width: 115px; +} +.chatText { + font-family: 'Trebuchet MS1', 'Trebuchet MS', sans-serif; + font-size: 16px; + display: inline-block; + width: 525px; + padding: 5px 5px 5px 5px; +} +.chatTimestamp { + font-family:"Times New Roman", Times, serif; + float:left; + padding: 5px 3px 3px 3px; + min-width:70px; + overflow:hidden; + text-overflow: ellipsis; + white-space:nowrap; +} +.chatColumn1 { + + width:120px; + min-height: 35px; + padding-left: 7px; + position:absolute; + left:0;top:0;bottom:0; +} +.chatColumn2 { + text-align:left; + margin-left:130px; + min-height: 35px; +} + +.chatMessage { + width:780px; + min-height:35px; + margin:1px; + display:block; + clear:both; + margin-bottom:3px; + position:relative; + background-color:#333; + border-radius:20px; + border-bottom-left-radius: 10px; + border-top-left-radius: 10px; +} +.chatMessage.self { + background-color: #444; +} + +.chatContainer2 { + background-color: #222; + border-radius: 12px; + width:810px; + margin:0 auto 5px; + height:450px; + overflow:auto; + +background: rgb(34,34,34); /* Old browsers */ +background: -moz-radial-gradient(center, ellipse cover, rgba(34,34,34,1) 0%, rgba(119,119,119,1) 100%); /* FF3.6+ */ +background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(34,34,34,1)), color-stop(100%,rgba(119,119,119,1))); /* Chrome,Safari4+ */ +background: -webkit-radial-gradient(center, ellipse cover, rgba(34,34,34,1) 0%,rgba(119,119,119,1) 100%); /* Chrome10+,Safari5.1+ */ +background: -o-radial-gradient(center, ellipse cover, rgba(34,34,34,1) 0%,rgba(119,119,119,1) 100%); /* Opera 12+ */ +background: -ms-radial-gradient(center, ellipse cover, rgba(34,34,34,1) 0%,rgba(119,119,119,1) 100%); /* IE10+ */ +background: radial-gradient(ellipse at center, rgba(34,34,34,1) 0%,rgba(119,119,119,1) 100%); /* W3C */ +filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#777777',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ + +} + + + + + + + + + + diff --git a/includes/header.php b/includes/header.php index e654cd3..11a99db 100644 --- a/includes/header.php +++ b/includes/header.php @@ -39,6 +39,7 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a @@ -161,16 +71,13 @@ function getChatDone(data) { p = ''; p = p+ "
"; p = p+ " ["+timestamp+"]"; - p = p+ "
"; - - p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; p = p+ "
"; - p = p+ "
"; + p = p+ "
"; p = p+ ""; p = p+ user.displayName+":"; @@ -182,15 +89,20 @@ function getChatDone(data) { lastID = user.ID; - items.unshift('
' + p + '
'); + var strClass = ''; + console.log('cpm', user.userID, userObj.ID); + if (user.userID == userObj.ID) { + strClass += ' self'; + } + + items.unshift('
' + p + '
'); newChats = true; }); //console.log("BUILD DONE"); if (newChats) { - if (chatTimerDelay > chatTimerDelayLower) - chatTimerDelay -= 1000; + if (chatTimerDelay > chatTimerDelayLower) chatTimerDelay -= 1000; var new_chatDiv = $('
', { 'class': 'my-new-list', -- cgit v1.2.3