diff options
author | elioat <elioat@tilde.institute> | 2024-09-03 19:36:34 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-09-03 19:36:34 -0400 |
commit | 404e486571eaa24c4c538c1fbb2fe845af4bbc23 (patch) | |
tree | f3662dba4b4e34b499b442c2fd5cea254b7ae60d /html/playground | |
parent | 193bda7716a7373f65ed54680ae051b3192c1862 (diff) | |
download | tour-404e486571eaa24c4c538c1fbb2fe845af4bbc23.tar.gz |
*
Diffstat (limited to 'html/playground')
-rw-r--r-- | html/playground/index.html | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/html/playground/index.html b/html/playground/index.html index d987c22..ec575a5 100644 --- a/html/playground/index.html +++ b/html/playground/index.html @@ -92,8 +92,14 @@ </head> <body> + <div class="playground"> + <!-- use this empty div to mount stuff --> + <div class="seesaw"></div> + <div class="slide"></div> + </div> + <div class="button-container"> - <button onclick="document.getElementById('codeInput').value='';window.location.hash='';">Clear</button> + <button onclick="clearEverything()">Clear</button> <button onclick="downloadCodeAndEditor()">Download</button> <button onclick="shareCode()">Share</button> <button onclick="evaluateCode()" class="run">Run Code</button> @@ -156,6 +162,15 @@ window.prompt("Copy the URL to share.\nBe warned! Very long URLs don't share wicked well, sometimes.", window.location.href); } + function clearEverything() { + if (!confirm('Are you sure you want to reset the playground?')) { + return; + } else { + window.location.hash = ''; + window.location.reload(); + } + } + function loadCodeFromHash() { const hash = window.location.hash.substring(1); if (hash) { |