Welcome banner

This commit is contained in:
Timon Ostertun
2020-09-26 20:10:36 +02:00
parent b32b5e3c00
commit b5b1897dac
3 changed files with 37 additions and 4 deletions

View File

@@ -188,7 +188,7 @@ $(document).ready(function(){
}); });
//Generating Cookies //Generating Cookies
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + 48 * n * 60 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"} function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null} function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
function eraseCookie(e) {createCookie(e, "", -1)} function eraseCookie(e) {createCookie(e, "", -1)}
@@ -215,8 +215,8 @@ $(document).ready(function(){
} }
},150); },150);
}) })
if (readCookie('sticky_dark_mode')) {darkSwitch.prop('checked', true); $('body').removeClass('detect-theme').removeClass('theme-light').addClass('theme-dark');} if (readCookie('sticky_dark_mode')) {createCookie('sticky_dark_mode', true, 1); darkSwitch.prop('checked', true); $('body').removeClass('detect-theme').removeClass('theme-light').addClass('theme-dark');}
if (readCookie('sticky_light_mode')) {darkSwitch.prop('checked', false); $('body').removeClass('detect-theme').removeClass('theme-dark').addClass('theme-light');} if (readCookie('sticky_light_mode')) {createCookie('sticky_light_mode', true, 1); darkSwitch.prop('checked', false); $('body').removeClass('detect-theme').removeClass('theme-dark').addClass('theme-light');}
//Auto Dark Mode //Auto Dark Mode
@@ -1331,6 +1331,20 @@ $(document).ready(function(){
colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')}); colorsArray.forEach(function (gradientBodyValue) {$('.generated-styles').append('.body-'+gradientBodyValue[0]+'{background-image: linear-gradient(to bottom, '+gradientBodyValue[1]+' 0, '+gradientBodyValue[3]+' 100%)}')});
} }
function welcomeOk() {
createCookie('sticky_welcome_banner', true, 1);
$('#menu-welcome').hideMenu();
$('.menu-hider').removeClass('no-click');
}
function showWelcome() {
if (!readCookie('sticky_welcome_banner')) {
$('.menu-hider').addClass('no-click');
$('#menu-welcome').showMenu();
}
}
$('#menu-welcome-a-okay').click(welcomeOk);
showWelcome();
initRegatten(); initRegatten();
hideLoader(); hideLoader();

View File

@@ -26,7 +26,7 @@ $(document).ready(function(){
//Creating Cookie System for PWA Hide //Creating Cookie System for PWA Hide
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + 48 * n * 60 * 60 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"} function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null} function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
function eraseCookie(e) {createCookie(e, "", -1)} function eraseCookie(e) {createCookie(e, "", -1)}

View File

@@ -187,6 +187,25 @@
</div> </div>
</div> </div>
<div id="menu-welcome" class="menu menu-box-bottom" style="height: 70vh">
<div class="content bottom-0">
<h1 class="text-center font-900">Willkommen</h1>
<p>
Diese App befindet sich zur Zeit noch in der Entwicklungs-Phase.<br>
Dadurch kann es vorkommen, dass bestimmte Funktionen noch nicht richtig funktionieren.<br>
Wenn Dir etwas ungew&ouml;hnlich vorkommt, melde uns dies bitte. Klicke dazu auf das Entwickler-Icon oben links und w&auml;hle &quot;Problem melden&quot;.<br>
Vielen Dank f&uuml;r Deine Unterst&uuml;tzung!
</p>
<p>
Mehr Informationen findest <a href="https://info.ostertun.net/regatten/beta">hier</a>.
</p>
<p>
Mit der Nutzung dieser App erkl&auml;rst Du Dich au&szlig;erdem damit einverstanden, dass wir Cookies einsetzen.
</p>
<a id="menu-welcome-a-okay" class="btn btn-m mt-2 mb-3 btn-full bg-green2-dark text-uppercase font-900" href="#">Alles klar</a>
</div>
</div>
<div id="menu-update"> <div id="menu-update">
<div class="content bottom-0"> <div class="content bottom-0">
<p class="text-center mt-5"><i class="fa fa-sync-alt fa-7x color-highlight fa-spin"></i></p> <p class="text-center mt-5"><i class="fa fa-sync-alt fa-7x color-highlight fa-spin"></i></p>