Neopets: The Void Within - Quick access

Have an easy access to TVW plot main page

  1. // ==UserScript==
  2. // @name Neopets: The Void Within - Quick access
  3. // @name:es Neopets: The Void Within - Acceso rápido
  4. // @namespace Nyu@Clraik
  5. // @version 1.1
  6. // @description Have an easy access to TVW plot main page
  7. // @description:es Accede de forma rápida al plot TVW
  8. // @author Nyu
  9. // @exclude *://*.neopets.com/tvw/*
  10. // @match *://*.neopets.com/*
  11. // @icon https://images.neopets.com/homepage/marquee/icons/TVW_event_icon.png
  12. // ==/UserScript==
  13.  
  14.  
  15. if (window.top === window.self) {
  16. const today = new Date().toLocaleDateString('en-US', { timeZone: 'America/Los_Angeles' })
  17.  
  18. const divElement = document.createElement('div')
  19. divElement.classList.add('tvwQA')
  20. divElement.onclick = function() {
  21. localStorage.setItem('TVWQAclickedToday', today)
  22. location.href="https://www.neopets.com/track.php?id=2613"
  23. }
  24.  
  25. const styleElement = document.createElement('style')
  26. styleElement.textContent = `
  27. .tvwQA {
  28. width: 100px;
  29. height: 100px;
  30. background-size: 100%;
  31. cursor: pointer;
  32. position: fixed;
  33. bottom: 15px;
  34. right: 15px;
  35. z-index: 100;
  36. background-image: url('https://images.neopets.com/homepage/marquee/icons/TVW_event_icon.png');
  37. }
  38. .tvwQA:hover {
  39. transform: scale(1.1);
  40. }
  41. `
  42. const clickedToday = localStorage.getItem('TVWQAclickedToday')
  43.  
  44. if (!clickedToday || clickedToday !== today) {
  45. const img = document.createElement('img')
  46. img.src = "https://images.neopets.com/plots/tvw/header/images/notif-icon.png"
  47. img.width = 30
  48. img.style.float = 'inline-start'
  49. divElement.prepend(img)
  50. }
  51.  
  52. document.body.appendChild(divElement)
  53. document.head.appendChild(styleElement)
  54. }