From f0b302eaa7775810375063fec99cdb5c2e6dfade Mon Sep 17 00:00:00 2001 From: Yatharth Yadav Date: Sun, 1 Feb 2026 18:12:48 +0530 Subject: [PATCH] added copy button --- config.toml | 11 +++--- static/css/copy-button-v2.css | 61 ++++++++++++++++++++++++++++++++++ static/images/check-icon.png | Bin 0 -> 372 bytes static/images/copy-icon.png | Bin 0 -> 610 bytes static/js/copy-button.js | 47 ++++++++++++++++++++++++++ 5 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 static/css/copy-button-v2.css create mode 100644 static/images/check-icon.png create mode 100644 static/images/copy-icon.png create mode 100644 static/js/copy-button.js diff --git a/config.toml b/config.toml index d1a20b3f..2b15fed5 100755 --- a/config.toml +++ b/config.toml @@ -3,7 +3,7 @@ RelativeURLs=true CanonifyURLs=true title = "Collabora Online - Community Page" copyright = "Unless a license is otherwise specified, content is under CC-BY-SA 3.0

Beaver illustrations are under Copyright © 2025 Collabora Ltd. All rights reserved." -paginate = 2 + languageCode = "en" DefaultContentLanguage = "en" enableInlineShortcodes = true @@ -53,8 +53,8 @@ type = "type" showLanguageSwitcher = false # Custom CSS and JS. Relative to /static/css and /static/js respectively. - customCSS = ["buttons.css", "anim.css", "header.css", "dropdown.css", "sidebar.css", "post-content.css"] - customJS = [] + customCSS = ["buttons.css", "anim.css", "header.css", "dropdown.css", "sidebar.css", "post-content.css", "copy-button-v2.css"] + customJS = ["copy-button.js"] [params.social] rss = true @@ -91,5 +91,8 @@ type = "type" [services.instagram] disableInlineCSS = true - [services.twitter] + [services.x] disableInlineCSS = true + +[pagination] + pagerSize = 2 diff --git a/static/css/copy-button-v2.css b/static/css/copy-button-v2.css new file mode 100644 index 00000000..c2bcf6d8 --- /dev/null +++ b/static/css/copy-button-v2.css @@ -0,0 +1,61 @@ +/* Fix positioning context */ +.highlight, +pre { + position: relative !important; +} + +.copy-button { + position: absolute !important; + top: 6px !important; + right: 6px !important; + + background: transparent !important; + background-color: transparent !important; + border: none !important; + border-radius: 4px !important; + + cursor: pointer !important; + padding: 4px !important; + z-index: 100 !important; + + transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important; + display: flex !important; + align-items: center; + justify-content: center; + + backdrop-filter: blur(2px); + appearance: none !important; + -webkit-appearance: none !important; + box-shadow: none !important; +} + +.copy-button:focus { + outline: none !important; + box-shadow: none !important; +} + +.copy-button:hover { + transform: scale(1.1) !important; + background: transparent !important; + background-color: transparent !important; +} + +.copy-button svg { + width: 16px; + height: 16px; + fill: none; + color: #333333 !important; + stroke: currentColor; + stroke-width: 2; +} + +/* Success state */ +.copy-button.copied { + background: transparent !important; + background-color: transparent !important; + border: none !important; +} + +.copy-button.copied svg { + color: #333333 !important; +} \ No newline at end of file diff --git a/static/images/check-icon.png b/static/images/check-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..59161334c1a4368ac14b3f95a2feec581667b87c GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^u0X8M!3HF^K4KRIQjEnx?oJHr&dIz4vh_S&978gk z-`=q2W-OFB{&BtggY!utn&zBE+S@ToL=Ep{F%rrE1UKZ`A8{O$LD^w;;fv#jKnuBIrrkwl+^VYwNDr2n!_H{Y!ZnY6-w-D0Lf zuBG>1pGw*(bbkI`5dqbXV2w1J?5n4ERe6L>ft+Va^AaC16!NL^B=_BpF;m{={`GE@ zb)^dX(IbqHQZx_FHJ*CoSJAh(I^~(VHnyhW*3*`o@=+B08d-8y`e;HwQ<1dq)R5CkHnN=L-7f>gwkD^6IW_3drsV z5pX;b=_RX``X^4Ks`C536mk7Ob_Jih@6`VIcW*DV@X41u*A+-M_J8l&5+}d(tv!FI zO2?PIif_&R|2%X4&#lzzb5TKLqS7|0{e}5%{T_lIyWCCZuj@>yPRpEqL!~=t`BjBU zYdx)sawhqD?sC~A)hW>F(ZMj`;XD@=2ZoLfo-Rx*4IHycz*=<)?t$lja&d{zsUy>3% z|E=;pr}*;h>lIVWzVima-Qz~;WvJ0E?T$wGxz7tWXs-` zzIlD=X2!Sk@8>%MdG~C(eg@kpF&4Qf2`MnR%*hVQueY?YF>+^2ah|us)>HoF(L;+Y zHD2B9@R+uWoqt;5$Ik3a3NB{G%F?g1pUJL`+AW>ABschs#r?-~ZclC!;##1*JYn&) zc}MogdFLfnn-^w&w=foF~FJtoXf((*Df^CK?7$S3j3^ HP6