feat: add copy code btn (#1841)

* test: copy code btn

* add copy btn svg

* add copy code btn

* fix: keyboard a11y and improve design

* show "copied !" text on the copy btn

* remove space in copied text

* Remove text shift

* handle failed copy code

* Minimize delay

* remove outline on code blocks

* refactor copycode.js

* Remove border width

Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>

* Convert timerId into a Number()

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Carlos Stenzel <carlosstenzel@hotmail.com>
Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
shubham oulkar
2025-04-26 06:21:12 +05:30
committed by GitHub
parent 021c4d69bb
commit f24f45a281
4 changed files with 178 additions and 1 deletions

View File

@@ -45,6 +45,7 @@
<script data-cfasync="false" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script data-cfasync="false" src="/js/app.js"></script>
<script data-cfasync="false" defer src="/js/menu.js"></script>
<script data-cfasync="false" defer src="/js/copycode.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<link rel="alternate" type="application/atom+xml" href="/feed.xml" title="Express Blog" />