Skip to content
Snippets Groups Projects
Commit adb38c25 authored by Lillian Gray's avatar Lillian Gray
Browse files

Tooltip for permalink fades in and out #4

parent be3c1934
Branches
No related merge requests found
...@@ -177,15 +177,18 @@ input{font-family: 'Georgia', Serif;} ...@@ -177,15 +177,18 @@ input{font-family: 'Georgia', Serif;}
position: relative; position: relative;
} }
.getPlink::before, .getPlink::after { .getPlink::before, .getPlink::after{
position: absolute; position: absolute;
opacity: 0; opacity: 0;
transition: opacity 1s ease-in-out;
}
.getPlink.inactive::before, .getPlink.inactive::after {
visibility: hidden; visibility: hidden;
} }
.getPlink:focus::before, .getPlink:focus::after { .getPlink.active::before, .getPlink.active::after {
opacity: 1; opacity: 1;
visibility: visible;
} }
.getPlink::before { .getPlink::before {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div id="plink-form"> <div id="plink-form">
<input id="plink" type="text" value=""></input> <input id="plink" type="text" value=""></input>
<button class="getPlink" type="button" onclick= genPermalink();>Get Permalink</button> <button class="getPlink inactive" type="button" onclick= genPermalink();>Get Permalink</button>
</div> </div>
</div> </div>
......
...@@ -220,6 +220,18 @@ function genPermalink(){ ...@@ -220,6 +220,18 @@ function genPermalink(){
plinkTextField.value = permalink; plinkTextField.value = permalink;
plinkTextField.select(); plinkTextField.select();
document.execCommand('copy'); document.execCommand('copy');
//Fades tooltip in and out
var plinkButton = document.querySelector('.getPlink')
plinkButton.classList.add('active')
plinkButton.classList.remove('inactive')
setTimeout(function(){
plinkButton.classList.remove('active')
setTimeout(function(){
plinkButton.classList.add('inactive')
}, 1000);
}, 1000);
} }
$('#csvDownload').click(function () { $('#csvDownload').click(function () {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment