Update index.html

This commit is contained in:
Spencer Flagg 2024-02-05 12:26:25 +00:00
parent 89089b258f
commit bde540e250

View file

@ -12,6 +12,13 @@
button {
width: auto;
}
.alert {
padding: 1em 2em;
border-radius: 1em;
}
.alert--success {
background: #88c841;
}
</style>
</head>
<body>
@ -24,6 +31,7 @@
<li>
<button onclick="copyCode()">click here to copy this code</button>
<code id="codeBlock">curl -O https://liferaft.altweb.me/rustdesk.sh && chmod +x rustdesk.sh && ./rustdesk.sh</code>
<div class="alert alert--success" id="copy-alert">Copied!</div>
</li>
<li>
<p>Open the start menu either with your keyboard, by holding the <kbd>CTRL</kbd> key and clicking <kbd>ESC</kbd></p>
@ -45,7 +53,11 @@
function copyCode() {
const codeBlock = document.getElementById('codeBlock').innerText;
navigator.clipboard.writeText(codeBlock).then(() => {
alert('Code copied to clipboard!');
const copyAlert = document.getElementById('copy-alert');
copyAlert.style.display = 'inline-block';
setTimeout(() => {
copyAlert.style.display = 'none';
}, 10000); // Display for ten seconds (10000 milliseconds)
}, (err) => {
console.error('Error in copying text: ', err);
});