temp.coffee 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. globalThis.renderFns = require '../pug.json'
  2. globalThis.stylFns = require '../styl.json'
  3. debug.log "000"
  4. document.head.insertAdjacentHTML 'beforeend','<meta charset="UTF-8">'
  5. document.head.insertAdjacentHTML 'beforeend','<meta name="viewport" content="width=device-width, initial-scale=1.0">'
  6. document.head.insertAdjacentHTML('beforeend','<style>'+stylFns['main.css']+'</style>')
  7. document.head.insertAdjacentHTML('beforeend','<style type="text/tailwindcss">'+stylFns['app/temp.styl']+'</style>')
  8. document.head.insertAdjacentHTML('beforeend','<title> Кохи Борбад - Концертный зал Душанбе</title>')
  9. debug.log "001"
  10. # Маршруты
  11. routes = [
  12. { path: '/', component: require 'app/pages/Home' }
  13. { path: '/events', component: require 'app/pages/Events' }
  14. #{ path: '/about', component: require 'app/pages/About' }
  15. #{ path: '/contacts', component: require 'app/pages/Contacts' }
  16. ]
  17. tailwind.config = {
  18. content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
  19. darkMode: 'class', # или 'media' для автоматического определения системной темы
  20. theme: {
  21. extend: {
  22. colors: {
  23. # Основная палитра на основе красного золота
  24. 'primary': {
  25. 50: '#fef7ee',
  26. 100: '#fdedd6',
  27. 200: '#fbd7ad',
  28. 300: '#f8ba79',
  29. 400: '#f49343',
  30. 500: '#f17317', # Базовый красное золото
  31. 600: '#e2570d',
  32. 700: '#bc3f0d',
  33. 800: '#963213',
  34. 900: '#792b14',
  35. 950: '#411308',
  36. },
  37. # Вторичные цвета - глубокие благородные тона
  38. 'secondary': {
  39. 50: '#f8fafc',
  40. 100: '#f1f5f9',
  41. 200: '#e2e8f0',
  42. 300: '#cbd5e1',
  43. 400: '#94a3b8',
  44. 500: '#64748b',
  45. 600: '#475569',
  46. 700: '#334155',
  47. 800: '#1e293b',
  48. 900: '#0f172a',
  49. 950: '#020617',
  50. },
  51. # Акцентные цвета - контрастные элементы
  52. 'accent': {
  53. 50: '#fffbeb',
  54. 100: '#fef3c7',
  55. 200: '#fde68a',
  56. 300: '#fcd34d',
  57. 400: '#fbbf24',
  58. 500: '#f59e0b', # Теплый золотой акцент
  59. 600: '#d97706',
  60. 700: '#b45309',
  61. 800: '#92400e',
  62. 900: '#78350f',
  63. 950: '#451a03',
  64. },
  65. # Фоновые цвета для светлой и темной тем
  66. 'surface': {
  67. light: {
  68. DEFAULT: '#ffffff',
  69. variant: '#f8fafc',
  70. elevated: '#ffffff',
  71. },
  72. dark: {
  73. DEFAULT: '#0f172a',
  74. variant: '#1e293b',
  75. elevated: '#334155',
  76. }
  77. },
  78. # Статусные цвета
  79. 'success': {
  80. 50: '#f0fdf4',
  81. 100: '#dcfce7',
  82. 200: '#bbf7d0',
  83. 300: '#86efac',
  84. 400: '#4ade80',
  85. 500: '#22c55e',
  86. 600: '#16a34a',
  87. 700: '#15803d',
  88. 800: '#166534',
  89. 900: '#14532d',
  90. },
  91. 'warning': {
  92. 50: '#fffbeb',
  93. 100: '#fef3c7',
  94. 200: '#fde68a',
  95. 300: '#fcd34d',
  96. 400: '#fbbf24',
  97. 500: '#f59e0b',
  98. 600: '#d97706',
  99. 700: '#b45309',
  100. 800: '#92400e',
  101. 900: '#78350f',
  102. },
  103. 'error': {
  104. 50: '#fef2f2',
  105. 100: '#fee2e2',
  106. 200: '#fecaca',
  107. 300: '#fca5a5',
  108. 400: '#f87171',
  109. 500: '#ef4444',
  110. 600: '#dc2626',
  111. 700: '#b91c1c',
  112. 800: '#991b1b',
  113. 900: '#7f1d1d',
  114. }
  115. },
  116. # Дополнительные настройки темы
  117. fontFamily: {
  118. 'display': ['Playfair Display', 'serif'], # Для заголовков
  119. 'body': ['Inter', 'sans-serif'], # Для основного текста
  120. },
  121. backgroundImage: {
  122. 'gold-gradient': 'linear-gradient(135deg, #f17317 0%, #f59e0b 100%)',
  123. 'premium-gradient': 'linear-gradient(135deg, #792b14 0%, #411308 100%)',
  124. },
  125. boxShadow: {
  126. 'gold': '0 4px 14px 0 rgba(241, 115, 23, 0.3)',
  127. 'premium': '0 8px 32px 0 rgba(121, 43, 20, 0.4)',
  128. }
  129. },
  130. },
  131. plugins: [],
  132. }
  133. debug.log "002"
  134. # Глобальное состояние темы
  135. app = Vue.createApp
  136. name: 'app'
  137. data: ()->
  138. return {}
  139. beforeMount: ()->
  140. debug.log "start beforeMount"
  141. globalThis._ = @
  142. render: (new Function '_ctx', '_cache', renderFns['app/temp.pug'])()
  143. mounted: ->
  144. # Предзагрузка темы
  145. if localStorage.theme == 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
  146. @theme = 'dark'
  147. document.documentElement.classList.add('dark')
  148. else
  149. @theme = 'light'
  150. document.documentElement.classList.remove('dark')
  151. methods:
  152. toggleTheme: ->
  153. @theme = if @theme == 'light' then 'dark' else 'light'
  154. localStorage.setItem 'theme', @theme
  155. document.documentElement.classList.toggle 'dark'
  156. @$emit 'theme-changed', @theme
  157. components:
  158. 'themetoggle': require 'app/shared/ThemeToggle'
  159. 'multilevelmenu': require 'app/shared/MultiLevelMenu'
  160. 'imageslider': require 'app/shared/ImageSlider'
  161. app.use(VueRouter.createRouter({
  162. routes: routes
  163. history: VueRouter.createWebHistory()
  164. scrollBehavior: (to, from, savedPosition) ->
  165. if savedPosition
  166. return savedPosition
  167. else
  168. return { x: 0, y: 0 }
  169. }))
  170. app.mount('body')