diff --git a/i/help.svg b/i/help.svg new file mode 100644 index 0000000..ff5db3d --- /dev/null +++ b/i/help.svg @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/index.html b/index.html index 94307cb..3913923 100644 --- a/index.html +++ b/index.html @@ -16,9 +16,10 @@
edit
edit
Designed by: Strategyzer AG & Steve Blank. Built for the web at Uni. of Portsmouth. + + diff --git a/script.js b/script.js index 19d300c..b3ec521 100644 --- a/script.js +++ b/script.js @@ -89,7 +89,7 @@ function handleFragment() { function keyboardHandler(event) { if (event.ctrlKey && event.key === 'Escape') { - const confirmed = confirm('Are you sure you want to reset the page?'); + const confirmed = confirm('Are you sure you want to remove all text from this page?'); if (confirmed) { for (const element of el.editableElements) { element.innerHTML = ''; @@ -111,6 +111,7 @@ function keyboardHandler(event) { function prep() { el.gridItems = document.querySelectorAll('.grid-item'); el.editableElements = document.querySelectorAll('[contenteditable]'); + el.help = document.querySelector('#help'); loadContent(); @@ -123,7 +124,18 @@ function prep() { for (const element of el.editableElements) { element.addEventListener('input', saveContent); } - + + el.help.addEventListener('click', openUsageDialog); + + +} + +function openUsageDialog() { + const dialog = document.querySelector('#usage'); + dialog.showModal(); + dialog.addEventListener('click', () => { + dialog.remove(); + }); } window.addEventListener('load', prep); diff --git a/styles.css b/styles.css index 293943b..7ae2486 100644 --- a/styles.css +++ b/styles.css @@ -155,4 +155,52 @@ h2 img { .grid-item:has(*:focus) { box-shadow: inset 0 0 1em #F0F7; +} + +dialog { + margin: auto; + padding: 2em; + display: flex; + flex-direction: column; +} + +dialog p { + padding-block-start: 0.3em; +} + +dialog h2 { + padding-block-start: 2em; +} + + +dialog::backdrop { + background: repeating-linear-gradient( + 45deg, + #009EE277, + #62136077, + #0076A677, + #3C023877 + ); + } + +dialog button { + align-self: flex-end; + padding: 0.5em; +} + +#help { + transition: all 0.2s linear; + align-self: flex-start; +} + +#help:hover { + transform: scale(1.2); +} + +.key { + background: #00000022; + padding: 0.2em; + border: thin dashed #000; + border-radius: 0.2em; + font-weight: bold; } \ No newline at end of file