-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefaultStyleMixin.js
115 lines (97 loc) · 2.11 KB
/
defaultStyleMixin.js
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
var _ = require('lodash');
module.exports = {
// HELPERS
displayFlex: function() {
return {
display: '-webkit-box',
display: '-webkit-flex',
display: '-ms-flexbox',
display: 'flex',
};
},
flex: function(flex) {
return {
webkitBoxFlex: flex,
webkitFlex: flex,
msFlex: flex,
flex: flex,
};
},
alignItems: function(align) {
return {
webkitBoxAlign: align,
webkitAlignItems: align,
msFlexAlign: align,
alignItems: align,
};
},
justifyContent: function(justify) {
return {
webkitBoxPack: justify,
webkitJustifyContent: justify,
msFlexPack: justify,
justifyContent: justify,
};
},
flexFlow: function(flow) {
return {
webkitFlexFlow: flow,
msFlexFlow: flow,
flexFlow: flow,
};
},
// STYLES
_theatreStyle: function(top) {
return {
left: 0,
fontFamily: 'sans-serif',
top: top || document.body.scrollTop,
position: 'absolute',
zIndex: 1,
height: window.innerHeight,
width: window.innerWidth,
backgroundColor: 'rgba(255, 255, 255, 0.95)',
};
},
_theatreBodyWrapperStyle: function() {
return _.assign({
position: 'absolute',
height: 'calc(100% - 8vw)',
width: 'calc(100% - 8vw)',
margin: '4vw',
zIndex: 2,
}, this.displayFlex(), this.flexFlow('column'));
},
_theatreHeaderStyle: function() {
return _.assign({
marginBottom: '2vh',
}, this.displayFlex());
},
_theatreSelectStyle: function() {
return _.assign({}, this.alignItems('center'), this.justifyContent('center'), this.flex('1 1 auto'));
},
_theatreCloseStyle: function() {
return _.assign({
color: '#ccc',
cursor: 'pointer',
padding: '1vh 2vw',
fontSize: '2em',
}, this.alignItems('center'), this.justifyContent('center'), this.flex('0 0 auto'));
},
_theatreContentStyle: function() {
return _.assign({
height: '100%',
overflowY: 'scroll',
}, this.displayFlex(), this.justifyContent('center'), this.flexFlow('column'));
},
_progressStyle: function(width) {
return {
position: 'absolute',
zIndex: 3,
background: '#4CAF50',
height: '1px',
opacity: 0.9,
width: (width || 0) + '%',
};
},
};