From bff60f007ec21b71eed52778dc0d894f6a578ce5 Mon Sep 17 00:00:00 2001 From: Zheyuan Wei Date: Tue, 19 Nov 2024 18:21:02 -0500 Subject: [PATCH] feat: copy path to clipboard on click --- docs/beta.html | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/beta.html b/docs/beta.html index 72bac30..cc2accc 100644 --- a/docs/beta.html +++ b/docs/beta.html @@ -55,12 +55,12 @@ font-weight: bold; color: green; } - #controls { + .controls { text-align: center; margin: 20px; } - #controls button, - #controls a { + .controls button, + .controls a { margin-left: 10px; margin-right: 10px; } @@ -118,6 +118,18 @@ const saveButton = document.getElementById("saveButton"); const fieldsContainer = document.getElementById("gameContainer"); const downloadLink = document.getElementById("downloadLink"); + const codeElement = document.querySelector("code"); + codeElement.addEventListener("click", () => { + const text = codeElement.textContent; + navigator.clipboard + .writeText(text) + .then(() => { + alert("Text copied to clipboard"); + }) + .catch((err) => { + console.error("Failed to copy text: ", err); + }); + }); let saveData = null; @@ -200,12 +212,16 @@

Shawarma Legend Save Editor

-
+
+
+ Save file location: + %AppData%\..\Local\s1941 + Go to Classic Version +