Внедрение шаблонизатора.

This commit is contained in:
Igor Barkov (iwork)
2020-09-30 17:54:44 +03:00
parent 7e91ef21db
commit 8b1a2e9b38
2 changed files with 163 additions and 169 deletions
+47 -56
View File
@@ -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('Окно игры');
?>
<!doctype html>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form {
width: 100%;
text-align: center;
}
<style>
form {
width: 100%;
text-align: center;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
}
form input[type="submit"] {
width: 15%;
}
body {
margin: 0;
}
body {
margin: 0;
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
footer {
margin: 5px;
}
footer {
margin: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img:hover {
box-shadow: 0 0 7px slategray;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
a img:hover {
box-shadow: 0 0 7px slategray;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wrap">
<header>
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
@@ -98,14 +91,12 @@ if (empty($_SESSION['uid'])) header("Location: index.php");
<script>
$("#game").load("main.php");
function loadlink(){
function loadlink() {
$('#chat').load('chat.php');
}
loadlink(); // This will run on page load
setInterval(function(){
setInterval(function () {
loadlink() // this will run after every 5 seconds
}, 5000);
</script>
</body>
</html>
</script>