index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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">
  27. {{ $vuetify.lang.t("$vuetify.home.title") }}
  28. </h1>
  29. <p class="mb-4" style="color: #999; margin-top: 0">
  30. {{ $vuetify.lang.t("$vuetify.home.subtitle") }}
  31. </p>
  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. {{ $vuetify.lang.t("$vuetify.home.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.webp" width="42px" height="28px"></v-img>
  58. <a href="https://helpukrainewin.org/">
  59. {{ $vuetify.lang.t("$vuetify.home.ukraine") }}
  60. </a>
  61. </h3>
  62. </div>
  63. <div id="biggest-supporters" class="d-flex flex-column items-center py-8">
  64. <h3 class="mb-4">
  65. <v-icon class="mb-2">mdi-heart</v-icon>
  66. {{ $vuetify.lang.t("$vuetify.home.sponsors") }}
  67. </h3>
  68. <v-row class="justify-center mx-auto">
  69. <p v-for="sponsor in sponsors" :key="sponsor.name" class="sponsor">
  70. <a
  71. :style="sponsor.link ? { cursor: 'pointer' } : { cursor: 'default' }"
  72. :href="sponsor.link"
  73. rel="sponsored"
  74. >
  75. {{ sponsor.name }}
  76. </a>
  77. </p>
  78. </v-row>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. export default {
  84. transition(to, from) {
  85. if (!from) return "swoop-in";
  86. let routes = ["index", "install", "docs", "help", "faq", "donate", "links"];
  87. if (routes.indexOf(to.name) < 0) return "swoop-out";
  88. if (routes.indexOf(from.name) < 0) return "swoop-in";
  89. return routes.indexOf(to.name) > routes.indexOf(from.name)
  90. ? "swoop-left"
  91. : "swoop-right";
  92. },
  93. data() {
  94. return {
  95. installLink: "/install",
  96. githubLink: "https://github.com/Anarios/return-youtube-dislike",
  97. discordLink: "https://discord.gg/mYnESY4Md5",
  98. sponsors: [
  99. { name: "Piepacker", link: "https://piepacker.com/" },
  100. {
  101. name: "Seed4.Me VPN",
  102. link: "https://www.seed4.me/users/register?gift=ReturnYoutubeDislike",
  103. },
  104. {
  105. name: "PocketTube",
  106. link: "https://yousub.info/?utm_source=returnyoutubedislike"
  107. }, {
  108. name: "Become our sponsor",
  109. link: "https://www.patreon.com/join/returnyoutubedislike/checkout?rid=8008601"
  110. }
  111. ],
  112. };
  113. },
  114. mounted() {
  115. 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]*)/;
  116. let lastVideoId = "";
  117. window.oninput = (e) => {
  118. const videoId = (e.target.value.match(YOUTUBE_REGEX) || {})[1] || e.target.value;
  119. if (videoId !== lastVideoId && videoId.length === 11) {
  120. fetch("https://returnyoutubedislikeapi.com/votes?videoId=" + (lastVideoId = videoId))
  121. .then(resp => resp.json())
  122. .then(data => document.getElementById("output").innerText = "Likes=" + data.likes + " Dislikes=" + data.dislikes);
  123. }
  124. };
  125. },
  126. };
  127. </script>
  128. <style scoped>
  129. .sponsor {
  130. margin: 1rem;
  131. height: max-content;
  132. }
  133. input {
  134. background-color: #999999;
  135. }
  136. @media (max-width: 767px) {
  137. .sponsor {
  138. margin: 0.5rem;
  139. height: max-content;
  140. }
  141. }
  142. #thumbslogo {
  143. opacity: 0;
  144. fill: transparent;
  145. stroke: #f44;
  146. transition-property: opacity, transform;
  147. transform: scale(0) rotate(180deg);
  148. animation: popin 1s 0.3s ease-in-out 1 forwards,
  149. tap 0.3s 1.7s ease-in-out 1 forwards;
  150. }
  151. #plarrow {
  152. opacity: 0;
  153. transform: translateX(-0.25rem);
  154. transition-property: opacity, transform;
  155. animation: slidin 0.5s 1.7s ease 1 forwards;
  156. }
  157. @keyframes slidin {
  158. 0% {
  159. opacity: 0;
  160. transform: translateX(-0.25rem);
  161. }
  162. 100% {
  163. opacity: 1;
  164. transform: translateX(0);
  165. }
  166. }
  167. @keyframes popin {
  168. 0% {
  169. transform: rotate(180deg) scale(0);
  170. opacity: 0;
  171. }
  172. 100% {
  173. transform: rotate(0deg) scale(1);
  174. opacity: 1;
  175. }
  176. }
  177. @keyframes fadein {
  178. 0% {
  179. opacity: 0;
  180. }
  181. 100% {
  182. opacity: 1;
  183. }
  184. }
  185. @keyframes tap {
  186. 0% {
  187. fill: transparent;
  188. stroke: #f44;
  189. transform: scale(1);
  190. }
  191. 25% {
  192. fill: #f44;
  193. stroke: none;
  194. transform: scale(0.85);
  195. }
  196. 100% {
  197. fill: #f44;
  198. stroke: none;
  199. transform: scale(1);
  200. }
  201. }
  202. /* reduced-motion animations */
  203. @media (prefers-reduced-motion) {
  204. #thumbslogo {
  205. opacity: 1;
  206. fill: #f44;
  207. stroke: none;
  208. transform: none;
  209. animation: none;
  210. }
  211. #thumbsripple {
  212. opacity: 0;
  213. transform: none;
  214. animation: none;
  215. }
  216. #plarrow {
  217. opacity: 0;
  218. transform: none;
  219. transition-property: opacity;
  220. animation: fadein 0.5s 0.5s ease 1 forwards;
  221. }
  222. }
  223. </style>