CaseCard.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="case-container">
  3. <div class="case-cards">
  4. <div class="card-content">
  5. <!-- 左侧 Tabs -->
  6. <div class="tabs-list">
  7. <div v-for="(item, index) in cases" :key="index" class="tab-item" :class="{ active: activeIndex === index }"
  8. @click="activeIndex = index">
  9. {{ item.title }}
  10. </div>
  11. </div>
  12. <!-- 右侧内容 -->
  13. <div class="tab-content">
  14. <transition name="fade" mode="out-in">
  15. <div :key="activeIndex" class="content-wrapper">
  16. <div class="text-content">
  17. <h3 class="title">{{ cases[activeIndex].title }}</h3>
  18. <p class="description">{{ cases[activeIndex].description }}</p>
  19. <h4 class="title">业务价值</h4>
  20. <p class="value-desc">{{ cases[activeIndex].value }}</p>
  21. </div>
  22. <div class="image-content">
  23. <NuxtImg :width="cases[activeIndex].width" :src="cases[activeIndex].image"
  24. :alt="cases[activeIndex].title" />
  25. </div>
  26. </div>
  27. </transition>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup>
  34. const activeIndex = ref(0);
  35. const cases = [
  36. {
  37. title: '网站提速',
  38. description: '针对网页静态资源的优化和加速分发,解决网站流量激增时用户请求量、带宽负载增高、服务器压力过大以及站点响应缓慢的问题。',
  39. value: '通过压缩优化,快速加载大图、样式等资源,缩短网页响应时间,提升用户体验。访问数据决定回源行为,减少回源流量,提高请求命中率,降低带宽成本。',
  40. image: '/images/products/case1.png',
  41. width: '302'
  42. },
  43. {
  44. title: '下载加速',
  45. description: '适用于网站或应用的静态大文件分发,如游戏安装包、应用更新文件、补丁程序文件、音视频文件、建筑数据模型、医疗图像等较大的文件。',
  46. value: '通过海量加速节点,用户获得极速下载体验。分段缓存技术增强大文件下载的传输稳定性,确保顺畅的文件传输。',
  47. image: '/images/products/case2.png',
  48. width: '396'
  49. },
  50. {
  51. title: '音视频加速',
  52. description: '针对视频网站、短视频等业务场景,优化源站出口压力,解决用户在观看音视频时的卡顿和不流畅问题。',
  53. value: '通过海量加速节点支持高并发,提供高速稳定的资源分发,确保流畅、稳定和丰富的观看体验。同时,丰富的访问控制功能有效防止用户盗用媒体资源。',
  54. image: '/images/products/case3.png',
  55. width: '288'
  56. },
  57. {
  58. title: '安全防护',
  59. description: '黑客通过扫描发现互联网应用的安全漏洞,并利用爬虫、挂马、黑客病毒、数据泄露、CC攻击等手段入侵服务器和数据库,窃取核心业务数据。',
  60. value: '提供恶意URL过滤、入侵防护等全面的用户防护能力,有效防御常见Web攻击。同时提供Referer黑白名单和高阶URL鉴权,全面解决盗链问题。',
  61. image: '/images/products/case4.png',
  62. width: '286'
  63. }
  64. ];
  65. </script>
  66. <style lang="scss" scoped>
  67. .case-container {
  68. position: relative;
  69. width: 100%;
  70. height: 800PX;
  71. background: url('/images/products/case-bg.png') no-repeat center;
  72. background-size: cover;
  73. display: flex;
  74. align-items: center;
  75. justify-content: center;
  76. margin-bottom: 140PX;
  77. &::before {
  78. position: absolute;
  79. content: '应用场景';
  80. top: -45PX;
  81. left: 50%;
  82. transform: translateX(-50%);
  83. font-size: 45PX;
  84. font-style: normal;
  85. font-weight: 500;
  86. line-height: 45PX;
  87. background: linear-gradient(91deg, #B8AFFF 10.8%, #C597FF 108.3%);
  88. background-clip: text;
  89. -webkit-background-clip: text;
  90. -webkit-text-fill-color: transparent;
  91. }
  92. .case-cards {
  93. width: 100%;
  94. max-width: 1200PX;
  95. margin-top: 60PX;
  96. }
  97. .card-content {
  98. display: flex;
  99. gap: 80PX;
  100. align-items: flex-start;
  101. }
  102. .tabs-list {
  103. display: flex;
  104. flex-direction: column;
  105. gap: 24PX;
  106. width: 224PX;
  107. flex-shrink: 0;
  108. }
  109. .tab-item {
  110. height: 72PX;
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. border-radius: 8PX;
  115. border: 1PX solid rgba(255, 255, 255, 0.20);
  116. background: rgba(255, 255, 255, 0.10);
  117. color: rgba(255, 255, 255, 0.60);
  118. ;
  119. cursor: pointer;
  120. font-size: 26PX;
  121. font-weight: 400;
  122. line-height: 26PX;
  123. &:hover {
  124. border-radius: 8PX;
  125. background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
  126. }
  127. &.active {
  128. background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
  129. color: #fff;
  130. font-weight: 500;
  131. }
  132. }
  133. .tab-content {
  134. flex: 1;
  135. color: #fff;
  136. height: 500PX; // Fixed height to prevent jitter
  137. }
  138. .content-wrapper {
  139. display: flex;
  140. align-items: stretch;
  141. /* 让左右两列在高度上保持一致(无 JS) */
  142. gap: 36PX;
  143. }
  144. .text-content {
  145. width: 540PX;
  146. flex-shrink: 0;
  147. display: flex;
  148. flex-direction: column;
  149. gap: 18PX;
  150. justify-content: center;
  151. .title {
  152. font-size: 36PX;
  153. font-weight: 500;
  154. }
  155. .description {
  156. font-size: 18PX;
  157. font-weight: 400;
  158. line-height: 36PX;
  159. margin-bottom: 38PX;
  160. }
  161. .value-desc {
  162. font-size: 18PX;
  163. font-weight: 400;
  164. line-height: 36PX;
  165. }
  166. }
  167. .image-content {
  168. max-width: 540PX;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. :deep(img) {
  173. width: 100%;
  174. height: auto;
  175. }
  176. }
  177. }
  178. .fade-enter-active,
  179. .fade-leave-active {
  180. transition: opacity 0.3s ease;
  181. }
  182. .fade-enter-from,
  183. .fade-leave-to {
  184. opacity: 0;
  185. }
  186. </style>