-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathoffside.css
executable file
·110 lines (93 loc) · 2.95 KB
/
offside.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
/* @@name @@version @@date
* @@description
* @@repository.url
*
* by Andrea Carraro
* Available under the MIT license
*/
/* Off-canvas element CSS */
.offside {
position: fixed; /* Does not play well with some old browsers (see: README) */
width: 200px;
height: 100%;
top: 0;
z-index: 9999;
overflow: auto;
-webkit-overflow-scrolling: touch; /* enables momentum scrolling in iOS overflow elements */
}
/* Left off-canvas elements default status: out of the page */
.offside,
.offside--left {
left: -200px;
}
/* Right off-canvas elements default status: out of the page */
.offside--right {
left: auto;
right: -200px;
}
/*
* Left off-canvas element is open:
* - off-canvas element slides in
* - container elements slides out
*/
.offside--left.is-open,
.offside-js--is-left .offside-sliding-element {
-webkit-transform: translate3d(200px, 0, 0);
-moz-transform: translate3d(200px, 0, 0);
-ms-transform: translate3d(200px, 0, 0);
-o-transform: translate3d(200px, 0, 0);
transform: translate3d(200px, 0, 0);
}
/*
* Right off-canvas element is open:
* - off-canvas element slides in
* - container elements slides out
*/
.offside--right.is-open,
.offside-js--is-right .offside-sliding-element {
-webkit-transform: translate3d(-200px, 0, 0);
-moz-transform: translate3d(-200px, 0, 0);
-ms-transform: translate3d(-200px, 0, 0);
-o-transform: translate3d(-200px, 0, 0);
transform: translate3d(-200px, 0, 0);
}
/* Elements Transitions */
.offside-js--interact .offside,
.offside-js--interact .offside-sliding-element {
-webkit-transition: -webkit-transform .2s cubic-bezier(.16, .68, .43, .99);
-moz-transition: -moz-transform .2s cubic-bezier(.16, .68, .43, .99);
-o-transition: -o-transform .2s cubic-bezier(.16, .68, .43, .99);
transition: transform .2s cubic-bezier(.16, .68, .43, .99);
/* improves performance issues on mobile*/
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
}
/* Body overflow */
.offside-js--init {
overflow-x: hidden;
}
/* Fallback movements for browser not supporting CSS 3d Transitions
----------------------------------------------- */
/* Modernizr false negative csstransforms3d fix, reset CSS 3d Transitions */
.no-csstransforms3d .offside {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.no-csstransforms3d .offside-sliding-element {
overflow-x: hidden;
position: relative;
}
/* Element is open: off-canvas element slides in */
.no-csstransforms3d .offside--left.is-open {
left: 0;
}
.no-csstransforms3d .offside--right.is-open {
right: 0;
}
/* Element is open: container elements slide out */
.no-csstransforms3d > .offside-js--is-left .offside-sliding-element {
right: -200px;
}
.no-csstransforms3d > .offside-js--is-right .offside-sliding-element {
left: -200px;
}