张卓
2022-09-20 5aead44ba1be31db948dfd8362c2bfcbedbbce29
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
@{alain-default-prefix} {
  &__header {
    display: flex;
    align-items: center;
    padding: 0 @alain-default-header-padding;
    width: 100%;
    height: @alain-default-header-hg;
    background-color: @alain-default-header-bg;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
    z-index: @alain-default-zindex + 10;
    &-logo {
      margin-left: -@alain-default-header-padding;
      width: @alain-default-aside-wd;
      transition: width 0.2s @alain-default-ease;
      &-link {
        display: block;
        text-align: center;
      }
      &-expanded,
      &-collapsed {
        vertical-align: middle;
        max-width: 100%;
        animation: fadeIn 1s;
      }
      &-collapsed {
        display: none;
      }
      &-expanded {
        display: inline;
      }
    }
  }
  &__nav {
    &-wrap {
      flex: 1;
      display: flex;
      justify-content: space-between;
    }
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    > li {
      display: inline-block;
      vertical-align: middle;
    }
    &-item,
    nz-badge {
      color: #fff;
    }
    &-item {
      display: block;
      border-radius: 2px;
      text-align: center;
      line-height: 100%;
      padding: 8px 2px;
      min-width: 50px;
      transition: background-color 300ms;
      cursor: pointer;
      outline: none;
      &:hover {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.2) !important;
      }
      i {
        font-size: 18px;
        line-height: 100%;
      }
    }
  }
}
 
// Search
.header-search-mixin(@enabled) when(@enabled =true) {
  @{alain-default-prefix}__search {
    flex: 1;
    margin: 0 @layout-gutter * 3;
    position: relative;
    display: flex;
    align-items: center;
    .ant-input {
      &:focus {
        box-shadow: none;
      }
    }
    .ant-input,
    .ant-input-group-addon {
      background-color: rgba(255, 255, 255, 0.2);
      color: #fff;
      border: none;
      &::-webkit-input-placeholder {
        color: #fff;
        opacity: 1;
      }
    }
    .ant-input-group-addon {
      i {
        transition: color 300ms, transform 400ms;
        font-size: 18px;
        color: #fff;
      }
    }
    &-focus {
      .ant-input,
      .ant-input-group-addon {
        background-color: #f3f3f3;
        color: @grey-8;
        &::placeholder {
          color: @grey-8;
          opacity: 1;
        }
      }
      .ant-input-group-addon {
        i {
          transform: rotate(180deg);
          color: @grey-8;
          &:before {
            content: '\E61B';
          }
        }
      }
    }
  }
 
  @media (min-width: @mobile-min) {
    @{alain-default-prefix}__nav @{alain-default-prefix}__search-btn {
      display: none;
    }
  }
 
  @media (max-width: @mobile-max) {
    @{alain-default-prefix}__search {
      align-items: center;
      transition: transform 300ms;
      padding: 0 @alain-default-header-padding;
      margin: 0;
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      width: 100%;
      background-color: #fff;
      z-index: @zindex+20;
      &-toggled {
        display: flex;
      }
      &:not(&-toggled) {
        transform: translate3d(0, -105%, 0);
      }
    }
  }
}
 
.header-search-mixin(@alain-default-header-search-enabled);
 
 
// Collapsed
@{alain-default-prefix}__collapsed {
  @{alain-default-prefix}__header {
    &-logo {
      width: @alain-default-aside-collapsed-wd;
      &-collapsed {
        display: inline;
      }
      &-expanded {
        display: none;
      }
    }
  }
}
 
// Desktop
// @media (min-width: @mobile-min) {}
// Under pad
@media (max-width: @mobile-max) {
  @{alain-default-prefix}__header {
    &-logo {
      width: @alain-default-aside-collapsed-wd;
      &-collapsed {
        display: inline;
      }
      &-expanded {
        display: none;
      }
    }
  }
}