footer.html 926 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <button>Test</button>
  2. <script type="module">
  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 type="module">
  21. const form = document.forms[0]
  22. form.addEventListener('submit', (e) => {
  23. e.preventDefault()
  24. const cookieValue = [
  25. form.aqsael.checked ? 1 : 0,
  26. form.sleep.value,
  27. form.cacheAge.value,
  28. form.whitelist.checked ? 1 : 0,
  29. ].join(',')
  30. document.cookie = `instantpage_test=${cookieValue}`
  31. location.reload()
  32. })
  33. </script>
  34. <script src="/instantpage.js" type="module" integrity="sha384-__HASH__"></script>