Last active
March 3, 2022 00:02
-
-
Save smombartz/7ad643db152a48391e5c1f9f667febb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Unlock Event Handler --> | |
<script> | |
window.addEventListener('unlockProtocol.status', function(event) { | |
// We hide all .unlock-content elements | |
document.querySelectorAll('.unlock-content').forEach((element) => { | |
element.style.display = "none" | |
}) | |
// We show only the relevant element | |
document.querySelectorAll(`.unlock-content.${event.detail.state}`).forEach((element) => { | |
element.style.display = "block" | |
}) | |
}) | |
window.addEventListener('unlockProtocol.authenticated', function(event) { | |
// event.detail.addresss includes the address of the current user, when known | |
}) | |
window.addEventListener('unlockProtocol.transactionSent', function(event) { | |
// event.detail.hash includes the hash of the transaction sent | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment