Gogs 3 tuần trước cách đây
mục cha
commit
c0e0a044f2

+ 1 - 2
README.md

@@ -1,7 +1,6 @@
 # Текущая ззадача
 
-исправь ошибку, учт, при необходимости измени, я метод реализации:
- EventBus.$on is not a function
+напиши все файлы MultiLevelMenu, сделай коектное мобильную версию, с боковым открытием
 
 
 # применяй правила:

+ 5 - 0
doc.json

@@ -24,6 +24,11 @@
       "adr": "https://vjs.zencdn.net/8.23.3/video.min.js",
       "eventName": "videojsReady",
       "obj": "videojs"
+    },{
+     "adr": "https://cdn.jsdelivr.net/npm/openlayers@4.6.5/dist/ol.min.js",
+     "css": "https://cdn.jsdelivr.net/npm/openlayers@4.6.5/dist/ol.min.css",
+      "eventName": "leafletReady",
+      "obj": "L"
     }
   ],
   "menu": {

+ 1 - 1
lzma.coffee

@@ -10,7 +10,7 @@ ic = ()->
        window.location.reload()
     else if  not globalThis['appReady']
        initCount++
-       #setTimeout ic, 200
+       setTimeout ic, 200
 ic()
 
 

+ 19 - 0
vue/app/pages/Contacts/index.coffee

@@ -8,6 +8,7 @@ module.exports =
         contactInfo:
             phone: '+992 372 27 09 46'
             address: 'просп. Исмоила Сомони, 26'
+            map: {}
             director: 'Джумахон Розикзода'
             deputyDirector: 'Азимов Махмадюсуф'
         workingHours: [
@@ -21,6 +22,24 @@ module.exports =
     mounted: ->
         @setupAnimations()
         debug.log "Contacts page mounted"
+        marker = new ol.Feature
+            geometry: new ol.geom.Point(ol.proj.fromLonLat([68.762398,38.582698]))
+        marker.setStyle new ol.style.Style
+            image: new ol.style.Icon({src: 'https://openlayers.org/en/latest/examples/data/icon.png'})
+        vectorSource = new ol.source.Vector
+            features: [marker]
+        vectorLayer = new ol.layer.Vector
+            source: vectorSource
+        @map = new ol.Map
+            target: 'map'
+            layers: [
+                new ol.layer.Tile
+                    source: new ol.source.OSM()
+                vectorLayer
+            ]
+            view: new ol.View
+                center: ol.proj.fromLonLat([68.762398,38.582698])
+                zoom: 17
     methods:
         setupAnimations: ->
             observer = new IntersectionObserver (entries) ->

+ 4 - 1
vue/app/pages/Contacts/index.pug

@@ -81,7 +81,10 @@ section(class="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 contacts-section")
                         )
 
         div(class="mt-16 bg-white dark:bg-gray-800 rounded-2xl shadow-lg overflow-hidden animate-fade-in-up animation-delay-400")
-            div(class="h-64 bg-gray-300 dark:bg-gray-700")
+            #map(class="h-[350px] bg-gray-300 dark:bg-gray-700")
+               
+               
+               
             div(class="p-8")
                 h3(class="text-2xl font-bold text-gray-800 dark:text-white mb-4") Как добраться
                 div(class="grid grid-cols-1 md:grid-cols-2 gap-6")

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

@@ -1,5 +1,5 @@
 section
-    div(class="hero-section mb-16")
+    div(class="hero-section mb-16  pt-16")
         ImageSlider(
             :slides="heroSlides"
             :autoplay="true"

+ 39 - 48
vue/app/temp.coffee

@@ -16,14 +16,39 @@ document.head.insertAdjacentHTML('beforeend','<style  type="text/tailwindcss"  p
 ## базовой стиль приложения
 document.head.insertAdjacentHTML('beforeend','<style  type="text/tailwindcss"  page="root">'+stylFns['app/temp.styl']+'</style>')
 
+# Создаем глобальную шину событий
+class AppEventBus
+    constructor: ->
+        @events = {}
+    
+    on: (event, callback) ->
+        if !@events[event]
+            @events[event] = []
+        @events[event].push(callback)
+    
+    emit: (event, data) ->
+        if @events[event]
+            for callback in @events[event]
+                try
+                    callback(data)
+                catch error
+                    debug.log "Event bus error: " + error
+    
+    off: (event, callback) ->
+        if @events[event]
+            @events[event] = @events[event].filter (cb) -> cb != callback
+
+# Создаем глобально
+globalThis.EventBus = new AppEventBus()
+
 # CouchDB сервис
 class CouchDBService
     constructor: ->
-        @baseUrl = 'https://couchdb.favt.ru.net'
+        @baseUrl = 'http://localhost:5984'
         @dbName = 'kohi_borbad_events'
         @headers = 
             'Content-Type': 'application/json'
-            'Authorization': 'Basic ' + btoa('oleg:631074')
+            'Authorization': 'Basic ' + btoa('admin:password')
 
     getAllEvents: ->
         try
@@ -62,10 +87,6 @@ class CouchDBService
                 category: event.category
 
 # Маршруты
-routes = [
-    { path: '/', component: require 'app/pages/Home' }
-]
-components = {}
 routes = [
     { path: '/', component: require 'app/pages/Home' }
     { path: '/events', component: require 'app/pages/Events' }
@@ -73,17 +94,6 @@ routes = [
     { path: '/contacts', component: require 'app/pages/Contacts' }
 ]
 
-components =
-        'themetoggle':      require 'app/shared/ThemeToggle'
-        'multilevelmenu':   require 'app/shared/MultiLevelMenu'
-        'imageslider':      require 'app/shared/ImageSlider'
-        'modalwindow':      require 'app/shared/ModalWindow'
-        'formvalidator':    require 'app/shared/FormValidator'
-        'filtersort':       require 'app/shared/FilterSort'
-        'eventdetailmodal': require 'app/shared/EventDetailModal'
-        'successmodal':     require 'app/shared/SuccessModal'
-
-
 # Глобальное определение vuejs приложения
 app = Vue.createApp
     name: 'app'
@@ -118,7 +128,7 @@ app = Vue.createApp
         await @loadEventsData()
         
         # Обработчик открытия модальных окон
-        EventBus.$on 'open-modal', (config) =>
+        EventBus.on 'open-modal', (config) =>
             @modalState.currentModal = config.component
             @modalState.modalProps = config.props || {}
     methods:
@@ -126,7 +136,6 @@ app = Vue.createApp
             @theme = if @theme == 'light' then 'dark' else 'light'
             localStorage.setItem 'theme', @theme
             document.documentElement.classList.toggle 'dark'
-            @$emit 'theme-changed', @theme
         
         loadEventsData: ->
             @appState.loading = true
@@ -225,33 +234,15 @@ app = Vue.createApp
         closeModal: ->
             @modalState.currentModal = null
             @modalState.modalProps = {}
-    components: components
-
-
-# Создаем глобальную шину событий
-class AppEventBus
-    constructor: ->
-        @events = {}
-    
-    on: (event, callback) ->
-        if !@events[event]
-            @events[event] = []
-        @events[event].push(callback)
-    
-    emit: (event, data) ->
-        if @events[event]
-            for callback in @events[event]
-                try
-                    callback(data)
-                catch error
-                    debug.log "Event bus error: " + error
-    
-    off: (event, callback) ->
-        if @events[event]
-            @events[event] = @events[event].filter (cb) -> cb != callback
-
-# Создаем глобально
-globalThis.EventBus = new AppEventBus()
+    components:
+        'themetoggle':    require 'app/shared/ThemeToggle'
+        'multilevelmenu': require 'app/shared/MultiLevelMenu'
+        'imageslider':    require 'app/shared/ImageSlider'
+        'modalwindow':    require 'app/shared/ModalWindow'
+        'formvalidator':  require 'app/shared/FormValidator'
+        'filtersort':     require 'app/shared/FilterSort'
+        'eventdetailmodal': require 'app/shared/EventDetailModal'
+        'successmodal':   require 'app/shared/SuccessModal'
 
 app.use(VueRouter.createRouter({
     routes: routes
@@ -265,10 +256,10 @@ app.use(VueRouter.createRouter({
 
 # Глобальные функции для работы с модальными окнами
 globalThis.openModal = (component, props = {}) ->
-    EventBus.$emit 'open-modal', { component, props }
+    EventBus.emit 'open-modal', { component, props }
 
 globalThis.closeModal = ->
-    EventBus.$emit 'close-modal'
+    EventBus.emit 'close-modal'
 
 # подключаем в body ОБЯЗАТЕЛЬНО!!!
 app.mount('body')

+ 1 - 1
vue/app/temp.pug

@@ -20,7 +20,7 @@ div(id="app" class="min-h-full bg-gray-50 dark:bg-gray-900 transition-colors dur
                             div(class="footer-section")
                                 h3(class="text-xl font-bold text-accent mb-4") Контакты
                                 p пр. И. Сомони, 26, Душанбе
-                                p Телефон: +992 (37) 235-48-64
+                                p Телефон: +992 372 27 09 46
                                 p Email: info@kohi-borbad.tj
                             
                             div(class="footer-section")

+ 15 - 5
vue/app/temp.styl

@@ -1,12 +1,22 @@
+
 // vue/app/temp.styl
 
-@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap')
-.page-slide-enter-active { transition: all 0.3s ease-out; }
-.page-slide-leave-active { transition: all 0.3s ease-in; }
-.page-slide-enter-from { opacity: 0; transform: translateX(30px); }
-.page-slide-leave-to { opacity: 0; transform: translateX(-30px); }
 
 
+.page-slide-enter-active
+  transition all 0.3s ease-out
+
+.page-slide-leave-active
+  transition all 0.3s ease-in
+
+.page-slide-enter-from
+  opacity 0
+  transform translateX(30px)
+
+.page-slide-leave-to
+  opacity 0
+  transform translateX(-30px)
+
 // Глобальные стили и анимации для всего проекта