create ose

This commit is contained in:
Tristan Schneider 2024-06-18 10:25:25 +00:00
parent 5613c1a82c
commit 88bec0c718
3 changed files with 6 additions and 5 deletions

View File

@ -129,7 +129,7 @@ $config_data = json_decode($raw_json_config, false);
<div id="login_area"> <div id="login_area">
</div> </div>
<div class="word_input_area"> <div class="word_input_area">
<input type="text" name="submitted" id="wordinput" placeholder="Nächstes Wort" autocomplete="off"> <button id="sendbut" class="send_button" onclick="sendWord()"> <textarea name="submitted" id="wordinput" placeholder="Nächster Satz" autocomplete="off"></textarea> <button id="sendbut" class="send_button" onclick="sendWord()">
<?php <?php
print(isset($config_data->send_logo) ? ("<img src='data/".$config_data->send_logo."' width='64'>") : "<i class='far fa-paper-plane'></i>"); print(isset($config_data->send_logo) ? ("<img src='data/".$config_data->send_logo."' width='64'>") : "<i class='far fa-paper-plane'></i>");
?> ?>

6
owe.js
View File

@ -31,8 +31,8 @@ function loadSentences(alertIfNew = false, increaseUnread = true) {
// color // color
var spans = document.querySelector(".sentences").getElementsByTagName("span"); var spans = document.querySelector(".sentences").getElementsByTagName("span");
// we expect this to be from the user who's turn it is now (3 users) // we expect this to be from the user who's turn it is now (2 users)
var histurnspan = spans[spans.length - 3]; var histurnspan = spans[spans.length - 2];
//console.log(histurnspan.getAttribute("style")); //console.log(histurnspan.getAttribute("style"));
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style")); document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
@ -77,7 +77,7 @@ function sendWord() {
function displayNotification(word) { function displayNotification(word) {
if (Notification.permission == 'granted') { if (Notification.permission == 'granted') {
navigator.serviceWorker.getRegistration().then(function(reg) { navigator.serviceWorker.getRegistration().then(function(reg) {
reg.showNotification("Neues Wort auf " + (config_data.title ? config_data.title : "OWE"), reg.showNotification("Neuer Satz auf " + (config_data.title ? config_data.title : "OWE"),
{ body: word, icon: (config_data.logo? config_data.logo.image_path : "OWE_Logo.png"), requireInteraction: true }); { body: word, icon: (config_data.logo? config_data.logo.image_path : "OWE_Logo.png"), requireInteraction: true });
}); });
} }

View File

@ -97,7 +97,7 @@ a {
background-color: white; background-color: white;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: auto; width: inherit;
} }
#sidebar_button { #sidebar_button {
@ -115,6 +115,7 @@ input, .send_button {
.word_input_area { .word_input_area {
border: 2px solid white; border: 2px solid white;
display: inline-flex; display: inline-flex;
width: 100%;
} }
table { table {