Additional cleanup for that

This commit is contained in:
Thomas Smith 2023-02-24 10:53:33 -05:00
parent 3d26698ca6
commit 2e9809ab6d
2 changed files with 31 additions and 30 deletions

View file

@ -152,41 +152,12 @@
<hr class="mb-3"> <hr class="mb-3">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<p class="install-label text-center">Install tea by running our one-liner:</p> {{- partial "click-to-copy.html" . -}}
<div class="flex pt-2 pb-2 ps-4 pe-2 mb-4 black-bg" style="width: 100%; border: 1px solid #949494; border-radius: 5px;">
<code id="copy-text" class="white">sh <(curl tea.xyz)</code>
<button class="hbtn hb-fill-right" id="copy-button">Copy</button>
</div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
<script>
$("#copy-button").on("click", function() {
var copyText = "sh <(curl https://tea.xyz)";
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
tempInput.value = copyText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
// Change the button text to 'Copied'
var button = $("#copy-button");
var originalText = button.text();
button.text("Copied!");
// Change the button text back to original after 5 seconds
setTimeout(function() {
button.text(originalText);
}, 2000);
});
</script>
<style> <style>
.term-icon{ .term-icon{

View file

@ -0,0 +1,30 @@
<p class="install-label text-center">Install tea by running our one-liner:</p>
<div class="flex pt-2 pb-2 ps-4 pe-2 mb-4 black-bg" style="width: 100%; border: 1px solid #949494; border-radius: 5px;">
<code id="copy-text" class="white">sh <(curl tea.xyz)</code>
<button class="hbtn hb-fill-right" id="copy-button">Copy</button>
</div>
<script>
$("#copy-button").on("click", function() {
var copyText = "sh <(curl https://tea.xyz)";
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
tempInput.value = copyText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
// Change the button text to 'Copied'
var button = $("#copy-button");
var originalText = button.text();
button.text("Copied!");
// Change the button text back to original after 5 seconds
setTimeout(function() {
button.text(originalText);
}, 2000);
});
</script>