Update index.html
This commit is contained in:
parent
89089b258f
commit
bde540e250
1 changed files with 13 additions and 1 deletions
14
index.html
14
index.html
|
|
@ -12,6 +12,13 @@
|
||||||
button {
|
button {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
.alert {
|
||||||
|
padding: 1em 2em;
|
||||||
|
border-radius: 1em;
|
||||||
|
}
|
||||||
|
.alert--success {
|
||||||
|
background: #88c841;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -24,6 +31,7 @@
|
||||||
<li>
|
<li>
|
||||||
<button onclick="copyCode()">click here to copy this code</button>
|
<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>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
<p>Open the start menu either with your keyboard, by holding the <kbd>CTRL</kbd> key and clicking <kbd>ESC</kbd></p>
|
<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() {
|
function copyCode() {
|
||||||
const codeBlock = document.getElementById('codeBlock').innerText;
|
const codeBlock = document.getElementById('codeBlock').innerText;
|
||||||
navigator.clipboard.writeText(codeBlock).then(() => {
|
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) => {
|
}, (err) => {
|
||||||
console.error('Error in copying text: ', err);
|
console.error('Error in copying text: ', err);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue