File tree 2 files changed +53
-10
lines changed
2 files changed +53
-10
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <header class =" header" >
3
- <Logo />
4
- <Nav />
5
- </header >
2
+ <fixed-header :threshold =" 100" >
3
+ <header class =" header" >
4
+ <div class =" header__content" >
5
+ <Logo />
6
+ <Nav />
7
+ </div >
8
+ </header >
9
+ </fixed-header >
6
10
</template >
7
11
8
12
<script >
9
13
import Logo from ' @/components/layout/Header/Logo'
10
14
import Nav from ' @/components/layout/Header/Nav'
15
+ import FixedHeader from ' vue-fixed-header'
11
16
12
17
export default {
13
18
name: ' Header' ,
14
19
components: {
15
20
Logo,
16
- Nav
21
+ Nav,
22
+ FixedHeader
17
23
}
18
24
}
19
25
</script >
20
26
21
27
<style lang="scss" scoped>
22
28
.header {
23
- display : flex ;
24
- justify-content : space-between ;
25
- align-items : center ;
26
- padding : 40px 0 ;
29
+ padding : 60px 0 ;
30
+ overflow : hidden ;
31
+ & .vue-fixed-header--isFixed {
32
+ position : fixed ;
33
+ left : 0 ;
34
+ top : 0 ;
35
+ width : 100% ;
36
+ background : $black ;
37
+ z-index : 100 ;
38
+ padding : 20px 0 ;
39
+ .header__content {
40
+ padding-right : 48px ;
41
+ padding-left : 48px ;
42
+ max-width : 960px ;
43
+ width : calc (100% - 96px );
44
+ @include sm {
45
+ padding : 0px 24px ;
46
+ }
47
+ @include xs {
48
+ width : calc (100% - 48px );
49
+ }
50
+ }
51
+ }
27
52
@include sm {
28
- padding : 16px 0 ;
53
+ padding : 32px 0 ;
54
+ }
55
+ & __content {
56
+ padding-top : 0px ;
57
+ padding-bottom : 0px ;
58
+ display : flex ;
59
+ justify-content : space-between ;
60
+ align-items : center ;
61
+ margin : 0 auto ;
29
62
}
30
63
}
31
64
</style >
Original file line number Diff line number Diff line change @@ -126,4 +126,14 @@ export default {
126
126
}
127
127
}
128
128
}
129
+ .index__header + .index__center-wrapper {
130
+ padding-top : 330px ;
131
+ @include sm {
132
+ padding-top : 110px ;
133
+ }
134
+ }
135
+ .index__header :not (.vue-fixed-header--isFixed )
136
+ + .index__center-wrapper {
137
+ padding-top : 0 ;
138
+ }
129
139
</style >
You can’t perform that action at this time.
0 commit comments