Changed copy function to show visually when stuff has been copied
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
**/*.xml
|
||||
**/*.pyc
|
||||
**/*.swp
|
||||
NOTES.md
|
||||
@@ -127,4 +127,23 @@ input[type=text]{
|
||||
color: var(--accent-color);
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.animate { animation: disappear 1s linear; }
|
||||
.copyAlert {
|
||||
background: var(--dark-accent-color);
|
||||
color: var(--header-text);
|
||||
border-radius: inherit;
|
||||
line-height: 3vw;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
opacity: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
@keyframes disappear {
|
||||
0% { opacity: 0; }
|
||||
5% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@@ -20,4 +20,10 @@ document.querySelector(".result-count").addEventListener("click", function() {
|
||||
addresses.push( element.querySelector("td:nth-child(3)").innerText );
|
||||
});
|
||||
navigator.clipboard.writeText(addresses.join('\n'));
|
||||
// Play the Copy animation
|
||||
var copyDiv = document.querySelector('.copyAlert:not(.animate)')
|
||||
if(copyDiv) {
|
||||
copyDiv.classList.add('animate');
|
||||
copyDiv.addEventListener('animationend', () => copyDiv.classList.remove('animate') );
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,5 +30,5 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='result-count'>{{targets|count}}</div>
|
||||
<div class='result-count'>{{targets|count}}<span class="copyAlert">✓</span></div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user