NavigationList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="navigation">
  3. <div
  4. v-for="(group, index) in sortedGroups"
  5. :key="group.name"
  6. class="group-container"
  7. :style="{ animationDelay: `${index * 0.1}s` }"
  8. >
  9. <div class="group-header">
  10. <div class="group-icon-wrapper">
  11. <img
  12. v-if="group.icon"
  13. :src="group.icon"
  14. :alt="group.name"
  15. class="group-icon"
  16. @error="handleImageError"
  17. />
  18. </div>
  19. <div class="group-info">
  20. <h2 class="group-name">{{ group.name }}</h2>
  21. <p v-if="group.description" class="group-description">{{ group.description }}</p>
  22. </div>
  23. </div>
  24. <div class="links-list">
  25. <a
  26. v-for="(link, linkIndex) in sortedLinks(group.links)"
  27. :key="link.name"
  28. :href="link.url"
  29. target="_blank"
  30. rel="noopener noreferrer"
  31. class="link-item"
  32. :style="{ animationDelay: `${(index * 0.1) + (linkIndex * 0.03)}s` }"
  33. >
  34. <div class="link-icon-wrapper">
  35. <img
  36. v-if="link.icon"
  37. :src="link.icon"
  38. :alt="link.name"
  39. class="link-icon"
  40. @error="handleImageError"
  41. />
  42. </div>
  43. <div class="link-content">
  44. <div class="link-name">{{ link.name }}</div>
  45. <div v-if="link.description" class="link-description">{{ link.description }}</div>
  46. </div>
  47. <div class="link-arrow">→</div>
  48. </a>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { ref, computed, onMounted } from 'vue'
  55. import navigationData from '../data/navigation.json'
  56. const groups = ref([])
  57. onMounted(() => {
  58. groups.value = navigationData.groups || []
  59. })
  60. const sortedGroups = computed(() => {
  61. return [...groups.value].sort((a, b) => (a.sort || 0) - (b.sort || 0))
  62. })
  63. const sortedLinks = (links) => {
  64. if (!links) return []
  65. return [...links].sort((a, b) => (a.sort || 0) - (b.sort || 0))
  66. }
  67. const handleImageError = (event) => {
  68. event.target.style.display = 'none'
  69. }
  70. </script>
  71. <style scoped>
  72. .navigation {
  73. display: flex;
  74. flex-direction: column;
  75. gap: 35px;
  76. }
  77. .group-container {
  78. background: rgba(255, 255, 255, 0.95);
  79. border-radius: 20px;
  80. padding: 30px;
  81. box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  82. animation: slideIn 0.4s ease-out both;
  83. }
  84. @keyframes slideIn {
  85. from {
  86. opacity: 0;
  87. transform: translateX(-20px);
  88. }
  89. to {
  90. opacity: 1;
  91. transform: translateX(0);
  92. }
  93. }
  94. .group-header {
  95. display: flex;
  96. align-items: center;
  97. gap: 20px;
  98. margin-bottom: 25px;
  99. padding-bottom: 20px;
  100. border-bottom: 2px solid #e2e8f0;
  101. }
  102. .group-icon-wrapper {
  103. width: 60px;
  104. height: 60px;
  105. border-radius: 12px;
  106. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. padding: 12px;
  111. flex-shrink: 0;
  112. }
  113. .group-icon {
  114. width: 100%;
  115. height: 100%;
  116. object-fit: contain;
  117. filter: brightness(0) invert(1);
  118. }
  119. .group-info {
  120. flex: 1;
  121. }
  122. .group-name {
  123. font-size: 28px;
  124. color: #1a202c;
  125. margin-bottom: 5px;
  126. font-weight: 600;
  127. }
  128. .group-description {
  129. font-size: 16px;
  130. color: #718096;
  131. font-weight: 400;
  132. }
  133. .links-list {
  134. display: flex;
  135. flex-direction: column;
  136. gap: 12px;
  137. }
  138. .link-item {
  139. display: flex;
  140. align-items: center;
  141. gap: 20px;
  142. background: #f7fafc;
  143. border: 1px solid #e2e8f0;
  144. border-radius: 12px;
  145. padding: 20px 25px;
  146. text-decoration: none;
  147. color: inherit;
  148. transition: all 0.3s ease;
  149. animation: slideIn 0.4s ease-out both;
  150. }
  151. .link-item:hover {
  152. background: #ffffff;
  153. border-color: #667eea;
  154. transform: translateX(5px);
  155. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  156. }
  157. .link-icon-wrapper {
  158. width: 50px;
  159. height: 50px;
  160. border-radius: 10px;
  161. background: #ffffff;
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. padding: 10px;
  166. flex-shrink: 0;
  167. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  168. }
  169. .link-icon {
  170. width: 100%;
  171. height: 100%;
  172. object-fit: contain;
  173. }
  174. .link-content {
  175. flex: 1;
  176. min-width: 0;
  177. }
  178. .link-name {
  179. font-size: 20px;
  180. color: #2d3748;
  181. font-weight: 600;
  182. margin-bottom: 4px;
  183. }
  184. .link-description {
  185. font-size: 14px;
  186. color: #718096;
  187. line-height: 1.4;
  188. }
  189. .link-arrow {
  190. font-size: 24px;
  191. color: #667eea;
  192. opacity: 0.6;
  193. transition: all 0.3s ease;
  194. flex-shrink: 0;
  195. }
  196. .link-item:hover .link-arrow {
  197. opacity: 1;
  198. transform: translateX(5px);
  199. }
  200. @media (max-width: 768px) {
  201. .group-container {
  202. padding: 20px;
  203. }
  204. .group-name {
  205. font-size: 24px;
  206. }
  207. .link-item {
  208. padding: 15px 20px;
  209. }
  210. .link-name {
  211. font-size: 18px;
  212. }
  213. }
  214. </style>