-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.css
130 lines (129 loc) · 2.93 KB
/
search.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
.search {
--background: #ffffff;
--text-color: #414856;
--primary-color: #4F29F0;
--border-radius: 10px;
--width: 190px;
--height: 55px;
background: var(--background);
width: auto;
height: var(--height);
position: relative;
overflow: hidden;
border-radius: var(--border-radius);
box-shadow: 0 10px 30px rgba(65, 72, 86, 0.05);
display: flex;
justify-content: center;
align-items: center;
}
.search input[type=text] {
position: relative;
width: var(--height);
height: var(--height);
font: 400 16px "Varela Round", sans-serif;
color: var(--text-color);
border: 0;
box-sizing: border-box;
outline: none;
padding: 0 0 0 40px;
transition: width 0.6s ease;
z-index: 10;
opacity: 0;
cursor: pointer;
}
.search input[type=text]:focus {
z-index: 0;
opacity: 1;
width: var(--width);
}
.search input[type=text]:focus ~ .symbol::before {
width: 0%;
}
.search input[type=text]:focus ~ .symbol:after {
-webkit-clip-path: inset(0% 0% 0% 100%);
clip-path: inset(0% 0% 0% 100%);
transition: -webkit-clip-path 0.04s linear 0.105s;
transition: clip-path 0.04s linear 0.105s;
transition: clip-path 0.04s linear 0.105s, -webkit-clip-path 0.04s linear 0.105s;
}
.search input[type=text]:focus ~ .symbol .cloud {
top: -30px;
left: -30px;
transform: translate(0, 0);
transition: all 0.6s ease;
}
.search input[type=text]:focus ~ .symbol .lens {
top: 20px;
left: 15px;
transform: translate(0, 0);
fill: var(--primary-color);
transition: top 0.5s ease 0.1s, left 0.5s ease 0.1s, fill 0.3s ease;
}
.search .symbol {
height: 100%;
width: 100%;
position: absolute;
top: 0;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
}
.search .symbol:before {
content: "";
position: absolute;
right: 0;
width: 100%;
height: 100%;
background: var(--primary-color);
z-index: -1;
transition: width 0.6s ease;
}
.search .symbol:after {
content: "";
position: absolute;
top: 21px;
left: 21px;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--primary-color);
z-index: 1;
-webkit-clip-path: inset(0% 0% 0% 0%);
clip-path: inset(0% 0% 0% 0%);
transition: -webkit-clip-path 0.04s linear 0.225s;
transition: clip-path 0.04s linear 0.225s;
transition: clip-path 0.04s linear 0.225s, -webkit-clip-path 0.04s linear 0.225s;
}
.search .symbol .cloud,
.search .symbol .lens {
position: absolute;
fill: #fff;
stroke: none;
top: 50%;
left: 50%;
}
.search .symbol .cloud {
width: 35px;
height: 32px;
transform: translate(-50%, -60%);
transition: all 0.6s ease;
}
.search .symbol .lens {
fill: #fff;
width: 16px;
height: 16px;
z-index: 2;
top: 24px;
left: 24px;
transition: top 0.3s ease, left 0.3s ease, fill 0.2s ease 0.2s;
}
body {
background: #E8EBF3;
height: 100vh;
font: 400 16px "Varela Round", sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}