index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div
  3. class="d-flex flex-column justify-between"
  4. style="height: calc(100vh - 10rem)"
  5. >
  6. <div class="col"></div>
  7. <div class="col">
  8. <svg
  9. id="thumbslogo"
  10. class="mb-4"
  11. width="150"
  12. height="150"
  13. viewBox="0 0 24 24"
  14. overflow="visible"
  15. >
  16. <path
  17. d="M14.9 3H6c-.9 0-1.6.5-1.9 1.2l-3 7c-.1.3-.1.5-.1.7v2c0 1.1.9 2 2 2h6.3l-.9 4.5c-.1.5 0 1 .4 1.4l1.1 1.1 6.5-6.6c.4-.4.6-.9.6-1.4V5c-.1-1.1-1-2-2.1-2zm7.4 12.8h-2.9c-.4 0-.7-.3-.7-.7V3.9c0-.4.3-.7.7-.7h2.9c.4 0 .7.3.7.7V15c0 .4-.3.8-.7.8z"
  18. />
  19. <path
  20. id="plarrow"
  21. d="m8 12.5 5.1-2.9L8 6.7v5.8z"
  22. fill="#fff"
  23. stroke="none"
  24. />
  25. </svg>
  26. <h1 class="title-text">Return YouTube Dislike</h1>
  27. <div class="mb-4" style="color: #999">
  28. <p style="margin-top: 0">
  29. Browser extension and an API that shows you dislikes on Youtube
  30. </p>
  31. </div>
  32. <v-btn
  33. :to="installLink"
  34. color="primary px-6"
  35. style="font-size: 1.5em; padding: 1em; margin-bottom: 0.5em"
  36. >
  37. <v-icon large class="mr-6">mdi-tray-arrow-down</v-icon>
  38. Install
  39. </v-btn>
  40. <br />
  41. <v-btn class="mainAltButton" :href="githubLink" target="_blank">
  42. <v-icon style="margin-right: 0.5em">mdi-github</v-icon>
  43. GitHub
  44. </v-btn>
  45. <v-btn class="mainAltButton" :href="discordLink" target="_blank">
  46. <v-icon style="margin-right: 0.5em">mdi-discord</v-icon>
  47. Discord
  48. </v-btn>
  49. </div>
  50. <!-- <div class="mb-4" style="color: #999">-->
  51. <!-- Get dislikes manually: <input placeholder=" Video URL">-->
  52. <!-- <p id="output"></p>-->
  53. <!-- </div>-->
  54. <v-spacer />
  55. <div id="support-ukraine" class="d-flex flex-column items-center py-2">
  56. <h3 class="mb-2">
  57. <v-img src="/ukraine-flag-xs.png" width="40px"></v-img>
  58. <a href="https://helpukrainewin.org/">Support Ukraine</a>
  59. </h3>
  60. </div>
  61. <div id="biggest-supporters" class="d-flex flex-column items-center py-8">
  62. <h3 class="mb-4">
  63. <v-icon class="mb-2">mdi-heart</v-icon>
  64. Sponsors
  65. </h3>
  66. <v-row class="justify-center mx-auto">
  67. <p v-for="sponsor in sponsors" :key="sponsor.name" class="sponsor">
  68. <a
  69. :style="sponsor.link ? { cursor: 'pointer' } : { cursor: 'default' }"
  70. :href="sponsor.link"
  71. rel="sponsored"
  72. >
  73. {{ sponsor.name }}
  74. </a>
  75. </p>
  76. </v-row>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. export default {
  82. transition(to, from) {
  83. if (!from) return "swoop-in";
  84. let routes = ["index", "install", "docs", "help", "faq", "donate", "links"];
  85. if (routes.indexOf(to.name) < 0) return "swoop-out";
  86. if (routes.indexOf(from.name) < 0) return "swoop-in";
  87. return routes.indexOf(to.name) > routes.indexOf(from.name)
  88. ? "swoop-left"
  89. : "swoop-right";
  90. },
  91. data() {
  92. return {
  93. installLink: "/install",
  94. githubLink: "https://github.com/Anarios/return-youtube-dislike",
  95. discordLink: "https://discord.gg/mYnESY4Md5",
  96. sponsors: [
  97. { name: "Piepacker", link: "https://piepacker.com/" },
  98. {
  99. name: "Seed4.Me VPN",
  100. link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike",
  101. },
  102. {
  103. name: "PocketTube",
  104. link: "https://yousub.info/?utm_source=returnyoutubedislike"
  105. }, {
  106. name: "Become our sponsor",
  107. link: "https://www.patreon.com/join/returnyoutubedislike/checkout?rid=8008601"
  108. }
  109. ],
  110. };
  111. },
  112. mounted() {
  113. const YOUTUBE_REGEX = /(?:http:|https:)*?\/\/(?:www\.|)(?:youtube\.com|m\.youtube\.com|youtu\.|youtube-nocookie\.com).*(?:v=|v%3D|v\/|(?:a|p)\/(?:a|u)\/\d.*\/|watch\?|vi(?:=|\/)|\/embed\/|oembed\?|be\/|e\/)([^&?%#/\n]*)/;
  114. let lastVideoId = "";
  115. window.oninput = (e) => {
  116. const videoId = (e.target.value.match(YOUTUBE_REGEX) || {})[1] || e.target.value;
  117. if (videoId !== lastVideoId && videoId.length === 11) {
  118. fetch("https://returnyoutubedislikeapi.com/votes?videoId=" + (lastVideoId = videoId))
  119. .then(resp => resp.json())
  120. .then(data => document.getElementById("output").innerText = "Likes=" + data.likes + " Dislikes=" + data.dislikes);
  121. }
  122. };
  123. },
  124. };
  125. </script>
  126. <style scoped>
  127. .sponsor {
  128. margin: 1rem;
  129. height: max-content;
  130. }
  131. input {
  132. background-color: #999999;
  133. }
  134. @media (max-width: 767px) {
  135. .sponsor {
  136. margin: 0.5rem;
  137. height: max-content;
  138. }
  139. }
  140. #thumbslogo {
  141. opacity: 0;
  142. fill: transparent;
  143. stroke: #f44;
  144. transition-property: opacity, transform;
  145. transform: scale(0) rotate(180deg);
  146. animation: popin 1s 0.3s ease-in-out 1 forwards,
  147. tap 0.3s 1.7s ease-in-out 1 forwards;
  148. }
  149. #plarrow {
  150. opacity: 0;
  151. transform: translateX(-0.25rem);
  152. transition-property: opacity, transform;
  153. animation: slidin 0.5s 1.7s ease 1 forwards;
  154. }
  155. @keyframes slidin {
  156. 0% {
  157. opacity: 0;
  158. transform: translateX(-0.25rem);
  159. }
  160. 100% {
  161. opacity: 1;
  162. transform: translateX(0);
  163. }
  164. }
  165. @keyframes popin {
  166. 0% {
  167. transform: rotate(180deg) scale(0);
  168. opacity: 0;
  169. }
  170. 100% {
  171. transform: rotate(0deg) scale(1);
  172. opacity: 1;
  173. }
  174. }
  175. @keyframes fadein {
  176. 0% {
  177. opacity: 0;
  178. }
  179. 100% {
  180. opacity: 1;
  181. }
  182. }
  183. @keyframes tap {
  184. 0% {
  185. fill: transparent;
  186. stroke: #f44;
  187. transform: scale(1);
  188. }
  189. 25% {
  190. fill: #f44;
  191. stroke: none;
  192. transform: scale(0.85);
  193. }
  194. 100% {
  195. fill: #f44;
  196. stroke: none;
  197. transform: scale(1);
  198. }
  199. }
  200. /* reduced-motion animations */
  201. @media (prefers-reduced-motion) {
  202. #thumbslogo {
  203. opacity: 1;
  204. fill: #f44;
  205. stroke: none;
  206. transform: none;
  207. animation: none;
  208. }
  209. #thumbsripple {
  210. opacity: 0;
  211. transform: none;
  212. animation: none;
  213. }
  214. #plarrow {
  215. opacity: 0;
  216. transform: none;
  217. transition-property: opacity;
  218. animation: fadein 0.5s 0.5s ease 1 forwards;
  219. }
  220. }
  221. </style>