diff --git a/game.php b/game.php index ccd6d9b..b89515f 100644 --- a/game.php +++ b/game.php @@ -12,67 +12,60 @@ if (empty($_SESSION['uid'])) header("Location: index.php"); //$msg = filter_input(INPUT_POST,'msg'); //$uid = $_SESSION['uid']; //if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); +Template::header('Окно игры'); ?> - - - - Окно игры - - - - - - + a img:hover { + box-shadow: 0 0 7px slategray; + } + +
@@ -98,14 +91,12 @@ if (empty($_SESSION['uid'])) header("Location: index.php"); - - \ No newline at end of file + \ No newline at end of file diff --git a/game2.php b/game2.php index 4c73e29..dea6153 100644 --- a/game2.php +++ b/game2.php @@ -12,123 +12,126 @@ if (empty($_SESSION['uid'])) header("Location: index.php"); //$msg = filter_input(INPUT_POST,'msg'); //$uid = $_SESSION['uid']; //if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg); +Template::header('Окно игры'); ?> - - - - Окно игры - - - + .chat-messages { + min-height: 93%; + max-height: 93%; + overflow: auto; + } - - + .chat-messages__content { + padding: 1px; + } + + .chat__message { + border-left: 3px solid #333; + margin-top: 2px; + padding: 2px; + } + + .chat__message_black { + border-color: #000; + } + + .chat__message_blue { + border-color: blue; + } + + .chat__message_green { + border-color: green; + } + + .chat__message_red { + border-color: red; + } + + .chat-input { + min-height: 6%; + } + + input { + font-family: arial; + font-size: 16px; + vertical-align: middle; + background: #333; + color: #fff; + border: 0; + display: inline-block; + margin: 1px; + height: 30px; + } + + .chat-form__input { + width: 79%; + } + + .chat-form__submit { + width: 18%; + } + +
Всякие заголовки, кнопки, ссылки, etc... @@ -143,7 +146,9 @@ if (empty($_SESSION['uid'])) header("Location: index.php");
- +
@@ -165,22 +170,22 @@ if (empty($_SESSION['uid'])) header("Location: index.php"); //Переменные, которые будут отправляться var var1 = null; var var2 = null; - if(act == 'auth') { + if (act == 'auth') { //Если нужно авторизоваться, получаем логин и пароль, которые были переданы в функцию var1 = login; var2 = password; - } else if(act == 'send') { + } else if (act == 'send') { //Если нужно отправить сообщение, то получаем текст из поля ввода var1 = messageInput.value; } - $.post('includes/chat.php',{ //Отправляем переменные + $.post('includes/chat.php', { //Отправляем переменные act: act, var1: var1, var2: var2 }).done(function (data) { //Заносим в контейнер ответ от сервера messages__container.innerHTML = data; - if(act == 'send') { + if (act == 'send') { //Если нужно было отправить сообщение, очищаем поле ввода messageInput.value = ''; } @@ -190,14 +195,12 @@ if (empty($_SESSION['uid'])) header("Location: index.php"); function update() { send_request('load'); } - interval = setInterval(update,500); + + interval = setInterval(update, 500); //отлавливается событие отправки формы — это поможет отказаться от обновления страницы: sendForm.onsubmit = function () { send_request('send'); return false; //Возвращаем ложь, чтобы остановить классическую отправку формы }; - - - - \ No newline at end of file + \ No newline at end of file