-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
862 lines (720 loc) · 15 KB
/
style.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
*{
margin:0; /* 重置所有样式 */
padding:0;
box-sizing:border-box; /* width=border的宽,height=border的高 */
font-family: helvetica;,"PingFang SC","Microsoft Yahei",sans-serif;
font-size: 14px;
}
img{
width:100%;
}
:root{ /* 选择文档的根元素,相当于html元素 */
--primary-color:#ff434f;
--secondary-color:#e3e3e3;
--text-color-lightest:#e7e9ec;
--text-color-darker:#2e2e2e;
--text-color-dark:#494949;
--text-color-gray:#8b8b8b;
--text-color-drak-gray:#727272;
--text-color-light-gray:#c6c6c6;
--backdrop-color:rgba(42,42,42,0.69);
}
header{ /* 头部 */
width:100vw;
height:80px;
display: grid; /* 栅格布局 */
padding:0 40px;
grid-template-columns: 1fr 2fr; /* 第一列:第二列=1:2 */
align-items: center; /* 所有列垂直居中 */
position:relative;
z-index: 200; /* 置于最顶层 */
}
.logo{
font-size:24px;
font-weight:600;
color:var(--text-color-lightest); /* 字体颜色 */
}
header nav{
justify-self: end; /* 导航栏居右侧 */
}
header nav i{ /* 放大镜图标 */
color:var(--text-color-lightest);
}
header nav a{
color:var(--text-color-lightest);
text-decoration: none;
margin:0 24px; /* 导航栏菜单左右相隔24像素 */
}
header .burger{
display:none; /* 隐藏折叠按钮 */
}
header.sticky{ /* 当js中把class改成.sticky时才会应用 */
position: fixed;
background-color: white;
box-shadow: 0 0 18px rgba(0,0,0,0.2);
animation:dropDown 0.5s ease-in-out forwards;
}
header.sticky .logo,
header.sticky nav a,
header.sticky nav i{
color:var(--text-color-darker);
}
@keyframes dropDown{ /* 关键帧动画 */
from{
transform: translateY(-100px);
}
to{
transform: translateY(0);
}
}
.glide{
display: relative;
top:-80px; /* 轮播组件上移80像素,与导航栏重叠 */
z-index: 50; /* 置于导航栏后层 */
}
.glide__slide img,
.glide__slide video{
width:100vw; /* 和浏览器宽高一样 */
height:100vh;
object-fit:cover; /* 等比例的缩放 */
}
.slide-caption{ /* 标题文字和按钮 */
position:absolute;
z-index:70;
color:var (--text-color-lightest);
text-align: center; /* 文本居中 */
max-width:60vw;
}
.glide__slide{
display: flex; /*弹性盒布局*/
align-items: center;
justify-content: center;
}
.slide-caption h1{ /* 标题大文字 */
font-size: 54px;
font-weight: 600;
}
.slide-caption h3{ /* 标题小文字 */
font-size:24px;
margin:48px 0;
}
.slide-caption.left{ /* 第二张的标题文字和按钮 */
max-width: 80vw;
text-align: left; /* 靠左对齐 */
}
.slide-caption>*{ /* 标题下所有的直接子元素透明,用于动画 */
opacity: 0;
}
.backdrop{ /* 背景的遮罩 */
background:var(--backdrop-color);
z-index: 60; /* 置于背景图上 */
position: absolute;
width:100%;
height:100%;
left:0;
top:0;
opacity: 0.5; /* 透明度 */
}
.explore-btn{ /* 探索更多按钮 */
padding:14px 32px;
background-color:var(--primary-color);
border:0;
border-radius: 4px;
color:var(--text-color-lightest);
font-size:18px;
cursor: pointer; /* 鼠标移上去有小手的形状 */
outline:none; /* 去除谷歌浏览器点击时的蓝色边框 */
}
/* 内容区域 */
/* 通用样式 */
.content-wrapper{
display: flex;
align-items: center;
justify-content: center;
flex-direction: column; /* 按列的方式布局 */
}
section{
display: grid;
justify-items: center; /* 每个列居中对齐 */
max-width:1180px;
padding:0 80px;
}
section-bg{
position:relative;
}
section-bg::before{ /* 设置背景 */
content: "";
display: block;
position:absolute;
background-color: #f9fbfb;
width:100vw;
height:100%;
z-index:-1;
}
.title1{ /* 关于我们 */
font-size: 34px;
color:var(--text-color-darker);
}
.title1::after{ /* 关于我们下面的划线 */
content:"";
display: block;
width: 80%; /* 相对于标题"关于我们" */
height: 4px;
background-color: var(--primary-color);
margin-top:14px;
transform:translateX(10%); /* 向右移动10%居中 */
}
.intro{ /* 关于我们下面的文字简介 */
margin: 28px 0 60px 0;
font-size: 18px;
color:var(--text-color-dark-gray);
}
/* 关于我们 */
.about-us{
padding-bottom:32px;
}
.features{
display: grid;
grid-template-columns: repeat(3,1fr);
grid-template-rows: 126px 126px;
column-gap:5vw; /* 间隙,5%浏览器宽度 */
}
.feature{
display: grid;
grid-template-areas: "icon title" /* 分成四个区域 */
"icon content";
grid-template-columns: 60px 1fr;
grid-template-rows: 1fr 3fr;
}
.feature i.fas{
grid-area: icon;
font-size:34px;
color:var(--primary-color);
}
.feature-title{
grid-area:title;
font-size:18px;
color:var(--text-color-darker);
}
.feature-concent{
grid-area: content;
color:var(--text-color-gray);
margin-top: 8px;
}
/* 成功案例 */
.showcases{
max-width: unset; /* unset是inherit(继承)和initial(初始化)的通用替身 */
padding:0;
padding-top: 72px;
}
.filter-btns{
margin-top:54px;
margin-bottom: 38px;
}
.filter-btn{ /* 每个按钮样式 */
margin:0 7px;
background-color: var(--secondary-color);
border:0;
color:var(--text-color-dark-gray);
padding:8px 18px;
border-radius:4px;
cursor:pointer;
transition:0.4s; /* 0.4s的过渡效果 */
}
.filter-btn:focus, /* 按钮选中 */
.filter:active{ /* 按钮点击 */
outline:none; /* 去除边框 */
}
.filter-btn.active, /* 激活后的按钮 */
.filter-btn:hover{ /* 鼠标悬停在上的按钮 */
background-color: var(--primary-color);
color:white;
}
.showcases .cases{
width:100vw;
}
.showcases .case-item{
width:25vw;
height:20vw;
overflow:hidden; /* 图片缩放时溢出不可见 */
}
.case-item img{
height:100%;
object-fit: cover; /* 自动等比例的缩放 */
}
/* 服务流程 */
.service{
padding-top:131px;
}
.services{
display:grid;
grid-template-columns: repeat(3,1fr);
grid-template-rows: 1fr 1fr;
column-gap: 38px;
row-gap: 34px;
}
.service-item{ /* 用栅格布局 */
display:grid;
grid-template-areas:
"icon title"
"icon content";
grid-template-columns: 70px 1fr;
grid-template-rows: 1fr 3fr;
padding:24px;
box-shadow: 0px 0px 18px rgba(0,0,0,0.06);
}
.service-item i.fas{
grid-area:icon;
font-size:42px;
color:var(--primary-color);
padding-top: 6px;
}
.service-item .service-title{
grid-area: title;
color:var(--text-color-darker);
font-size: 24px;
}
.service-item .service-content{
grid-area: content;
color: var(--text-color-gray);
line-height:30px;
font-size: 16px;
margin-top: 8px;
}
/* 团队介绍*/
.team-intro{
margin-top:48px;
padding-top:62px;
padding-bottom:52px;
}
.team-members{
display: grid;
grid-template-columns: repeat(4,1fr);
column-gap:24px;
margin-top:86px;
}
.team-member{
background-color: white;
box-shadow: 0px 0px 24px rgba(0,0,0,0.2);
text-align: center;
padding-bottom: 28px;
transition: 0.4s;
display:grid;
justify-content: center;
}
.profile-image{
overflow: hidden;
}
.profile-image img{
width:100%;
height:264px;
object-fit:cover;
object-position:top center;
}
.team-member .name{
margin-top: 18px;
font-size: 18px;
font-weight: 500;
color:var(--text-color-dark);
}
.team-member .position{
color:var(--text-color-dark-gray);
margin-top:12px;
margin-bottom: 18px;
}
.social-links{
width:100%;
max-width: 200px;
display:flex;
justify-content: space-between;
padding:0 42px;
margin:0 auto; /* 这里是自己加的,为了使容器水平居中 */
}
.social-links li{
list-style: none;
}
.social-links li a{
color:var(--text-color-dark);
text-decoration: none;
}
.team-member:hover{ /* 鼠标悬停在上面的样式 */
transform:translateY(-20px) scale(1.05);
box-shadow:0px 0px 36px rgba(0,0,0,0.1);
}
/* 数据部分 */
.data-section{
max-width:unset; /* 默认和初始化,因为全屏的宽度 */
width:100vw;
height: 255px;
background-image: url(images/adult-business-computer-contemporary-380769.jpg);
background-size: cover; /* 类似于object-fit等比例的缩放 */
background-position: center; /* 显示中心区域 */
display: grid;
grid-template-columns: repeat(4,minmax(auto,220px)); /* 最小自动,最大到220像素 */
justify-content: center;
align-items: center;
position: relative;
z-index:20;
}
.data-section::before{ /* 背景遮罩层 */
content: "";
display: block;
position: absolute;
background-color: var(--backdrop-color);
width:100%;
height: 100%;
z-index:1;
}
.data-piece{
width:250px;
display: grid;
grid-template-rows: repeat(3,1fr); /* 三行 */
justify-items: center;
color:white;
position:relative;
z-index:40;
}
.data-piece i.fas{ /* 图标大小 */
font-size: 44px;
}
.data-piece .num{ /* 数字 */
margin-top: 7px;
font-size: 41px;
font-weight: 600;
}
.data-piece .data-desc{ /* 单位 */
font-size: 18px;
font-weight: 500;
}
/* 公司动态 */
.company-activities{
margin-top: 88px;
}
.activities{
display: grid;
grid-template-columns: repeat(3,1fr);
column-gap: 24px;
}
.activity{
box-shadow: 0px 0px 24px rgba(0,0,0,0.1); /* 向下移24像素的阴影 */
padding:24px;
transition:0.4s;
}
.act-image-wrapper{ /* 图片容器 */
height:255px;
overflow: hidden; /* 溢出隐藏 */
margin:-24px;
margin-bottom: 0;
}
.act-image-wrapper img{
min-height: 300px;
object-fit: cover; /* 图片缩放撑满 */
}
.activity .meta{
margin-top: 20px;
margin-bottom: 12px;
color:var(--text-color-light-gray);
font-size:12px;
display: flex;
}
.activity .meta>p:last-child{
margin-left: 36px;
}
.act-title{
color:var(--text-color-dark);
font-size: 18px;
margin-bottom:16px;
}
.activity article{
color:var(--text-color-gray);
letter-spacing: 0.54px; /* 字间距 */
line-height:24px;
}
.readmore-btn{ /* 阅读更多按钮 */
border:0;
color:white;
background-color: var(--primary-color);
border-radius: 4px;
padding:6px 14px;
margin-top: 24px;
}
.activity:hover{ /* 鼠标移到上面的动画效果 */
transform: translateY(-20px) scale(1.05);
box-shadow: 0px 0px 36px rgba(0,0,0,0.1); /* 阴影左右扩散 */
}
/* 底部信息 */
footer{
margin-top:124px;
background-color: #181818;
display: grid;
justify-items: center; /* 每列居中显示 */
padding-top:72px;
padding-bottom: 24px;
}
.footer-menus{ /* 底部菜单项 */
width:100%;
max-width:1180px;
display:grid;
grid-template-columns: 2fr repeat(4,1fr); /* 2:1:1:1:1 */
padding:0 80px;
position:relative;
}
.menu-title{ /* 底部一级标题 */
font-size: 16px;
color:white;
font-weight: 500;
margin-bottom: 20px;
}
.contact-us{ /* 联系我们 */
justify-content: start ;
color: var(--text-color-lightest);
}
.contact-us p:not(:first-child){ /* 不是第一个元素 */
padding-bottom:16px;
}
.menu-items li{ /* 导航菜单的样式 */
list-style: none;
padding-bottom:8px;
}
.menu-items li a{
text-decoration: none;
font-weight: 300;
color:var(--text-color-lightest);
}
.icp-info{ /* 备案号 */
margin-top: 24px;
margin-bottom: 16px;
}
.icp-info,.rights{ /* 备案号和版权 */
grid-column: 1/-1;
justify-self:center;
color:white;
}
.scrollToTop{ /* 返回顶部 */
display: none; /* 先设为不可见 */
position:relative;
z-index: 1000; /* 使返回顶部按钮永远位于最顶层 */
}
.scrollToTop a{ /* 返回顶部按钮 */
width:32px;
height: 32px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--primary-color);
color:white;
text-decoration: none;
position: fixed;
bottom:60px;
right:30px;
}
@media (max-width:1100px) { /* 小于1100像素导航菜单折叠 */
header nav{
display:none;
}
header{
grid-template-columns: 1fr 1fr;
}
header .burger{
display: block;
width:20px;
height:6px;
position: relative;
justify-self: end;
cursor: pointer;
}
.burger-line1, /* 三条线样式 */
.burger-line2,
.burger-line3{
width:20px;
height:2px;
background-color: var(--text-color-lightest);
}
.burger-line1{
position:absolute;
top:-6px;
}
.burger-line3{
position: absolute;
top:6px;
}
header.open nav{
display: grid;
position:absolute;
left:0;
top:0;
width:100vw;
height:100vh;
background-color: white;
grid-auto-rows: max-content;/* 最大取内容区的宽度 */
justify-items: end;
padding:0 40px;
opacity: 0;
animation: slideDown 0.6s ease-out forwards;
}
header.open nav>*{
color:var(--text-color-darker);
animation: showMenu 0.5s linear forwards 0.4s;
font-size: 18px;
margin:4px 0;
opacity: 0;
}
header.open nav>i.fas{ /* 放大镜距离调整 */
margin-top: 10px;
}
header.open .burger-line1,
header.open .burger-line2,
header.open .burger-line3,
header.sticky .burger-line1,
header.sticky .burger-line2,
header.sticky .burger-line3{
background-color: var(--text-color-darker);
transition: 0.4s ease;
}
header.open .burger-line1{
transform:rotate(45deg) translate(3px,5px);
}
header.open .burger-line2{
transform: translateX(5px);
opacity:0;
}
header.open .burger-line3{
transform:rotate(-45deg) translate(3px,-5px);
}
header.open .logo{
z-index:40;
color:var(--text-color-darker);
}
@keyframes slideDown{ /* 下滑动画 */
from{
height:0;
opacity: 0;
}
to{
height: 100vh;
padding-top: 80px;
opacity: 1;
}
}
@keyframes showMenu{ /* 菜单项下滑动画 */
from{
opacity: 0;
transform: translateY(-1vh);
}
to{
opacity: 1;
transform: translateY(0);
}
}
.service-item,
.service-title{
font-size: 20px;
}
.service-item .service-content{
font-size:14px;
line-height: 24px;
}
.team-members{
grid-template-columns: repeat(2,1fr);
row-gap:36px;
column-gap: 6vw;
}
.activities{
grid-template-columns: repeat(2,1fr);
row-gap:36px;
}
}
@media (max-width:992px) {
.slide-caption h1{
font-size: 48px;
}
.slide-caption h3{
font-size: 18px;
}
.features,
.services{
grid-template-columns: repeat(2,1fr);
grid-template-rows: unset;
}
.data-section{
grid-template-columns: repeat(2,minmax(200px,auto));
padding:24px 0;
height:auto;
row-gap: 24px;
background-size: 200%;
}
.showcases .case-item{
width:calc(100vw/3);
}
.footer-menu{
padding:0 40px;
}
.footer-menus{
grid-template-columns: 2fr repeat(2,1fr);
row-gap:24px;
}
.contact-us{
grid-row: 1 / 3;
}
.footer-menu{
text-align: center;
}
}
@media (max-width:820px) {
.footer-menus{
grid-template-columns: repeat(2,1fr);
row-gap:24px;
}
.contact-us{
grid-row: 1 / 5;
}
}
@media (max-width:768px) {
section{
padding:0 40px;
}
.activities{
grid-template-columns: 1fr;
row-gap:36px;
}
.data-section{
grid-template-columns: 1fr;
background-size: 300%;
}
.team-members{
grid-template-columns: minmax(200px,400px);
}
.features,
.services{
grid-template-columns: 1fr;
}
.showcases .case-item{
width:calc(100vw/2);
height:30vw;
}
}
@media (max-width:576px) {
.slide-caption h1{
font-size: 28px;
}
.slide-caption h3{
font-size: 14px;
}
.explore-btn{
font-size:14px;
padding:8px 18px;
}
.showcases .case-item{
width:100vw;
height:60vw;
}
.footer-menus{
grid-template-columns:1fr;
row-gap:24px;
}
.footer-menu{
justify-self: start;
text-align: left;
}
}