Skip to content

Instantly share code, notes, and snippets.

@robertsheacole
Last active August 16, 2019 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertsheacole/9055ded419d75a642b473173dcae0395 to your computer and use it in GitHub Desktop.
Save robertsheacole/9055ded419d75a642b473173dcae0395 to your computer and use it in GitHub Desktop.
Russian Flag
<div class="flag">
<div class="stripe white"></div>
<div class="stripe blue"></div>
<div class="stripe red"></div>
</div>
document.querySelector('.happy').addEventListener('pointerdown', (event) => {
// Compare previous event's ID that was cached
// to current event's ID and handle accordingly
console.log(event.pointerId)
}, false);
document.querySelector('.sad').addEventListener('pointerdown', (event) => {
// Compare previous event's ID that was cached
// to current event's ID and handle accordingly
console.log(event.pointerId)
}, false);
.flag {
width: 400px;
border: 1px solid grey;
}
.stripe {
width: 400px;
height: 70px;
}
.blue {
background-color: blue;
}
.red {
background-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment