243 lines
7.8 KiB
PHP
243 lines
7.8 KiB
PHP
<?php
|
|
/**
|
|
* Copyright (c) 2018.
|
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
|
* Project name: Battles-Game
|
|
*/
|
|
|
|
session_start();
|
|
if (!isset($_SESSION['uid'])) header("Location: index.php");
|
|
//include("config.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);
|
|
?>
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Окно игры</title>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
form {
|
|
padding: 3px;
|
|
width: 100%;
|
|
}
|
|
|
|
form input {
|
|
border: 1px solid silver;
|
|
padding: 10px;
|
|
width: 80%;
|
|
margin-right: .5%;
|
|
}
|
|
|
|
form input[type="submit"] {
|
|
width: 15%;
|
|
padding: 10px;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
}
|
|
|
|
.wrap {
|
|
display:grid;
|
|
background:#d7d7d7;
|
|
height: 100vh;
|
|
grid-template-rows: 45px /* Шапка */
|
|
2fr /* Окно игры */
|
|
1fr /* Окно чата*/
|
|
30px;/* Подвал */
|
|
}
|
|
|
|
header, footer {
|
|
margin: 1px;
|
|
padding: 5px;
|
|
}
|
|
|
|
#game, #chat {
|
|
overflow: auto;
|
|
}
|
|
|
|
/*************** SCROLLBAR BASE CSS ***************/
|
|
|
|
.scroll-wrapper {
|
|
overflow: hidden !important;
|
|
padding: 0 !important;
|
|
position: relative;
|
|
}
|
|
|
|
.scroll-wrapper > .scroll-content {
|
|
border: none !important;
|
|
box-sizing: content-box !important;
|
|
height: auto;
|
|
left: 0;
|
|
margin: 0;
|
|
max-height: none;
|
|
max-width: none !important;
|
|
overflow: scroll !important;
|
|
padding: 0;
|
|
position: relative !important;
|
|
top: 0;
|
|
width: auto !important;
|
|
}
|
|
|
|
.scroll-wrapper > .scroll-content::-webkit-scrollbar {
|
|
height: 0;
|
|
width: 0;
|
|
}
|
|
|
|
.scroll-element {
|
|
display: none;
|
|
}
|
|
.scroll-element, .scroll-element div {
|
|
box-sizing: content-box;
|
|
}
|
|
|
|
.scroll-element.scroll-x.scroll-scrollx_visible,
|
|
.scroll-element.scroll-y.scroll-scrolly_visible {
|
|
display: block;
|
|
}
|
|
|
|
.scroll-element .scroll-bar,
|
|
.scroll-element .scroll-arrow {
|
|
cursor: default;
|
|
}
|
|
|
|
.scroll-textarea {
|
|
border: 1px solid #cccccc;
|
|
border-top-color: #999999;
|
|
}
|
|
.scroll-textarea > .scroll-content {
|
|
overflow: hidden !important;
|
|
}
|
|
.scroll-textarea > .scroll-content > textarea {
|
|
border: none !important;
|
|
box-sizing: border-box;
|
|
height: 100% !important;
|
|
margin: 0;
|
|
max-height: none !important;
|
|
max-width: none !important;
|
|
overflow: scroll !important;
|
|
outline: none;
|
|
padding: 2px;
|
|
position: relative !important;
|
|
top: 0;
|
|
width: 100% !important;
|
|
}
|
|
.scroll-textarea > .scroll-content > textarea::-webkit-scrollbar {
|
|
height: 0;
|
|
width: 0;
|
|
}
|
|
|
|
/*************** SCROLLBAR MAC OS X ***************/
|
|
|
|
.scrollbar-macosx > .scroll-element,
|
|
.scrollbar-macosx > .scroll-element div
|
|
{
|
|
background: none;
|
|
border: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
position: absolute;
|
|
z-index: 10;
|
|
}
|
|
|
|
.scrollbar-macosx > .scroll-element div {
|
|
display: block;
|
|
height: 100%;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.scrollbar-macosx > .scroll-element .scroll-element_track { display: none; }
|
|
.scrollbar-macosx > .scroll-element .scroll-bar {
|
|
background-color: #6C6E71;
|
|
display: block;
|
|
|
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
|
filter: alpha(opacity=0);
|
|
opacity: 0;
|
|
|
|
-webkit-border-radius: 7px;
|
|
-moz-border-radius: 7px;
|
|
border-radius: 7px;
|
|
|
|
-webkit-transition: opacity 0.2s linear;
|
|
-moz-transition: opacity 0.2s linear;
|
|
-o-transition: opacity 0.2s linear;
|
|
-ms-transition: opacity 0.2s linear;
|
|
transition: opacity 0.2s linear;
|
|
}
|
|
.scrollbar-macosx:hover > .scroll-element .scroll-bar,
|
|
.scrollbar-macosx > .scroll-element.scroll-draggable .scroll-bar {
|
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
|
filter: alpha(opacity=70);
|
|
opacity: 0.7;
|
|
}
|
|
|
|
|
|
.scrollbar-macosx > .scroll-element.scroll-x {
|
|
bottom: 0px;
|
|
height: 0px;
|
|
left: 0;
|
|
min-width: 100%;
|
|
overflow: visible;
|
|
width: 100%;
|
|
}
|
|
|
|
.scrollbar-macosx > .scroll-element.scroll-y {
|
|
height: 100%;
|
|
min-height: 100%;
|
|
right: 0px;
|
|
top: 0;
|
|
width: 0px;
|
|
}
|
|
|
|
/* scrollbar height/width & offset from container borders */
|
|
.scrollbar-macosx > .scroll-element.scroll-x .scroll-bar { height: 7px; min-width: 10px; top: -9px; }
|
|
.scrollbar-macosx > .scroll-element.scroll-y .scroll-bar { left: -9px; min-height: 10px; width: 7px; }
|
|
|
|
.scrollbar-macosx > .scroll-element.scroll-x .scroll-element_outer { left: 2px; }
|
|
.scrollbar-macosx > .scroll-element.scroll-x .scroll-element_size { left: -4px; }
|
|
|
|
.scrollbar-macosx > .scroll-element.scroll-y .scroll-element_outer { top: 2px; }
|
|
.scrollbar-macosx > .scroll-element.scroll-y .scroll-element_size { top: -4px; }
|
|
|
|
/* update scrollbar offset if both scrolls are visible */
|
|
.scrollbar-macosx > .scroll-element.scroll-x.scroll-scrolly_visible .scroll-element_size { left: -11px; }
|
|
.scrollbar-macosx > .scroll-element.scroll-y.scroll-scrollx_visible .scroll-element_size { top: -11px; }
|
|
</style>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="wrap">
|
|
<header>
|
|
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
|
|
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
|
|
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
|
|
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
|
|
<a href="/klan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
|
|
<a href="/orden.php" title="Особые умения" target="main"><img src="http://placehold.it/32x32/33ff33?text=O"/></a>
|
|
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
|
|
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
|
|
</header>
|
|
<div id="game"></div>
|
|
<div id="chat"></div>
|
|
<footer>
|
|
<form action="chat.php" method="post" target="chat">
|
|
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
|
|
<input type="submit" value="Отправить">
|
|
</form>
|
|
</footer>
|
|
</div>
|
|
<script>
|
|
$( "#game" ).load( "main.php" );
|
|
$( "#chat" ).load( "chat.php" );
|
|
jQuery(document).ready(function(){
|
|
jQuery('.scrollbar-macosx').scrollbar();
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|