diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0d2f883 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "prettier.requireConfig": true +} \ No newline at end of file diff --git a/clip.min.js b/clip.min.js index 23bd0dd..88d96c0 100644 --- a/clip.min.js +++ b/clip.min.js @@ -1853,3 +1853,15 @@ function codePen() { $form.submit(); } + + +async function copyToClipboard() { + const code = $unprefixed.text(); + + try { + await navigator.clipboard.writeText(code); + alert('Code copied!'); + } catch (err) { + alert('Failed to copy: '); + } +} \ No newline at end of file diff --git a/index.html b/index.html index 13140e4..78fdc68 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@

Round edges

--> clip-path: ; - +
diff --git a/style.min.css b/style.min.css index acdca35..c677e2c 100644 --- a/style.min.css +++ b/style.min.css @@ -866,6 +866,10 @@ figure figcaption { flex: 1; } +.btn-copy { + cursor: pointer; +} + @media (min-width: 800px) { .css-code { margin-right: 0.5vw;