Skip to content

Commit 80653fb

Browse files
committed
Only one modal at the time
1 parent 0fa12f1 commit 80653fb

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

static/eggup.css

+8-2
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ h2 {
339339
width: 660px;
340340
}
341341

342+
.wrapper._stats ~ .stats {
343+
display: block;
344+
}
345+
342346
.snook {
343347
background: #ffffff;
344348
border-bottom: 3px solid #c3c3c3;
@@ -1884,7 +1888,8 @@ body._party::after {
18841888
}
18851889

18861890
.wrapper._initiate,
1887-
.wrapper._snook {
1891+
.wrapper._snook,
1892+
.wrapper._stats {
18881893
animation-duration: 0.3s;
18891894
animation-fill-mode: forwards;
18901895
animation-name: wrapper-opening;
@@ -1933,7 +1938,8 @@ body._party::after {
19331938
}
19341939

19351940
.wrapper._initiate ~ .overlay,
1936-
.wrapper._snook ~ .overlay {
1941+
.wrapper._snook ~ .overlay,
1942+
.wrapper._stats ~ .overlay {
19371943
animation-duration: 0.3s;
19381944
animation-fill-mode: forwards;
19391945
animation-name: overlay-opening;

static/eggup.js

+22
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,14 @@ document.addEventListener('DOMContentLoaded', function() {
12791279
document.querySelector('.-notify').classList.toggle('_mute');
12801280
};
12811281

1282+
document.querySelector('.settings .-stats').onclick = function() {
1283+
eggup.notify('click');
1284+
document.querySelector('.-expander').click();
1285+
document.querySelector('.wrapper').classList.add('_stats');
1286+
1287+
console.log('click')
1288+
};
1289+
12821290
document.querySelector('.-expander').onclick = function(element) {
12831291
if (document.querySelector('.-trigger:checked')) {
12841292
eggup.notify('close');
@@ -1566,6 +1574,17 @@ document.addEventListener('DOMContentLoaded', function() {
15661574
return false;
15671575
}
15681576

1577+
if (document.querySelector('.wrapper._stats')) {
1578+
if (event.keyCode == '116') window.reload();
1579+
1580+
if (event.keyCode == '27') {
1581+
history.replaceState('', document.title, window.location.pathname);
1582+
document.querySelector('.wrapper').classList.remove('_stats');
1583+
}
1584+
1585+
return false;
1586+
}
1587+
15691588
if (eggup.module == 'order') {
15701589
if (event.keyCode == '13' || event.keyCode == '32') { /** Return & Space keys */
15711590
document.querySelector('.order-button__submit').click();
@@ -1696,6 +1715,7 @@ document.addEventListener('DOMContentLoaded', function() {
16961715
}
16971716
} else if (sequence.equals([83, 78, 79, 79, 75])) {
16981717
if (document.querySelector('.wrapper').classList.contains('_initiate')) return false;
1718+
if (document.querySelector('.wrapper').classList.contains('_stats')) return false;
16991719

17001720
window.game = setInterval(game, 1000/10);
17011721

@@ -2214,6 +2234,7 @@ document.addEventListener('DOMContentLoaded', function() {
22142234
if (event.which == 1 /** Only trigger on left clicks */
22152235
&& (eggup.module == 'order' || eggup.module == 'review')) {
22162236
if (document.querySelector('.wrapper').classList.contains('_snook')) return false;
2237+
if (document.querySelector('.wrapper').classList.contains('_stats')) return false;
22172238
clearTimeout(persistency);
22182239

22192240
persistency = window.setTimeout(function() {
@@ -2253,6 +2274,7 @@ document.addEventListener('DOMContentLoaded', function() {
22532274
document.ontouchstart = (event) => {
22542275
if ((eggup.module == 'order' || eggup.module == 'review')) {
22552276
if (document.querySelector('.wrapper').classList.contains('_snook')) return false;
2277+
if (document.querySelector('.wrapper').classList.contains('_stats')) return false;
22562278
clearTimeout(persistency);
22572279

22582280
persistency = window.setTimeout(function() {

0 commit comments

Comments
 (0)