Gogs 3 weken geleden
bovenliggende
commit
46e553391b

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
+
+# применяя правила:
+
+## стиль написания классов 
+.container.mx-auto.px-4 - не правильно
+div(class="container.mx-auto  px-4") - правильно
+
+## *не используй вызовы*
+Vue = require 'vue'
+VueRouter = require 'vue-router'
+* Подключение осуществлено глобально через файл doc.json
+
+## git 
+проверяй последние версии файлов в репозитарии, корневой каталог vue/
+от него идут пути к файлам пример: в коде -> app/temp.coffee, в репозитарии -> vue/app/temp.coffee
+https://gogs.osvoj.ru/s5l.ru/borbad.s5l.ru/src/master
+
+## файл с правилами
+

+ 11 - 0
lzma.coffee

@@ -2,6 +2,17 @@ globalThis.debug = require('debug.coffee').default
 require('headVue.coffee')
 
 
+document.documentElement.classList.add('dark')
+
+globalThis.initCount = 0
+ic = ()->
+    if initCount > 5
+       window.location.reload()
+    else if  not globalThis['appReady']
+       initCount++
+       setTimeout ic, 200
+ic()
+
 
 try
     init =  (event={})->

+ 1 - 1
vue/app/pages/Home/index.coffee

@@ -1,5 +1,5 @@
 # app/pages/Home/index.coffee
-document.head.insertAdjacentHTML('beforeend','<style type="text/tailwindcss">'+stylFns['app/pages/Home/index.styl']+'</style>')
+document.head.insertAdjacentHTML('beforeend','<style type="text/tailwindcss"  page="Home">'+stylFns['app/pages/Home/index.styl']+'</style>')
 
 module.exports =
   name: 'Home'

+ 2 - 2
vue/app/pages/Home/index.pug

@@ -1,7 +1,7 @@
 //- app/pages/Home/index.pug
-section
+section(class="pt-[3rem]")
   // Hero Section со слайдером
-  .hero-section
+  .hero-section.m-4
     imageslider(
       :slides='heroSlides'
       :autoplay='true'

+ 39 - 37
vue/app/shared/MultiLevelMenu/index.coffee

@@ -12,48 +12,50 @@ module.exports =
       {
         id: 1
         title: 'Мероприятия'
-        children: [
-          {
-            id: 11
-            title: 'Концерты'
-            children: [
-              { id: 111, title: 'Классическая музыка' }
-              { id: 112, title: 'Фольклорные концерты' }
-              { id: 113, title: 'Джазовые вечера' }
-            ]
-          }
-          {
-            id: 12
-            title: 'Фестивали'
-            children: [
-              { id: 121, title: 'Музыкальные фестивали' }
-              { id: 122, title: 'Международные события' }
-            ]
-          }
-          { id: 13, title: 'Все мероприятия' }
-        ]
+        href: '/events'
+#        children: [
+#          {
+#            id: 11
+#            title: 'Концерты'
+#            children: [
+#              { id: 111, title: 'Классическая музыка' }
+#              { id: 112, title: 'Фольклорные концерты' }
+#              { id: 113, title: 'Джазовые вечера' }
+#            ]
+#          }
+#          {
+#            id: 12
+#            title: 'Фестивали'
+#            children: [
+#              { id: 121, title: 'Музыкальные фестивали' }
+#              { id: 122, title: 'Международные события' }
+#            ]
+#          }
+#          { id: 13, title: 'Все мероприятия' }
+#        ]
       }
       {
         id: 2
         title: 'О зале'
-        children: [
-          { id: 21, title: 'История' }
-          { id: 22, title: 'Архитектура' }
-          { id: 23, title: 'Акустика' }
-          { id: 24, title: 'Галерея' }
-        ]
+        href: '/about'
+#        children: [
+#          { id: 21, title: 'История' }
+#          { id: 22, title: 'Архитектура' }
+#          { id: 23, title: 'Акустика' }
+#          { id: 24, title: 'Галерея' }
+#        ]
       }
-      {
-        id: 3
-        title: 'Посетителям'
-        children: [
-          { id: 31, title: 'Как добраться' }
-          { id: 32, title: 'Правила посещения' }
-          { id: 33, title: 'Доступная среда' }
-          { id: 34, title: 'Архив мероприятий' }
-        ]
-      }
-      { id: 4, title: 'Контакты' }
+#      {
+#        id: 3
+#        title: 'Посетителям'
+#        children: [
+#          { id: 31, title: 'Как добраться' }
+#          { id: 32, title: 'Правила посещения' }
+#          { id: 33, title: 'Доступная среда' }
+#          { id: 34, title: 'Архив мероприятий' }
+#        ]
+#      }
+      { id: 4, title: 'Контакты', href: '/contacts' }
     ]
   beforeUnmount: ->
     debug.log "slider start"

+ 7 - 3
vue/app/shared/MultiLevelMenu/index.pug

@@ -1,6 +1,7 @@
 //- app/shared/MultiLevelMenu/index.pug
 nav.relative
-  .flex.space-x-2
+
+  .flex.space-x-2(class="absolute md:relative md:block flex-col md:flex-row")
     .menu-item.relative(
       v-for='item in menuItems'
       :key='item.id'
@@ -12,7 +13,7 @@ nav.relative
         :class='getMenuItemClasses(item)'
         :aria-expanded='openSubmenu === item.id'
       )
-        | {{ item.title }}
+        a(:href="item.href") {{ item.title }}
         svg.w-4.h-4.ml-1(
           :class='{"transform rotate-180": openSubmenu === item.id, "hidden": !item.children}'
           fill='none' stroke='currentColor' viewBox='0 0 24 24'
@@ -64,7 +65,10 @@ nav.relative
                       :key='subchild.id'
                     ) {{ subchild.title }}
 
+
+  
   //- Mobile menu button (скрытый на десктопе)
-  button.mobile-menu-button(class='md:hidden p-2 rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700')
+  button.mobile-menu-button(@click="isMobileMenuOpen=!isMobileMenuOpen" class='md:hidden p-2 rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700')
     svg.w-6.h-6(fill='none' stroke='currentColor' viewBox='0 0 24 24')
       path(stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16')
+  

+ 9 - 20
vue/app/temp.coffee

@@ -1,12 +1,12 @@
-globalThis.renderFns = require '../pug.json'
-globalThis.stylFns   = require '../styl.json'
+globalThis.renderFns = require 'pug.json'
+globalThis.stylFns   = require 'styl.json'
 
 debug.log "000"
 document.head.insertAdjacentHTML 'beforeend','<meta charset="UTF-8">'
 document.head.insertAdjacentHTML 'beforeend','<meta name="viewport" content="width=device-width, initial-scale=1.0">'
 
 document.head.insertAdjacentHTML('beforeend','<style>'+stylFns['main.css']+'</style>')
-document.head.insertAdjacentHTML('beforeend','<style  type="text/tailwindcss">'+stylFns['app/temp.styl']+'</style>')
+document.head.insertAdjacentHTML('beforeend','<style  type="text/tailwindcss"  page="root">'+stylFns['app/temp.styl']+'</style>')
 
 document.head.insertAdjacentHTML('beforeend','<title> Кохи Борбад - Концертный зал Душанбе</title>')
 
@@ -15,10 +15,11 @@ debug.log "001"
 routes = [
   { path: '/', component: require 'app/pages/Home' }
   { path: '/events', component: require 'app/pages/Events' }
-  #{ path: '/about', component: require 'app/pages/About' }
+  { path: '/about', component: require 'app/pages/About' }
   #{ path: '/contacts', component: require 'app/pages/Contacts' }
 ]
-tailwind.config = require '../tailwind.config.js'
+tailwind.config = require 'tailwind.config.js'
+
 debug.log "002"
 # Глобальное состояние темы
 app = Vue.createApp
@@ -29,24 +30,12 @@ app = Vue.createApp
         debug.log "start beforeMount"
         globalThis._ = @
   render: (new Function '_ctx', '_cache', renderFns['app/temp.pug'])()
-  mounted: ->
-    # Предзагрузка темы
-    if localStorage.theme == 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
-      @theme = 'dark'
-      document.documentElement.classList.add('dark')
-    else
-      @theme = 'light'
-      document.documentElement.classList.remove('dark')
-  methods:
-    toggleTheme: ->
-      @theme = if @theme == 'light' then 'dark' else 'light'
-      localStorage.setItem 'theme', @theme
-      document.documentElement.classList.toggle 'dark'
-      @$emit 'theme-changed', @theme
+  mounted: ->{}
+  methods: {}
   components:
       'themetoggle':    require 'app/shared/ThemeToggle'
       'multilevelmenu': require 'app/shared/MultiLevelMenu'
-      'imageslider': require 'app/shared/ImageSlider'
+      'imageslider':    require 'app/shared/ImageSlider'
 app.use(VueRouter.createRouter({
   routes: routes
   history: VueRouter.createWebHistory()

+ 1 - 1
vue/app/temp.pug

@@ -6,7 +6,7 @@ div(class='min-h-full bg-gray-50 dark:bg-gray-900 transition-colors duration-300
               a(href='/' class='text-2xl font-bold text-accent') Кохи Борбад
               .flex.items-center.space-x-4
                 MultiLevelMenu
-                ThemeToggle
+                //ThemeToggle
 
         main
           router-view(v-slot='{ Component }')