Option to copy the glink for client

This commit is contained in:
Aravind142857
2023-06-12 00:56:09 -05:00
parent a8b8883b11
commit 2747fd5b76
5 changed files with 142 additions and 24 deletions

51
public/css/response.css Normal file
View File

@@ -0,0 +1,51 @@
.tooltip {
position: relative;
display: inline-block;
color: yellow;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 140px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 150%;
left: 50%;
margin-left: -75px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.para {
display: inline-block;
font-family: futura;
font-size: large;
color: green;
}
.textbox {
font-family: futura;
font-size: large;
color: green;
text-align: center;
}

View File

@@ -26,4 +26,4 @@
</div>
</body>
</html>
</html>

View File

@@ -1,8 +1,5 @@
// const submit = document.getElementById("button");
function getRandomGLink() {
//
return undefined;
}
// submit.addEventListener('click', validate);
function validate() {
@@ -49,8 +46,6 @@ function getRandomGLink() {
var result = window.confirm("You have left the glink field blank. A random one will be generated for you.");
if (result === false) {
return false;
} else {
glinkStr = getRandomGLink();
}
}

14
public/src/response.js Normal file
View File

@@ -0,0 +1,14 @@
function myFunction() {
var copyText = document.getElementById("myInput");
copyText.select();
copyText.setSelectionRange(0, 99999);
navigator.clipboard.writeText(copyText.value);
var tooltip = document.getElementById("myTooltip");
tooltip.innerHTML = "Copied: " + copyText.value;
}
function outFunc() {
var tooltip = document.getElementById("myTooltip");
tooltip.innerHTML = "Copy to clipboard";
}