footer.html 555 B

1234567891011121314151617181920212223
  1. <button>Test</button>
  2. <script>
  3. let start
  4. let lastTouchTimestamp = 0
  5. const button = document.querySelector('button')
  6. button.addEventListener('touchstart', () => {
  7. start = +new Date
  8. lastTouchTimestamp = start
  9. })
  10. button.addEventListener('mouseover', () => {
  11. if ((+new Date - lastTouchTimestamp) > 1000) {
  12. start = +new Date
  13. }
  14. })
  15. button.addEventListener('click', () => {
  16. button.innerText = '>>> ' + (+new Date - start) + ' <<<'
  17. start = undefined
  18. })
  19. </script>
  20. <script src="/instantpage.js" type="module" integrity="sha384-__HASH__"></script>