sidebar
This commit is contained in:
parent
780745f3e8
commit
ba580d9b1e
@ -78,9 +78,9 @@ $config_data = json_decode($raw_json_config, false);
|
|||||||
<title><?php print($config_data->title ?? "One Word Each"); ?></title>
|
<title><?php print($config_data->title ?? "One Word Each"); ?></title>
|
||||||
<link rel="stylesheet" href="style.css?<?php print(time()); ?>">
|
<link rel="stylesheet" href="style.css?<?php print(time()); ?>">
|
||||||
<?php
|
<?php
|
||||||
if (!isset($config_data->send_logo)) {
|
//if (!isset($config_data->send_logo)) {
|
||||||
print("<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css' integrity='sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==' crossorigin='anonymous' />");
|
print("<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css' integrity='sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==' crossorigin='anonymous' />");
|
||||||
}
|
//}
|
||||||
?>
|
?>
|
||||||
<link rel="icon" href="<?php print($config_data->logo->icon_path ?? "favicon.ico"); ?>" type="image/x-icon">
|
<link rel="icon" href="<?php print($config_data->logo->icon_path ?? "favicon.ico"); ?>" type="image/x-icon">
|
||||||
</head>
|
</head>
|
||||||
@ -95,6 +95,7 @@ $config_data = json_decode($raw_json_config, false);
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<img src="<?php print($config_data->logo->image_path ?? "OWE_Logo.png"); ?>" style="width: 10%; float: left;">
|
<img src="<?php print($config_data->logo->image_path ?? "OWE_Logo.png"); ?>" style="width: 10%; float: left;">
|
||||||
<h3 style="padding: 30px;"><?php print($config_data->headline ?? "One Word Each Seite"); ?></h3>
|
<h3 style="padding: 30px;"><?php print($config_data->headline ?? "One Word Each Seite"); ?></h3>
|
||||||
|
<button onclick="toggleArchives();" id="sidebar_button"><i class="fas fa-bars"></i></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -107,6 +108,7 @@ $config_data = json_decode($raw_json_config, false);
|
|||||||
<br><br>
|
<br><br>
|
||||||
<a href="admin.php">Admin</a>
|
<a href="admin.php">Admin</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="sentences">
|
<div class="sentences">
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
17
owe.js
17
owe.js
@ -76,11 +76,23 @@ function displayNotification(word) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onfocus = function() {
|
function toggleArchives() {
|
||||||
|
archives = document.getElementsByClassName("archive_links")[0];
|
||||||
|
|
||||||
|
if (archives.style.display == "none") {
|
||||||
|
archives.style.display = "flex";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
archives.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetUnread() {
|
||||||
unread_words = 0;
|
unread_words = 0;
|
||||||
document.getElementsByTagName("title")[0].innerText = (config_data.title ? config_data.title : "One Word Each");
|
document.getElementsByTagName("title")[0].innerText = (config_data.title ? config_data.title : "One Word Each");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.onfocus = resetUnread;
|
||||||
|
|
||||||
//setTimeout(loadSentences, 500);
|
//setTimeout(loadSentences, 500);
|
||||||
loadConfig();
|
loadConfig();
|
||||||
loadSentences();
|
loadSentences();
|
||||||
@ -105,9 +117,10 @@ if (!isMobile) {
|
|||||||
archives = document.getElementsByClassName("archive_links")[0];
|
archives = document.getElementsByClassName("archive_links")[0];
|
||||||
sentences = document.getElementsByClassName("sentences")[0];
|
sentences = document.getElementsByClassName("sentences")[0];
|
||||||
scrollbox = document.getElementsByClassName("scrollbox")[0];
|
scrollbox = document.getElementsByClassName("scrollbox")[0];
|
||||||
archives.style.maxWidth = "20%";
|
|
||||||
scrollbox.style.flexDirection = "row";
|
scrollbox.style.flexDirection = "row";
|
||||||
sentences.style.fontSize = "x-large";
|
sentences.style.fontSize = "x-large";
|
||||||
|
archives.style.order = "1";
|
||||||
|
document.getElementById("sidebar_button").style.display = "inline";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
|
|||||||
44
style.css
44
style.css
@ -4,7 +4,8 @@ body, input, button {
|
|||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: "Courier New", Courier, monospace;
|
font-family: "Courier New", Courier, monospace;
|
||||||
scrollbar-color: rgba(255,255,255,30%) rgba(100,100,100,30%);
|
scrollbar-color: rgba(255,255,255,40%) rgba(255,255,255,30%);
|
||||||
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -22,30 +23,57 @@ body {
|
|||||||
overflow: none;
|
overflow: none;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
height: 10vw;
|
height: 10vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sentences, .archive_links {
|
.main, .archive_links {
|
||||||
padding: 0px 30px 0px;
|
padding: 0px 30px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
flex-shrink: 1;
|
||||||
|
min-width: 0px;
|
||||||
|
max-width: 50em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive_links {
|
||||||
|
min-width: 50%;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 20%;
|
display: none;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive_links a {
|
||||||
|
display: block;
|
||||||
|
padding: 30px;
|
||||||
|
background: rgba(255,255,255,30%);
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive_links a:hover {
|
||||||
|
background: rgba(255,255,255,70%);
|
||||||
}
|
}
|
||||||
|
|
||||||
input, button {
|
input, button {
|
||||||
border: 2px solid white;
|
border: 2px solid white;
|
||||||
padding: 0px 5px 0px;
|
padding: 0px 5px 0px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
margin: 30px;
|
margin: 30px 0px 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: auto;
|
overflow-y: auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10vw;
|
top: 10vw;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scrollbox {
|
.scrollbox {
|
||||||
@ -72,6 +100,11 @@ a {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sidebar_button {
|
||||||
|
margin: 30px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
input, .send_button {
|
input, .send_button {
|
||||||
border: none;
|
border: none;
|
||||||
@ -82,7 +115,6 @@ input, .send_button {
|
|||||||
.word_input_area {
|
.word_input_area {
|
||||||
border: 2px solid white;
|
border: 2px solid white;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
margin: 0px 30px 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user