diff options
| author | Emma Terzioglu <emreterzioglu49@gmail.com> | 2026-03-23 14:48:36 -0700 |
|---|---|---|
| committer | Emma Terzioglu <emreterzioglu49@gmail.com> | 2026-03-23 14:48:36 -0700 |
| commit | 846397e1870a937a4560d86784effa13e8151e2f (patch) | |
| tree | 10bf3e4f55f7eeca015ad5ca0323ebbb7c65b52b /src/static | |
| parent | 9fb32f7db48f4b4ef7861699f7d8922d5784390a (diff) | |
add contact info w/ clipboardmain
Diffstat (limited to 'src/static')
| -rw-r--r-- | src/static/js/clipboard.js | 16 | ||||
| -rw-r--r-- | src/static/stylesheets/index.css | 13 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/static/js/clipboard.js b/src/static/js/clipboard.js new file mode 100644 index 0000000..5cbad5d --- /dev/null +++ b/src/static/js/clipboard.js @@ -0,0 +1,16 @@ +const copyToClipboard = (v) => { + navigator.clipboard.writeText(v) + .then(alert("text copied to clipboard!")); +} + +const clickEventHandler = (e) => { + e.preventDefault() + const raw = e.target.getAttributeNode("x-content"); + const content = atob(raw.value); + copyToClipboard(content); +} + +const copyables = document.getElementsByClassName("copyable"); +for (const c of copyables) { + c.onclick = clickEventHandler; +} diff --git a/src/static/stylesheets/index.css b/src/static/stylesheets/index.css index 316daee..ea520fb 100644 --- a/src/static/stylesheets/index.css +++ b/src/static/stylesheets/index.css @@ -21,6 +21,14 @@ gap: 4px; } +.copyable { + cursor: pointer; +} + +.copyable:hover, .copyable:focus { + text-decoration: underline; +} + #basenamering { justify-content: start; gap: 30px; @@ -38,6 +46,11 @@ padding: 20px; } +#random-img { + padding: 20px; + max-width: 250px; +} + .button { image-rendering: auto; image-rendering: crisp-edges; |
