ChristmasLights.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div
  3. :class="{
  4. 'christmas-lights': true,
  5. loggedIn,
  6. 'christmas-lights-small': small
  7. }"
  8. >
  9. <div class="christmas-wire"></div>
  10. <template v-for="n in lights" :key="n">
  11. <span class="christmas-light"></span>
  12. <div class="christmas-wire"></div>
  13. </template>
  14. </div>
  15. </template>
  16. <script>
  17. import { mapState } from "vuex";
  18. export default {
  19. props: {
  20. small: { type: Boolean, default: false },
  21. lights: { type: Number, default: 1 }
  22. },
  23. computed: {
  24. ...mapState({
  25. loggedIn: state => state.user.auth.loggedIn
  26. })
  27. },
  28. async mounted() {
  29. this.christmas = await lofig.get("siteSettings.christmas");
  30. }
  31. };
  32. </script>
  33. <style lang="scss" scoped>
  34. .christmas-mode {
  35. .christmas-lights {
  36. position: absolute;
  37. width: 100%;
  38. height: 50px;
  39. left: 0;
  40. top: 64px;
  41. display: flex;
  42. justify-content: space-around;
  43. overflow: hidden;
  44. pointer-events: none;
  45. &.christmas-lights-small {
  46. .christmas-light {
  47. height: 28px;
  48. width: 10px;
  49. &::before {
  50. width: 10px;
  51. height: 10px;
  52. }
  53. }
  54. }
  55. .christmas-light {
  56. height: 34px;
  57. width: 12px;
  58. border-top-left-radius: 50%;
  59. border-top-right-radius: 50%;
  60. border-bottom-left-radius: 50%;
  61. border-bottom-right-radius: 50%;
  62. z-index: 2;
  63. animation: christmas-lights 30s ease infinite;
  64. &::before {
  65. content: "";
  66. display: block;
  67. width: 12px;
  68. height: 12px;
  69. background-color: rgb(6, 49, 19);
  70. border-top-left-radius: 25%;
  71. border-top-right-radius: 25%;
  72. border-bottom-left-radius: 25%;
  73. border-bottom-right-radius: 25%;
  74. }
  75. &:nth-of-type(1) {
  76. transform: rotate(5deg);
  77. }
  78. &:nth-of-type(2) {
  79. transform: rotate(-7deg);
  80. animation-delay: -5s;
  81. }
  82. &:nth-of-type(3) {
  83. transform: rotate(3deg);
  84. animation-delay: -15s;
  85. }
  86. &:nth-of-type(4) {
  87. transform: rotate(10deg);
  88. animation-delay: -10s;
  89. }
  90. &:nth-of-type(5) {
  91. transform: rotate(-3deg);
  92. animation-delay: -20s;
  93. }
  94. &:nth-of-type(6) {
  95. transform: rotate(8deg);
  96. animation-delay: -25s;
  97. }
  98. &:nth-of-type(7) {
  99. transform: rotate(-1deg);
  100. animation-delay: -30s;
  101. }
  102. &:nth-of-type(8) {
  103. transform: rotate(-4deg);
  104. animation-delay: -40s;
  105. }
  106. &:nth-of-type(9) {
  107. transform: rotate(3deg);
  108. animation-delay: -45s;
  109. }
  110. &:nth-of-type(10) {
  111. transform: rotate(-10deg);
  112. animation-delay: -35s;
  113. }
  114. }
  115. .christmas-wire {
  116. flex: 1;
  117. margin-bottom: 15px;
  118. z-index: 1;
  119. border-top: 2px solid var(--primary-color);
  120. border-radius: 50%;
  121. margin-left: -7px;
  122. margin-right: -7px;
  123. transform: scaleY(-1);
  124. transform-origin: 0% 20%;
  125. }
  126. }
  127. }
  128. @keyframes christmas-lights {
  129. 0% {
  130. background-color: magenta;
  131. box-shadow: 0 5px 15px 3px rgba(255, 0, 255, 0.55);
  132. }
  133. 17% {
  134. background-color: cyan;
  135. box-shadow: 0 5px 15px 3px rgba(0, 255, 255, 0.55);
  136. }
  137. 34% {
  138. background-color: lime;
  139. box-shadow: 0 5px 15px 3px rgba(0, 255, 0, 0.55);
  140. }
  141. 51% {
  142. background-color: yellow;
  143. box-shadow: 0 5px 15px 3px rgba(255, 255, 0, 0.55);
  144. }
  145. 68% {
  146. background-color: orange;
  147. box-shadow: 0 5px 15px 3px rgba(255, 165, 0, 0.55);
  148. }
  149. 85% {
  150. background-color: red;
  151. box-shadow: 0 5px 15px 3px rgba(255, 0, 0, 0.55);
  152. }
  153. 100% {
  154. background-color: magenta;
  155. box-shadow: 0 5px 15px 3px rgba(255, 0, 255, 0.55);
  156. }
  157. }
  158. </style>