reprogl

Форк
0
216 строк · 6.6 Кб
1
/*
2
    Based on great Codrops article
3
    http://tympanus.net/Development/OffCanvasMenuEffects/sideslide.html
4
    with changes..
5
*/
6
// in _settings.scss there are all variables used here
7
@import "settings";
8

9
.menu-container,
10
.content-wrap {
11
    overflow: hidden;
12
    width: 100%;
13
    height: 100%;
14
}
15

16
.menu-container {
17
    .menu-wrap {
18
        position: fixed;
19
        top: 0;
20
        right: 0;
21
        z-index: 1001;
22
        width: rem-calc(300);
23
        height: 100%;
24
        background: $color-main-dark;
25
        padding: 2.5em 1.5em 0;
26
        font-size: 1.15em;
27
        -webkit-transform: translate3d(100%, 0, 0);
28
        -ms-transform: translate(100%, 0);
29
        transform: translate3d(100%, 0, 0);
30
        -webkit-transition: -webkit-transform 0.4s;
31
        -ms-transition: -ms-transform 0.4s;
32
        transition: transform 0.4s;
33
        -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
34
        -ms-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
35
        transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
36
        a {
37
            color: $color-main-light;
38
        }
39
        a:hover, a:focus {
40
            color: darken($color-main-light, 20%);
41
        }
42
        .close-button {
43
            width: 1em;
44
            height: 1em;
45
            position: absolute;
46
            right: rem-calc(15);
47
            top: rem-calc(25);
48
            overflow: hidden;
49
            text-indent: 1em;
50
            font-size: 0.75em;
51
            border: none;
52
            background: transparent;
53
            color: transparent;
54
            outline: none;
55
            &::before,
56
            &::after {
57
                content: '';
58
                position: absolute;
59
                width: 3px;
60
                height: 100%;
61
                top: 0;
62
                left: 50%;
63
                background: $color-main-light;
64
            }
65
            &::before {
66
                -webkit-transform: rotate(45deg);
67
                -ms-transform: rotate(45deg);
68
                transform: rotate(45deg);
69
            }
70
            &::after {
71
                -webkit-transform: rotate(-45deg);
72
                -ms-transform: rotate(-45deg);
73
                transform: rotate(-45deg);
74
            }
75
        }
76
    }
77
}
78

79
.menu {
80
    margin-top: 30%;
81
}
82

83
.menu,
84
.icon-list {
85
    height: 100%;
86
}
87
.icon-list {
88
    -webkit-transform: translate3d(0, 100%, 0);
89
    -ms-transform: translate(0, 100%);
90
    transform: translate3d(0, 100%, 0);
91
    -webkit-transition: -webkit-transform 0s 0.4s;
92
    -ms-transition: -webkit-transform 0s 0.4s;
93
    transition: transform 0s 0.4s;
94
    -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
95
    transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
96
    a {
97
        display: block;
98
        padding: 0.8em;
99
        -webkit-transform: translate3d(0, rem-calc(500), 0);
100
        -ms-transform: translate(0, rem-calc(500));
101
        transform: translate3d(0, rem-calc(500), 0);
102
        -webkit-transition: -webkit-transform 0s 0.4s;
103
        -ms-transition: -ms-transform 0s 0.4s;
104
        transition: transform 0s 0.4s;
105
        -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
106
        transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
107
        &:nth-child(2) {
108
            -webkit-transform: translate3d(0, rem-calc(1000), 0);
109
            -ms-transform: translate(0, rem-calc(1000));
110
            transform: translate3d(0, rem-calc(1000), 0);
111
        }
112
        &:nth-child(3) {
113
            -webkit-transform: translate3d(0, rem-calc(1500), 0);
114
            -ms-transform: translate(0, rem-calc(1500));
115
            transform: translate3d(0, rem-calc(2000), 0);
116
        }
117
        &:nth-child(4) {
118
            -webkit-transform: translate3d(0, rem-calc(2000), 0);
119
            -ms-transform: translate(0, rem-calc(2000));
120
            transform: translate3d(0, rem-calc(3000), 0);
121
        }
122
        &:nth-child(5) {
123
            -webkit-transform: translate3d(0, rem-calc(2500), 0);
124
            -ms-transform: translate(0, rem-calc(2500));
125
            transform: translate3d(0, rem-calc(4000), 0);
126
        }
127
        &:nth-child(6) {
128
            -webkit-transform: translate3d(0, rem-calc(3000), 0);
129
            -ms-transform: translate(0, rem-calc(3000));
130
            transform: translate3d(0, rem-calc(5000), 0);
131
        }
132
        span {
133
            margin-left: rem-calc(10);
134
            font-weight: 700;
135
        }
136
        &:hover, &:active, &:focus {
137
            text-decoration: none;
138
        }
139
    }
140
    hr {
141
        -webkit-transform: translate3d(0, rem-calc(2000), 0);
142
        -ms-transform: translate(0, rem-calc(2000));
143
        transform: translate3d(0, rem-calc(3000), 0);
144
        -webkit-transition: -webkit-transform 0s 0.4s;
145
        -ms-transition: -ms-transform 0s 0.4s;
146
        transition: transform 0s 0.4s;
147
        -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
148
        transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
149
    }
150
}
151

152
.show-menu {
153
    .menu-wrap {
154
        -webkit-transform: translate3d(0, 0, 0);
155
        -ms-transform: translate(0, 0);
156
        transform: translate3d(0, 0, 0);
157
        -webkit-transition: -webkit-transform 0.8s;
158
        -ms-transition: -ms-transform 0.8s;
159
        transition: transform 0.8s;
160
        -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
161
        transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
162
    }
163
    .icon-list,
164
    .icon-list a,
165
    .icon-list hr {
166
        -webkit-transform: translate3d(0, 0, 0);
167
        -ms-transform: translate(0, 0);
168
        transform: translate3d(0, 0, 0);
169
        -webkit-transition: -webkit-transform 0.8s;
170
        -ms-transition: -ms-transform 0.8s;
171
        transition: transform 0.8s;
172
        -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
173
        transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
174
    }
175
    .icon-list a,
176
    .icon-list hr {
177
        -webkit-transition-duration: 0.9s;
178
        transition-duration: 0.9s;
179
    }
180
}
181

182
.menu-overlay {
183
    width: 100%;
184
    height: 100%;
185
    position: fixed;
186
    top: 0;
187
    left: 0;
188
    z-index: 999;
189
    display: none;
190
    background-color: transparent;
191
    &.visible {
192
        display: block;
193
    }
194
}
195

196
// menu hacks for old android buggy behaviour
197
html[data-useragent*='Android 4.0'],
198
html[data-useragent*='Android 4.1'],
199
html[data-useragent*='Android 4.2'] {
200
    .menu-container {
201
        .menu-wrap {
202
            right: rem-calc(-320) !important;
203
            -webkit-transform: none !important;
204
            transform: none !important;
205
        }
206
    }
207
    .show-menu {
208
        .menu-wrap {
209
            right: 0 !important;
210
        }
211
    }
212
    .icon-list {
213
        -webkit-transform: none !important;
214
        transform: none !important;
215
    }
216
}
217

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.