app.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!--
  2. * @Author: NMTuan
  3. * @Email: NMTuan@qq.com
  4. * @Date: 2024-02-18 11:35:10
  5. * @LastEditTime: 2024-02-22 13:11:25
  6. * @LastEditors: NMTuan
  7. * @Description:
  8. * @FilePath: \timeNow\app.vue
  9. -->
  10. <template>
  11. <div class="group w-full h-screen overflow-hidden flex flex-col items-center justify-between">
  12. <Header class="opacity-0 transition-all group-hover:opacity-100"></Header>
  13. <div class="bg-white/5 w-full flex flex-col items-center justify-center py-[4vw]">
  14. <div class="select-none">
  15. <ClockWeek></ClockWeek>
  16. <ClockBoard></ClockBoard>
  17. <ClockDate></ClockDate>
  18. </div>
  19. </div>
  20. <div class="w-full px-[4px] mt-[26px]">
  21. <div v-if="settingStore.showTimeLine" class="px-[4px]">
  22. <TimeLine></TimeLine>
  23. </div>
  24. <div class="my-[4px]">
  25. <DayLine v-if="settingStore.showDayLine"></DayLine>
  26. <MonthLine v-if="settingStore.showMonthLine"></MonthLine>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script setup>
  32. const dateStore = useDateStore()
  33. const settingStore = useSettingStore()
  34. let dt
  35. onMounted(() => {
  36. dateStore.getNow()
  37. dt = setInterval(() => {
  38. dateStore.getNow()
  39. }, 97)
  40. })
  41. onBeforeUnmount(() => {
  42. clearInterval(dt)
  43. })
  44. const title = computed(() => {
  45. let tit = ''
  46. tit += dateStore.hour12
  47. tit += ':' + dateStore.minute
  48. if (settingStore.showSecond) {
  49. tit += ':' + dateStore.second
  50. }
  51. tit += ' - 压感时钟'
  52. return tit
  53. })
  54. useHead({
  55. title: title
  56. })
  57. </script>
  58. <style lang="scss">
  59. html,
  60. body,
  61. #__nuxt {
  62. background-color: #000;
  63. }
  64. @font-face {
  65. font-family: 'DigitalDismay';
  66. src: url('/fonts/DigitalDismay.otf') format('opentype');
  67. }
  68. .font {
  69. &-digital-dismay {
  70. font-family: 'DigitalDismay';
  71. }
  72. }
  73. </style>