ProfileVideo.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <script lang="ts">
  2. import { defineComponent } from 'vue'
  3. import { config } from '@/main'
  4. import { useRouter } from 'vue-router'
  5. export default defineComponent({
  6. name: 'ProfileVideo',
  7. props: {
  8. id: {
  9. type: Number,
  10. required: true,
  11. },
  12. accountId: {
  13. type: String,
  14. required: true
  15. }
  16. },
  17. data() {
  18. return {
  19. config,
  20. }
  21. },
  22. setup() {
  23. const router = useRouter();
  24. return { router }
  25. },
  26. })
  27. </script>
  28. <template>
  29. <div class="profile-video" @click="this.router.push(`/profile/${accountId}/videos?video=${id}`)">
  30. <img :src="`${config.serverURL}/video/${id}/thumbnail`" class="profile-video-thumbnail" />
  31. </div>
  32. </template>
  33. <style scoped>
  34. .profile-video {
  35. border-radius: 15px;
  36. border: 2px solid var(--accent-color);
  37. width: 200px;
  38. height: 300px;
  39. }
  40. .profile-video:hover {
  41. cursor: pointer;
  42. animation-name: interaction;
  43. animation-duration: 1s;
  44. animation-iteration-count: infinite;
  45. }
  46. .profile-video-thumbnail {
  47. border-radius: 15px;
  48. width: 100%;
  49. height: 100%;
  50. }
  51. @keyframes interaction {
  52. 0% {
  53. transform: scale(1);
  54. }
  55. 50% {
  56. transform: scale(1.2);
  57. }
  58. 100% {
  59. transform: scale(1);
  60. }
  61. }
  62. </style>