index.coffee 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # vue/app/pages/Contacts/index.coffee
  2. document.head.insertAdjacentHTML('beforeend','<style type="text/tailwindcss">'+stylFns['app/pages/Contacts/index.styl']+'</style>')
  3. module.exports =
  4. name: 'Contacts'
  5. render: (new Function '_ctx', '_cache', renderFns['app/pages/Contacts/index.pug'])()
  6. data: ->
  7. contactInfo:
  8. phone: '+992 372 27 09 46'
  9. address: 'просп. Исмоила Сомони, 26'
  10. director: 'Джумахон Розикзода'
  11. deputyDirector: 'Азимов Махмадюсуф'
  12. workingHours: [
  13. { days: 'Понедельник - Пятница', hours: '9:00 - 18:00' }
  14. { days: 'Суббота', hours: '10:00 - 16:00' }
  15. { days: 'Воскресенье', hours: 'Выходной' }
  16. ]
  17. transportInfo:
  18. buses: ['1', '2', '3', '4', '8', '12', '18']
  19. minibuses: ['1', '2', '3', '4', '8', '12', '18', '27', '34']
  20. mounted: ->
  21. @setupAnimations()
  22. debug.log "Contacts page mounted"
  23. methods:
  24. setupAnimations: ->
  25. observer = new IntersectionObserver (entries) ->
  26. entries.forEach (entry) ->
  27. if entry.isIntersecting
  28. entry.target.classList.add('animate-fade-in-up')
  29. ,
  30. threshold: 0.1
  31. document.querySelectorAll('.contacts-section .bg-white, .contacts-section .bg-gray-800').forEach (el) ->
  32. observer.observe(el)
  33. handleContactSubmit: (formData) ->
  34. debug.log "Contact form submitted: " + JSON.stringify(formData)
  35. @$root.$emit('open-modal',
  36. component: 'SuccessModal'
  37. props:
  38. title: 'Сообщение отправлено'
  39. content: 'Мы получили ваше сообщение и свяжемся с вами в ближайшее время.'
  40. )
  41. showOnMap: ->
  42. debug.log "Showing location on map"
  43. address = encodeURIComponent(@contactInfo.address + ', Душанбе, Таджикистан')
  44. mapUrl = "https://yandex.ru/maps/?text=#{address}"
  45. window.open(mapUrl, '_blank')
  46. callPhone: ->
  47. debug.log "Calling phone: " + @contactInfo.phone
  48. window.location.href = "tel:#{@contactInfo.phone.replace(/\s/g, '')}"