-
Notifications
You must be signed in to change notification settings - Fork 0
/
trillo.txt
145 lines (126 loc) · 3.13 KB
/
trillo.txt
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
-- fill property is used for color the svg
<svg class="side-nav__icon">
<use xlink:href="img/sprite.svg#icon-home"></use>
</svg>
-- by include sprite.svg we only use one http request
--in fill we can directly give current color --- fill:currentColor
transition-origin by this we can give place to start to transistion (botoom,center,top)
--cubic-bezier is used to adjust transition timming
--z index is only work if we specified the position
-----------------------------------------------------------------------------------------------------------
pseudo element for side nav
&__item::before {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 3px;
background-color: var(--color-primary);
transform: scaleY(0);
transition: transform 0.2s, width 0.4s cubic-bezier(1, 0, 0, 1) 0.2s,
background-color 0.1s;
}
-- a small line shown before hover
---------------------------------------
.side-nav {
font-size: 1.4rem;
list-style: none;
margin-top: 3.5rem;
&__item {
position: relative;
&:not(:last-child) {
margin-bottom: 0.5rem;
}
}
&__item::before {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 3px;
background-color: var(--color-primary);
transform: scaleY(0);
transition: transform 0.2s //tranform happen in .2s, width 0.4s// //width happen in .4s// cubic-bezier(1, 0, 0, 1) 0.2s,
background-color 0.1s;
}
&__item:hover::before,
&__item--active::before {
transform: scaleY(1); //take all the space in y direction
width: 100%;
}
&__item--active::before {
background-color: var(--color-primary-light);
}
&__link:link,
&__link:visited {
color: var(--color-grey-light-1);
text-decoration: none;
text-transform: uppercase;
display: block;
padding: 1.5rem 3rem;
position: relative;
z-index: 10;
display: flex;
align-items: center;
}
&__icon {
width: 1.7rem;
height: 1.7rem;
margin-right: 2rem;
// fill: var(--color-grey-light-1);
fill: currentColor;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
.btn {
font-size: 1.5rem;
font-weight: 300;
text-transform: uppercase;
border-radius: 100px;
border: none;
background-image: linear-gradient(
to right,
var(--color-primary-light),
var(--color-primary-dark)
);
color: #fff;
position: relative;
overflow: hidden;
& > * {
display: inline-block;
transition: all 0.2s;
height: 100%;
width: 100%;
cursor: pointer;
}
&__visible {
padding: 2rem 7.5rem;
}
&__invisible {
position: absolute;
padding: 2rem 0rem;
left: 0;
top: -100%;
}
&:hover {
background-image: linear-gradient(
to left,
var(--color-primary-light),
var(--color-primary-dark)
);
}
&:hover &__visible {
transform: translateY(100%);
}
&:hover &__invisible {
top: 0;
}
&:focus {
outline: none;
animation: pulsate 1s infinite;
}
}
////////////////////
--in css media query we cannot set css varible so define sass variable var>>$