suomingxiang пре 1 дан
родитељ
комит
75f0876d16
3 измењених фајлова са 38 додато и 20 уклоњено
  1. 18
    11
      src/pages/HogoodCoffee/App.js
  2. 3
    3
      src/pages/HogoodCoffee/index.html
  3. 17
    6
      src/pages/HogoodCoffee/index.less

+ 18
- 11
src/pages/HogoodCoffee/App.js Прегледај датотеку

@@ -174,16 +174,23 @@ export default class App {
174 174
         // 获取当前锚点
175 175
         const currentHash = window.location.hash;
176 176
         // 遍历所有菜单项
177
-        menuItems.forEach(item => {
178
-            // 移除所有菜单项的 menuClicked 类
179
-            item.classList.remove('menuClicked');
180
-            // 如果当前菜单项的 href 与当前锚点匹配,则添加 menuClicked 类
181
-            const link = item.querySelector('a').getAttribute('href');
182
-            // 如果当前菜单项的 href 与当前锚点匹配,则添加 menuClicked 类
183
-            if (link === `./HogoodCoffee.html${currentHash}`) {
184
-                item.classList.add('menuClicked');
185
-            }
186
-        });
177
+        if (!currentHash) {
178
+            // 移除所有菜单项的选中状态
179
+            menuItems.forEach(item => item.classList.remove('menuClicked'));
180
+            // 给第一个菜单项添加选中状态
181
+            menuItems[0].classList.add('menuClicked');
182
+        } else {
183
+            // 遍历所有菜单项
184
+            menuItems.forEach(item => {
185
+                item.classList.remove('menuClicked');
186
+                // 获取当前菜单项的 href
187
+                const link = item.querySelector('a').getAttribute('href');
188
+                // 如果当前菜单项的 href 与当前锚点匹配,则添加 menuClicked 类
189
+                if (link === `./HogoodCoffee.html${currentHash}`) {
190
+                    item.classList.add('menuClicked');
191
+                }
192
+            });
193
+        }
187 194
         // 监听 hashchange 事件,当锚点变化时更新菜单状态
188 195
         window.addEventListener('hashchange', this.updateMenu);
189 196
     }
@@ -211,7 +218,7 @@ export default class App {
211 218
             } catch (error) { }
212 219
         }
213 220
         // 添加滚动事件监听器
214
-        window.addEventListener('scroll', updateScrollChange);
221
+        // window.addEventListener('scroll', updateScrollChange);
215 222
     }
216 223
 
217 224
 

+ 3
- 3
src/pages/HogoodCoffee/index.html Прегледај датотеку

@@ -105,12 +105,12 @@
105 105
                     Shenzhen,
106 106
                     with e-commerce channels covering Tmall、Taobao、JD、Pinduoduo、Alibaba and Douyin online
107 107
                     marketplaces.</p>
108
-                <div class="flexBox">
108
+                <div class="flexBox" style="margin-bottom: 0;">
109 109
                     <div class="p5">Internationally, the products are exported to more than 20 countries and
110 110
                         regions including the UK, USA, Russia, South Korea, Singapore, and Japan.
111 111
                     </div>
112 112
                     <div style="padding-right: 40px;">
113
-                        <div class="p4">>20</div>
113
+                        <div class="p4">><span>20</span></div>
114 114
                         <div class="p6">countries and regions</div>
115 115
                     </div>
116 116
                 </div>
@@ -156,7 +156,7 @@
156 156
         </div>
157 157
         <div class="wow domInUp banner" id="m3">
158 158
             <div class="gradientBg"></div>
159
-            <div class="wow fadeInUp title">Product Series</div>
159
+            <div class="wow fadeInUp title">Development History</div>
160 160
 
161 161
             <div class="swiper bannerSwiper">
162 162
                 <div class="swiper-wrapper">

+ 17
- 6
src/pages/HogoodCoffee/index.less Прегледај датотеку

@@ -8,7 +8,7 @@
8 8
     background-color: #fff;
9 9
     .headerPC {
10 10
         height: 120px;
11
-        box-shadow: 0px 1px 1px 0px #00000040;
11
+        box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.15);
12 12
         padding: 0 114px;
13 13
     }
14 14
 
@@ -111,13 +111,18 @@
111 111
                 width: 380px;
112 112
             }
113 113
             .p4{
114
-                font-size: 51px;
114
+                font-size: 46px;
115 115
                 font-weight: bold;
116 116
                 text-align: center;
117
-                font-family: DIN, DIN;
117
+                font-family: "思源";
118
+                padding-right: 25px;
119
+                span{
120
+                    font-family: DIN, DIN;
121
+                }
118 122
             }
119 123
             .p5{
120 124
                 width: 898px;
125
+                line-height: 50px;
121 126
             }
122 127
 
123 128
             .p6{
@@ -133,7 +138,7 @@
133 138
             color: #000000;
134 139
             text-align: center;
135 140
             font-family: 'CrimsonTextBold';
136
-            padding: 90px 0 50px 0;
141
+            padding: 140px 0 50px 0;
137 142
         }
138 143
 
139 144
         .atlasCon {
@@ -332,6 +337,7 @@ p{
332 337
         &:hover {
333 338
             color: #fff;
334 339
             background: #4D048C;
340
+            border-color: #4D048C;
335 341
         }
336 342
     }
337 343
 
@@ -397,6 +403,7 @@ p{
397 403
         // align-items: center;
398 404
         // justify-content: center;
399 405
         cursor: pointer;
406
+
400 407
         .swiper-title {
401 408
             width: 80px;
402 409
             height: 80px;
@@ -407,6 +414,8 @@ p{
407 414
             align-items: center;
408 415
             justify-content: center;
409 416
             position: relative;
417
+            font-family: DIN, DIN;
418
+
410 419
             .pop{
411 420
                 // display: none;
412 421
                 width: 725px;
@@ -414,7 +423,7 @@ p{
414 423
                 background-color: #4D048C;
415 424
                 color: #fff;
416 425
                 line-height: 1.5;
417
-                padding: 20px 10px;
426
+                padding: 20px 20px;
418 427
                 border-radius: 15px;
419 428
                 position: absolute;
420 429
                 left: -328.5px;
@@ -424,6 +433,8 @@ p{
424 433
                 opacity: 0;
425 434
                 visibility: hidden; /* 使元素不可见 */
426 435
                 transition: opacity .2s linear, visibility .2s linear; /* 添加过渡效果 */
436
+                font-family: "微软雅黑";
437
+                
427 438
                 &::after{
428 439
                     content: '';
429 440
                     position: absolute;
@@ -436,6 +447,7 @@ p{
436 447
                 }
437 448
                 span{
438 449
                     font-weight: 700;
450
+                    font-family: DIN, DIN;
439 451
                 }
440 452
             }
441 453
         }
@@ -471,7 +483,6 @@ p{
471 483
         position: absolute;
472 484
         bottom: 0;
473 485
         left: 0;
474
-        font-weight: bold;
475 486
         font-size: 24px;
476 487
         color: #FFFFFF;
477 488
         text-align: center;

Loading…
Откажи
Сачувај