woo 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/woo/application.js +44 -12
- data/app/assets/stylesheets/woo/application.css.scss +2 -0
- data/app/assets/stylesheets/woo/partials/_block.scss +70 -0
- data/app/assets/stylesheets/woo/partials/_main.scss +5 -199
- data/app/assets/stylesheets/woo/partials/_navigation.scss +152 -0
- data/app/views/woo/shared/_navigation.html.haml +1 -0
- data/lib/woo/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67652f3d93ec5c4f36788f53de70444e063b79a0
|
4
|
+
data.tar.gz: 8d71a6594c1bcb7a6d101e4e24472e27f2d1e4cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8df13a7473ad8014e0051a0291c341e457044528a779f2304a8d55e47101d79cd8a1015258c0d58dc020e96f057f585d927db04bc8ddc3f3a4742681981b96d5
|
7
|
+
data.tar.gz: 5e6a5bcd50d221ccc331a15d87e91c295757dcc99f284c69336f558553eaf301e85b08169f87e2ecd87c012a1c83e0b722a5b9ddc014e5aef976daa9e670ab16
|
@@ -18485,29 +18485,53 @@ window.hljs = hljs = require('highlight.js');
|
|
18485
18485
|
Woo = (function() {
|
18486
18486
|
Woo.prototype.menuPreviewTolerance = 150;
|
18487
18487
|
|
18488
|
+
Woo.prototype.menuOpenTolerance = 10;
|
18489
|
+
|
18490
|
+
Woo.prototype.previousMousePosition = {};
|
18491
|
+
|
18488
18492
|
function Woo() {
|
18489
18493
|
this.closeMenuEventually = __bind(this.closeMenuEventually, this);
|
18494
|
+
this.maybePreview = __bind(this.maybePreview, this);
|
18495
|
+
this.maybeOpen = __bind(this.maybeOpen, this);
|
18490
18496
|
this.openMenu = __bind(this.openMenu, this);
|
18491
18497
|
hljs.initHighlighting();
|
18492
18498
|
this.setupEvents();
|
18493
18499
|
this.bindWidthPickers();
|
18494
18500
|
this.activateCodeShowing();
|
18495
18501
|
this.executeColorTransmogrification();
|
18502
|
+
this._maybeOpen = _.debounce(this.maybeOpen, 10, true);
|
18503
|
+
this._maybePreview = _.debounce(this.maybePreview, 10, true);
|
18496
18504
|
}
|
18497
18505
|
|
18498
18506
|
Woo.prototype.openMenu = function() {
|
18499
18507
|
$('body').addClass('open');
|
18508
|
+
$('body nav .menu').addClass('close');
|
18500
18509
|
if (this.delayedClose) {
|
18501
18510
|
return clearTimeout(this.delayedClose);
|
18502
18511
|
}
|
18503
18512
|
};
|
18504
18513
|
|
18514
|
+
Woo.prototype.maybeOpen = function(mousePosition) {
|
18515
|
+
if (mousePosition.x < this.previousMousePosition.x && mousePosition.x <= this.menuOpenTolerance) {
|
18516
|
+
return this.openMenu();
|
18517
|
+
}
|
18518
|
+
};
|
18519
|
+
|
18520
|
+
Woo.prototype.maybePreview = function(mousePosition) {
|
18521
|
+
if (mousePosition.x < this.previousMousePosition.x && mousePosition.x <= this.menuPreviewTolerance) {
|
18522
|
+
return $('body nav').addClass('near-menu');
|
18523
|
+
} else if (mousePosition.x >= this.menuPreviewTolerance) {
|
18524
|
+
return $('body nav').removeClass('near-menu');
|
18525
|
+
}
|
18526
|
+
};
|
18527
|
+
|
18505
18528
|
Woo.prototype.closeMenuEventually = function() {
|
18506
18529
|
return this.delayedClose = _.delay(this.closeMenu, 300);
|
18507
18530
|
};
|
18508
18531
|
|
18509
|
-
Woo.prototype.closeMenu = function() {
|
18510
|
-
|
18532
|
+
Woo.prototype.closeMenu = function(e) {
|
18533
|
+
$('body').removeClass('open');
|
18534
|
+
return $('body nav .menu').removeClass('close');
|
18511
18535
|
};
|
18512
18536
|
|
18513
18537
|
Woo.prototype.bindWidthPickers = function() {
|
@@ -18533,20 +18557,28 @@ Woo = (function() {
|
|
18533
18557
|
};
|
18534
18558
|
|
18535
18559
|
Woo.prototype.setupEvents = function() {
|
18536
|
-
|
18537
|
-
|
18538
|
-
$(
|
18539
|
-
$('
|
18560
|
+
var notSelectors;
|
18561
|
+
notSelectors = 'nav, .menu, .nav-item, .nav-item-title, .nav-item-icon';
|
18562
|
+
$("body #woo-styleguide :not(" + notSelectors + ")").on('click', this.closeMenu);
|
18563
|
+
$('body nav').on('click', '.menu', this.openMenu);
|
18564
|
+
$('body nav').on('click', '.close', this.closeMenu);
|
18565
|
+
$('body').on('mouseleave', (function(_this) {
|
18566
|
+
return function() {
|
18567
|
+
return _this.previousMousePosition.x = 0;
|
18568
|
+
};
|
18569
|
+
})(this));
|
18540
18570
|
$('body').on('mousemove', (function(_this) {
|
18541
18571
|
return function(e) {
|
18542
|
-
|
18543
|
-
|
18544
|
-
|
18545
|
-
|
18546
|
-
|
18572
|
+
var mousePosition;
|
18573
|
+
mousePosition = {
|
18574
|
+
x: e.pageX
|
18575
|
+
};
|
18576
|
+
_this._maybeOpen(mousePosition);
|
18577
|
+
_this._maybePreview(mousePosition);
|
18578
|
+
return _this.previousMousePosition = mousePosition;
|
18547
18579
|
};
|
18548
18580
|
})(this));
|
18549
|
-
return $('nav .nav-item .nav-item-title
|
18581
|
+
return $('nav .nav-item').on('click', '.nav-item-title, .nav-item-icon', this.openNavItem);
|
18550
18582
|
};
|
18551
18583
|
|
18552
18584
|
Woo.prototype.openNavItem = function(e) {
|
@@ -0,0 +1,70 @@
|
|
1
|
+
//
|
2
|
+
// BLOCK
|
3
|
+
// ******************************************************************
|
4
|
+
|
5
|
+
$styleguide-padding: 20px 0;
|
6
|
+
|
7
|
+
#woo-styleguide {
|
8
|
+
|
9
|
+
dl.styleguide {
|
10
|
+
margin: 0;
|
11
|
+
padding: $styleguide-padding;
|
12
|
+
position: relative;
|
13
|
+
|
14
|
+
a[name] {
|
15
|
+
height: 0;
|
16
|
+
padding: 0;
|
17
|
+
margin: 0;
|
18
|
+
}
|
19
|
+
dt.page-title {
|
20
|
+
background-color: rgba($white, .95);
|
21
|
+
color: $black;
|
22
|
+
display: block;
|
23
|
+
font-size: 2em;
|
24
|
+
font-weight: 100;
|
25
|
+
margin: 2em 0 0;
|
26
|
+
padding: 10px 0;
|
27
|
+
text-align: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
dd {
|
31
|
+
margin: 0 auto;
|
32
|
+
padding-top: 4em;
|
33
|
+
padding-bottom: 4em;
|
34
|
+
position: relative;
|
35
|
+
overflow: hidden;
|
36
|
+
|
37
|
+
&.notes {
|
38
|
+
background: $notes-section-background-color;
|
39
|
+
padding-top: 2em;
|
40
|
+
padding-bottom: 2em;
|
41
|
+
.wrapper {
|
42
|
+
background: $notes-background-color;
|
43
|
+
padding: 4em;
|
44
|
+
}
|
45
|
+
.notes-title {
|
46
|
+
box-shadow: 0 1px 0 0 rgba($black, .08);
|
47
|
+
color: rgba($black, .35);
|
48
|
+
font-size: rem-calc(14);
|
49
|
+
font-weight: 100;
|
50
|
+
font-style: italic;
|
51
|
+
padding-bottom: .35em;
|
52
|
+
position: relative;
|
53
|
+
}
|
54
|
+
|
55
|
+
h1, h2, h3, h4, h5, h6, p {
|
56
|
+
color: lighten($black, 15%);
|
57
|
+
font-weight: 200;
|
58
|
+
}
|
59
|
+
|
60
|
+
}
|
61
|
+
&.preview {
|
62
|
+
background: $body-background-color;
|
63
|
+
}
|
64
|
+
&.location-title {
|
65
|
+
padding: 0;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
}
|
@@ -10,7 +10,11 @@ $notes-background-color: $white;
|
|
10
10
|
|
11
11
|
body {
|
12
12
|
&.open #woo-styleguide nav,
|
13
|
-
nav.near-menu {
|
13
|
+
#woo-styleguide nav.near-menu {
|
14
|
+
.preview {
|
15
|
+
width: 5px;
|
16
|
+
}
|
17
|
+
}
|
14
18
|
|
15
19
|
&.open #woo-styleguide {
|
16
20
|
nav {
|
@@ -38,204 +42,6 @@ body {
|
|
38
42
|
box-sizing: border-box;
|
39
43
|
position: relative;
|
40
44
|
|
41
|
-
//
|
42
|
-
// NAVIGATION
|
43
|
-
// ******************************************************************
|
44
|
-
nav {
|
45
|
-
@include transition(all .3s ease);
|
46
|
-
background-color: transparent;
|
47
|
-
border-left: 0px solid $nav-border-color;
|
48
|
-
display: block;
|
49
|
-
font-size: 0.8em;
|
50
|
-
left: 0;
|
51
|
-
bottom: 0;
|
52
|
-
padding: 0;
|
53
|
-
position: fixed;
|
54
|
-
text-align: left;
|
55
|
-
top: 0;
|
56
|
-
width: 10px;
|
57
|
-
z-index: 1000;
|
58
|
-
|
59
|
-
a.menu {
|
60
|
-
@include transition(all .3s ease);
|
61
|
-
@include inline-icon('menu');
|
62
|
-
|
63
|
-
pointer-events: auto;
|
64
|
-
color: $nav-menu-icon-color;
|
65
|
-
display: block;
|
66
|
-
font-size: 1.2em;
|
67
|
-
line-height: 2em;
|
68
|
-
margin-right: 0;
|
69
|
-
text-align: right;
|
70
|
-
z-index: 1000;
|
71
|
-
span { display: none; }
|
72
|
-
|
73
|
-
&:hover { box-shadow: none; }
|
74
|
-
}
|
75
|
-
|
76
|
-
.nav-item {
|
77
|
-
@include transition(all .3s ease .2s);
|
78
|
-
cursor: pointer;
|
79
|
-
position: relative;
|
80
|
-
opacity: 0;
|
81
|
-
|
82
|
-
&.open,
|
83
|
-
&:hover {
|
84
|
-
.nav-item-title { color: $nav-link-hover-color; }
|
85
|
-
.nav-item-icon:after { background: $nav-link-hover-color; }
|
86
|
-
}
|
87
|
-
|
88
|
-
&.open {
|
89
|
-
.nav-item-icon {
|
90
|
-
&:after {
|
91
|
-
@include icon('arrow-down');
|
92
|
-
background: none;
|
93
|
-
color: $nav-link-hover-color;
|
94
|
-
top: 20px;
|
95
|
-
right: 23px;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
ul.nav-item-list { display: block; }
|
99
|
-
}
|
100
|
-
|
101
|
-
.nav-item-title {
|
102
|
-
@include transition(all .3s ease);
|
103
|
-
font-weight: 500;
|
104
|
-
margin-bottom: 1px;
|
105
|
-
text-transform: uppercase;
|
106
|
-
}
|
107
|
-
|
108
|
-
.nav-item-icon {
|
109
|
-
position: absolute;
|
110
|
-
bottom: 0;
|
111
|
-
right: 0;
|
112
|
-
top: 0;
|
113
|
-
width: 40px;
|
114
|
-
&:after {
|
115
|
-
content: '';
|
116
|
-
height: 1px;
|
117
|
-
width: 12px;
|
118
|
-
background: rgba($nav-link-color, .5);
|
119
|
-
top: 26px;
|
120
|
-
position: absolute;
|
121
|
-
right: 22px;
|
122
|
-
line-height: 100%;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
|
127
|
-
a {
|
128
|
-
@include transition(all .3s ease);
|
129
|
-
box-shadow: 0 1px 0 0 transparent;
|
130
|
-
color: $nav-link-color;
|
131
|
-
font-family: $header-font;
|
132
|
-
font-size: 1em;
|
133
|
-
display: block;
|
134
|
-
padding: 20px;
|
135
|
-
&:hover {
|
136
|
-
color: $nav-link-hover-color;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
.nav-item-list {
|
141
|
-
@include transition(all .3s ease);
|
142
|
-
background-color: transparent;
|
143
|
-
display: none;
|
144
|
-
overflow: hidden;
|
145
|
-
padding: 10px 0;
|
146
|
-
margin: 0;
|
147
|
-
|
148
|
-
li {
|
149
|
-
display: block;
|
150
|
-
&:last-child { margin-right: 0; }
|
151
|
-
|
152
|
-
a {
|
153
|
-
font-size: 13px;
|
154
|
-
padding-left: 45px;
|
155
|
-
position: relative;
|
156
|
-
&:before {
|
157
|
-
box-shadow: inset 0 0 0 1px $nav-link-hr-color;
|
158
|
-
border-radius: 1000px;
|
159
|
-
left: 25px;
|
160
|
-
position: absolute;
|
161
|
-
width: 10px;
|
162
|
-
height: 10px;
|
163
|
-
content: '';
|
164
|
-
font-size: 10px;
|
165
|
-
vertical-align: top;
|
166
|
-
margin-top: 4px;
|
167
|
-
}
|
168
|
-
}
|
169
|
-
}
|
170
|
-
}
|
171
|
-
}
|
172
|
-
|
173
|
-
|
174
|
-
//
|
175
|
-
// BLOCK
|
176
|
-
// ******************************************************************
|
177
|
-
|
178
|
-
dl.styleguide {
|
179
|
-
margin: 0;
|
180
|
-
padding: 200px 0;
|
181
|
-
position: relative;
|
182
|
-
|
183
|
-
a[name] {
|
184
|
-
height: 0;
|
185
|
-
padding: 0;
|
186
|
-
margin: 0;
|
187
|
-
}
|
188
|
-
dt.page-title {
|
189
|
-
background-color: rgba($white, .95);
|
190
|
-
color: $black;
|
191
|
-
display: block;
|
192
|
-
font-size: 2em;
|
193
|
-
font-weight: 100;
|
194
|
-
margin: 2em 0 0;
|
195
|
-
padding: 10px 0;
|
196
|
-
text-align: center;
|
197
|
-
}
|
198
|
-
|
199
|
-
dd {
|
200
|
-
margin: 0 auto;
|
201
|
-
padding-top: 4em;
|
202
|
-
padding-bottom: 4em;
|
203
|
-
position: relative;
|
204
|
-
overflow: hidden;
|
205
|
-
|
206
|
-
&.notes {
|
207
|
-
background: $notes-section-background-color;
|
208
|
-
padding-top: 2em;
|
209
|
-
padding-bottom: 2em;
|
210
|
-
.wrapper {
|
211
|
-
background: $notes-background-color;
|
212
|
-
padding: 4em;
|
213
|
-
}
|
214
|
-
.notes-title {
|
215
|
-
box-shadow: 0 1px 0 0 rgba($black, .08);
|
216
|
-
color: rgba($black, .35);
|
217
|
-
font-size: rem-calc(14);
|
218
|
-
font-weight: 100;
|
219
|
-
font-style: italic;
|
220
|
-
padding-bottom: .35em;
|
221
|
-
position: relative;
|
222
|
-
}
|
223
|
-
|
224
|
-
h1, h2, h3, h4, h5, h6, p {
|
225
|
-
color: lighten($black, 15%);
|
226
|
-
font-weight: 200;
|
227
|
-
}
|
228
|
-
|
229
|
-
}
|
230
|
-
&.preview {
|
231
|
-
background: $body-background-color;
|
232
|
-
}
|
233
|
-
&.location-title {
|
234
|
-
padding: 0;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
45
|
.location {
|
240
46
|
background-color: rgba($white, .95);
|
241
47
|
color: rgba($black, .45);
|
@@ -0,0 +1,152 @@
|
|
1
|
+
//
|
2
|
+
// NAVIGATION
|
3
|
+
// ******************************************************************
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
#woo-styleguide {
|
13
|
+
nav {
|
14
|
+
@include transition(all .3s ease);
|
15
|
+
background-color: transparent;
|
16
|
+
display: block;
|
17
|
+
font-size: 0.8em;
|
18
|
+
left: 0;
|
19
|
+
bottom: 0;
|
20
|
+
padding: 0;
|
21
|
+
position: fixed;
|
22
|
+
text-align: left;
|
23
|
+
top: 0;
|
24
|
+
width: 10px;
|
25
|
+
z-index: 1000;
|
26
|
+
|
27
|
+
.preview {
|
28
|
+
@include transition(all .3s ease);
|
29
|
+
background-color: $primary-color;
|
30
|
+
bottom: 0;
|
31
|
+
left: 0;
|
32
|
+
position: fixed;
|
33
|
+
top: 0;
|
34
|
+
width: 0px;
|
35
|
+
z-index: 1000;
|
36
|
+
}
|
37
|
+
|
38
|
+
a.menu {
|
39
|
+
@include transition(all .3s ease);
|
40
|
+
@include inline-icon('menu');
|
41
|
+
cursor: pointer;
|
42
|
+
pointer-events: auto;
|
43
|
+
color: $nav-menu-icon-color;
|
44
|
+
display: block;
|
45
|
+
font-size: 1.2em;
|
46
|
+
line-height: 2em;
|
47
|
+
margin-right: 0;
|
48
|
+
text-align: right;
|
49
|
+
z-index: 1000;
|
50
|
+
span { display: none; }
|
51
|
+
|
52
|
+
&:hover { box-shadow: none; }
|
53
|
+
}
|
54
|
+
|
55
|
+
.nav-item {
|
56
|
+
@include transition(all .3s ease .2s);
|
57
|
+
cursor: pointer;
|
58
|
+
overflow: hidden;
|
59
|
+
position: relative;
|
60
|
+
opacity: 0;
|
61
|
+
|
62
|
+
&.open,
|
63
|
+
&:hover {
|
64
|
+
.nav-item-title { color: $nav-link-hover-color; }
|
65
|
+
.nav-item-icon:after { background: $nav-link-hover-color; }
|
66
|
+
}
|
67
|
+
|
68
|
+
&.open {
|
69
|
+
.nav-item-icon {
|
70
|
+
&:after {
|
71
|
+
@include icon('arrow-down');
|
72
|
+
background: none;
|
73
|
+
color: $nav-link-hover-color;
|
74
|
+
top: 20px;
|
75
|
+
right: 23px;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
ul.nav-item-list { display: block; }
|
79
|
+
}
|
80
|
+
|
81
|
+
.nav-item-title {
|
82
|
+
@include transition(all .3s ease);
|
83
|
+
font-weight: 500;
|
84
|
+
margin-bottom: 1px;
|
85
|
+
text-transform: uppercase;
|
86
|
+
}
|
87
|
+
|
88
|
+
.nav-item-icon {
|
89
|
+
position: absolute;
|
90
|
+
bottom: 0;
|
91
|
+
right: 0;
|
92
|
+
top: 0;
|
93
|
+
width: 40px;
|
94
|
+
&:after {
|
95
|
+
content: '';
|
96
|
+
height: 1px;
|
97
|
+
width: 12px;
|
98
|
+
background: rgba($nav-link-color, .5);
|
99
|
+
top: 26px;
|
100
|
+
position: absolute;
|
101
|
+
right: 22px;
|
102
|
+
line-height: 100%;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
a {
|
108
|
+
@include transition(all .3s ease);
|
109
|
+
box-shadow: 0 1px 0 0 transparent;
|
110
|
+
color: $nav-link-color;
|
111
|
+
font-family: $header-font;
|
112
|
+
font-size: 1em;
|
113
|
+
display: block;
|
114
|
+
padding: 20px;
|
115
|
+
&:hover {
|
116
|
+
color: $nav-link-hover-color;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
.nav-item-list {
|
121
|
+
@include transition(all .3s ease);
|
122
|
+
background-color: transparent;
|
123
|
+
display: none;
|
124
|
+
overflow: hidden;
|
125
|
+
padding: 10px 0;
|
126
|
+
margin: 0;
|
127
|
+
|
128
|
+
li {
|
129
|
+
display: block;
|
130
|
+
&:last-child { margin-right: 0; }
|
131
|
+
|
132
|
+
a {
|
133
|
+
font-size: 13px;
|
134
|
+
padding-left: 45px;
|
135
|
+
position: relative;
|
136
|
+
&:before {
|
137
|
+
box-shadow: inset 0 0 0 1px $nav-link-hr-color;
|
138
|
+
border-radius: 1000px;
|
139
|
+
left: 25px;
|
140
|
+
position: absolute;
|
141
|
+
width: 10px;
|
142
|
+
height: 10px;
|
143
|
+
content: '';
|
144
|
+
font-size: 10px;
|
145
|
+
vertical-align: top;
|
146
|
+
margin-top: 4px;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
}
|
data/lib/woo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Altman
|
@@ -176,7 +176,9 @@ files:
|
|
176
176
|
- app/assets/stylesheets/woo/lib/_icon-factory.scss
|
177
177
|
- app/assets/stylesheets/woo/mixins/_color-block.scss
|
178
178
|
- app/assets/stylesheets/woo/mixins/_hover-border.scss
|
179
|
+
- app/assets/stylesheets/woo/partials/_block.scss
|
179
180
|
- app/assets/stylesheets/woo/partials/_main.scss
|
181
|
+
- app/assets/stylesheets/woo/partials/_navigation.scss
|
180
182
|
- app/controllers/woo/application_controller.rb
|
181
183
|
- app/controllers/woo/styleguide_controller.rb
|
182
184
|
- app/helpers/woo/application_helper.rb
|