Files
Grinch-AP/WebHostLib/static/assets/cookieNotice.js
Chris Wilson 1a62772825 Slew of minor style adjustments
- Added padding to bottom of /setup-guide to accomodate iPhone users with curved screen bottoms
- Added screen orientation detection to /player-settings to force select inputs into a single column on mobile devices
- Added an X to the cookie notice to indicate it can be closed
- Changed "Generate Game" to "Start Game" so it matches the header
2020-12-05 15:37:31 -05:00

18 lines
755 B
JavaScript

window.addEventListener('load', () => {
const cookieNoticeShown = localStorage.getItem('cookieNotice');
if (cookieNoticeShown) { return; }
const cookieNotice = document.createElement('div');
cookieNotice.innerText = "This website uses cookies to store information about the games you play.";
cookieNotice.setAttribute('id', 'cookie-notice');
const closeButton = document.createElement('span');
closeButton.setAttribute('id', 'close-button');
closeButton.innerText = 'X';
cookieNotice.appendChild(closeButton);
document.body.appendChild(cookieNotice);
cookieNotice.addEventListener('click', () => {
localStorage.setItem('cookieNotice', "1");
document.body.removeChild(cookieNotice);
});
});