index.vue 6.2 KB

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