CSSの単位px変換ツール
目次
CSSの単位px変換ツール
cssの単位を他の単位で置き換えます
document.addEventListener('DOMContentLoaded', function() {
const copyButtons = document.querySelectorAll('.copy-button');
copyButtons.forEach(button => {
button.addEventListener('click', function() {
const codeContainer = this.previousElementSibling;
const code = codeContainer.textContent;
navigator.clipboard.writeText(code).then(() => {
this.textContent = 'Copied!';
setTimeout(() => {
this.textContent = 'Copy';
}, 2000);
}).catch(err => {
console.error('Failed to copy text: ', err);
});
});
});
});