国外MOSE官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.8 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <script setup lang="ts">
  2. import { Icon } from '@iconify/vue';
  3. import { computed } from 'vue';
  4. import { useI18n } from 'vue-i18n';
  5. const { t } = useI18n();
  6. // 不再使用API返回的文本数据,全部使用i18n文本
  7. // 默认架构层级数据(当API数据不可用时使用)
  8. const defaultLayers = [
  9. {
  10. id: 'aggregation',
  11. icon: 'carbon:data-share',
  12. title: t('architecture.layers.aggregation.title'),
  13. description: t('architecture.layers.aggregation.description'),
  14. features: [
  15. t('architecture.layers.aggregation.features.indexing'),
  16. t('architecture.layers.aggregation.features.sync'),
  17. t('architecture.layers.aggregation.features.storage')
  18. ]
  19. },
  20. {
  21. id: 'crosschain',
  22. icon: 'carbon:connect',
  23. title: t('architecture.layers.crosschain.title'),
  24. description: t('architecture.layers.crosschain.description'),
  25. features: [
  26. t('architecture.layers.crosschain.features.atomic_swap'),
  27. t('architecture.layers.crosschain.features.messaging'),
  28. t('architecture.layers.crosschain.features.privacy')
  29. ]
  30. },
  31. {
  32. id: 'routing',
  33. icon: 'carbon:flow',
  34. title: t('architecture.layers.routing.title'),
  35. description: t('architecture.layers.routing.description'),
  36. features: [
  37. t('architecture.layers.routing.features.algorithm'),
  38. t('architecture.layers.routing.features.optimization'),
  39. t('architecture.layers.routing.features.monitoring')
  40. ]
  41. },
  42. {
  43. id: 'application',
  44. icon: 'carbon:application',
  45. title: t('architecture.layers.application.title'),
  46. description: t('architecture.layers.application.description'),
  47. features: [
  48. t('architecture.layers.application.features.sdk'),
  49. t('architecture.layers.application.features.tools'),
  50. t('architecture.layers.application.features.components')
  51. ]
  52. }
  53. ];
  54. // 最终使用的架构层级数据,全部使用i18n
  55. const architectureLayers = computed(() => {
  56. return defaultLayers;
  57. });
  58. </script>
  59. <template>
  60. <section class="py-16 px-6 md:px-12 lg:px-24">
  61. <div class="container mx-auto">
  62. <h2 class="text-2xl md:text-3xl font-bold text-text mb-6 text-center wow animate__animated animate__fadeInUp animate__duration-fast">
  63. {{ t('architecture.title') }}
  64. </h2>
  65. <p class="max-w-3xl mx-auto text-center text-text-secondary mb-12 wow animate__animated animate__fadeIn animate__delay-xs animate__duration-fast">
  66. {{ t('architecture.subtitle') }}
  67. </p>
  68. <!-- 架构图示 - 桌面端 -->
  69. <div class="hidden md:block mb-12 relative">
  70. <!-- 连接线条 -->
  71. <div class="absolute top-1/2 left-0 w-full h-1 bg-primary-light opacity-50 transform -translate-y-1/2 z-0"></div>
  72. <!-- 架构层级 -->
  73. <div class="flex justify-between relative z-10">
  74. <div
  75. v-for="(layer, index) in architectureLayers"
  76. :key="layer.id"
  77. class="w-1/4 px-4 wow animate__animated animate__fadeIn animate__duration-fast"
  78. :class="{
  79. 'animate__delay-xs': index === 1,
  80. 'animate__delay-sm': index === 2,
  81. 'animate__delay-md': index === 3
  82. }"
  83. >
  84. <div class="bg-background-light rounded-xl p-6 shadow-card hover:shadow-lg transition-all duration-300 h-full relative">
  85. <!-- 顶部装饰图标 -->
  86. <div class="absolute top-0 left-1/2 w-10 h-10 rounded-full bg-primary flex items-center justify-center transform -translate-x-1/2 -translate-y-1/2">
  87. <Icon :icon="layer.icon" width="20" height="20" class="text-white" />
  88. </div>
  89. <h3 class="text-xl font-bold text-text mb-4 text-center pt-2">{{ layer.title }}</h3>
  90. <p class="text-text-secondary text-center mb-4">{{ layer.description }}</p>
  91. <!-- 特点列表 -->
  92. <ul v-if="layer.features && layer.features.length > 0" class="space-y-2">
  93. <li
  94. v-for="(feature, featureIndex) in layer.features"
  95. :key="`${layer.id}-feature-${featureIndex}`"
  96. class="flex items-center"
  97. >
  98. <Icon icon="carbon:dot-mark" class="mr-2 text-primary-light" />
  99. <span>{{ feature }}</span>
  100. </li>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <!-- 架构图示 - 移动端 -->
  107. <div class="md:hidden space-y-6">
  108. <div
  109. v-for="(layer, index) in architectureLayers"
  110. :key="`mobile-${layer.id}`"
  111. class="bg-background-light rounded-xl p-6 shadow-card wow animate__animated animate__fadeInUp animate__duration-fast"
  112. :class="{
  113. 'animate__delay-xs': index === 1,
  114. 'animate__delay-sm': index === 2,
  115. 'animate__delay-md': index === 3
  116. }"
  117. >
  118. <div class="flex items-center mb-4">
  119. <div class="w-10 h-10 rounded-full bg-primary flex items-center justify-center mr-4">
  120. <Icon :icon="layer.icon" width="20" height="20" class="text-white" />
  121. </div>
  122. <h3 class="text-xl font-bold text-text">{{ layer.title }}</h3>
  123. </div>
  124. <p class="text-text-secondary mb-4">{{ layer.description }}</p>
  125. <!-- 特点列表 -->
  126. <ul v-if="layer.features && layer.features.length > 0" class="space-y-2">
  127. <li
  128. v-for="(feature, featureIndex) in layer.features"
  129. :key="`${layer.id}-mobile-feature-${featureIndex}`"
  130. class="flex items-center"
  131. >
  132. <Icon icon="carbon:dot-mark" class="mr-2 text-primary-light" />
  133. <span>{{ feature }}</span>
  134. </li>
  135. </ul>
  136. </div>
  137. </div>
  138. </div>
  139. </section>
  140. </template>