site: multi-page structure with shared nav; rework services, keys, contact

This commit is contained in:
Sergei Poljanski 2026-07-16 20:01:26 +04:00
commit 82fc1c6e17
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
12 changed files with 143 additions and 151 deletions

21
public/copy.js Normal file
View file

@ -0,0 +1,21 @@
// One copy button per [data-copy] element. Copies the data-copy value when
// set, otherwise the element's original text. Clipboard API needs a secure
// context — https in prod, localhost in dev; both hold.
document.querySelectorAll('[data-copy]').forEach(function (el) {
var text = el.getAttribute('data-copy') || el.textContent.trim();
var btn = document.createElement('span');
btn.innerText = 'Copy';
btn.classList.add('copy-button');
el.appendChild(btn);
btn.addEventListener('click', function () {
navigator.clipboard.writeText(text).then(function () {
btn.innerText = 'Copied!';
setTimeout(function () { btn.innerText = 'Copy'; }, 2000);
}, function () {
btn.innerText = 'Failed';
setTimeout(function () { btn.innerText = 'Copy'; }, 2000);
});
});
});