summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHumberto Rocha2022-11-30 17:12:00 -0500
committerGitHub2022-11-30 15:12:00 -0700
commit676dda0cb666d4953de9a6e62dbb53ec93c759f3 (patch)
tree19629bd57d3c6365374eb31594b1c928a711026d
parentf5809ea4a1c913aee7d938ccc99fa47a0c86ff53 (diff)
downloadtakahe-676dda0cb666d4953de9a6e62dbb53ec93c759f3.tar.gz
takahe-676dda0cb666d4953de9a6e62dbb53ec93c759f3.tar.bz2
takahe-676dda0cb666d4953de9a6e62dbb53ec93c759f3.zip
Add copy to clipboard action to user's handle (#82)
-rw-r--r--static/css/style.css16
-rw-r--r--templates/identity/view.html14
2 files changed, 29 insertions, 1 deletions
diff --git a/static/css/style.css b/static/css/style.css
index 5803e0a..9df9c59 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -1050,3 +1050,19 @@ table.metadata td.name {
display: none;
}
}
+
+/* Copy to clipboard action */
+
+.copy {
+ transition: 0.2s;
+}
+
+.copy:hover {
+ color: var(--color-text-main);
+ cursor: pointer;
+}
+
+.copied, .copied:hover {
+ color: var(--color-highlight);
+ transition: 0.2s;
+}
diff --git a/templates/identity/view.html b/templates/identity/view.html
index ff42db6..f664736 100644
--- a/templates/identity/view.html
+++ b/templates/identity/view.html
@@ -34,7 +34,19 @@
{% endif %}
{% endif %}
- {{ identity.name_or_handle }} <small>@{{ identity.handle }}</small>
+ {{ identity.name_or_handle }}
+ <small>
+ @{{ identity.handle }}
+ <a title="Copy handle"
+ class="copy"
+ _="on click
+ writeText('@{{ identity.handle }}') into the navigator's clipboard
+ then add .copied
+ wait 2s
+ then remove .copied">
+ <i class="fa-solid fa-copy"></i>
+ </a>
+ </small>
</h1>
{% if identity.summary %}