forever_style_guide 1.2.5 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/forever_style_guide/hero-blur.js +91 -82
  3. data/app/assets/javascripts/forever_style_guide/list-toggle.js +13 -3
  4. data/app/assets/stylesheets/forever_style_guide/modules/_all.scss +2 -0
  5. data/app/assets/stylesheets/forever_style_guide/modules/_button.scss +9 -0
  6. data/app/assets/stylesheets/forever_style_guide/modules/_hero-block.scss +82 -0
  7. data/app/assets/stylesheets/forever_style_guide/modules/_hero-blur.scss +6 -117
  8. data/app/assets/stylesheets/forever_style_guide/modules/_hero-product.scss +25 -0
  9. data/app/assets/stylesheets/forever_style_guide/modules/_list-toggle.scss +65 -51
  10. data/app/assets/stylesheets/forever_style_guide/utils/_color-utils.scss +0 -1
  11. data/app/assets/stylesheets/style_guide/modules/_hero.scss +0 -1
  12. data/app/views/forever_style_guide/demo/hero.html.erb +34 -36
  13. data/app/views/forever_style_guide/sections/components/navigation/_marketing.erb +4 -4
  14. data/app/views/forever_style_guide/sections/components/navigation/_marketing_signed_in.erb +4 -4
  15. data/app/views/forever_style_guide/sections/components/navigation/_signed_in.erb +3 -3
  16. data/app/views/forever_style_guide/sections/visual_elements/_lists.erb +21 -14
  17. data/app/views/layouts/forever_style_guide/application.html.erb +1 -0
  18. data/lib/forever_style_guide/version.rb +1 -1
  19. data/test/dummy/log/development.log +0 -2278
  20. data/test/dummy/tmp/cache/assets/development/sass/dd1921659855a833d5890e93d4cd32dbc61db883/_account-popover.scssc +0 -0
  21. data/test/dummy/tmp/cache/assets/development/sass/dd1921659855a833d5890e93d4cd32dbc61db883/_button.scssc +0 -0
  22. data/test/dummy/tmp/cache/assets/development/sass/dd1921659855a833d5890e93d4cd32dbc61db883/_navbar.scssc +0 -0
  23. data/test/dummy/tmp/cache/assets/development/sass/dd1921659855a833d5890e93d4cd32dbc61db883/_progress.scssc +0 -0
  24. data/test/dummy/tmp/cache/assets/development/sprockets/10a3ce43661397b1fed56c5ca3a6d60b +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/12c0806af25f2b17820ce1f57439a16a +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/14b0aa11ee9e6b4403ddaa9c0d645c3a +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/1e488c008a38171751adf4fcb57920c5 +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/2aed35dce4d1300130b3c88e3ec277dc +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/62c0fcea9dea24a1efb32efc9e2b88d0 +0 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/83c70d9c6c54783bff8af85d23407e45 +0 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/9b9ffa930501c611d937378f17fd517a +0 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/b06f6f5e781a231832862902e1462ec6 +0 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/b32aed92b74b92426cbca5b3122c5555 +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/d47d8ba86041e0f208b6ff850d607e27 +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/ee4e22ea1e854ce810455fec329e4c38 +0 -0
  36. data/test/dummy/tmp/pids/server.pid +1 -1
  37. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31310b9d9e8e32ad781eabec941689e8834664be
4
- data.tar.gz: 5f105595e889188ada75ef775231a87606a1740c
3
+ metadata.gz: 6ee3b90280750fbf42f60df90a5db0c1b348fc02
4
+ data.tar.gz: a5f63c59647e138ab326a99e4fdf82269114f311
5
5
  SHA512:
6
- metadata.gz: b99b00f8a691b75586fa5c7f6c0d940061858684694ce4d22ffc55c0983608c054ab3be8483dabafa7eca316cd7eb3d433fb7119f97d63a159e55aada1bf4361
7
- data.tar.gz: 8a9b8ec030c338a0c6f6c7c19e434e3c060cba160473aba2be339a334be083b3dfcbff97c26ce7299f20364320332fe6a78ae97d9e8f1d3a5583adfe532a4316
6
+ metadata.gz: 1fae8b927a6e97338f7e191c5b07ba66beb3e27d727436513cfa0210558ca18d7b63f6bfa935fb373978347e948f88c8efd13613c43ac665234d65acdf6268c3
7
+ data.tar.gz: 2ccd4ecd6252732497306f0e7a5d29909bb657b64314d323ff14643504039d81c297be67031673fce2c7b5ea57967ab2b87138dd7bfd9d23aa19fe49c5268d52
@@ -313,110 +313,119 @@
313
313
  })(
314
314
  typeof define === 'function' && define.amd
315
315
  ? define
316
- : function (r, factory) { factory(jQuery); }
316
+ : function (r, factory) { factory(jQuery);
317
+ }
317
318
  );
318
319
 
319
- // percentage of 'x' position of center of focus for bg scaling
320
- var xFocus = 0.8;
321
- var yFocus = 0.5;
322
- var blurGenerated = false;
323
-
324
- var updateHeroPosition = function() {
325
- var $source = $('.hero-blur');
326
- var $blur = $(".hero-blur-block");
327
-
328
- var imgWidth = $blur.attr('data-hero-width');
329
- var imgHeight = $blur.attr('data-hero-height');
330
- var imgScale = imgHeight / imgWidth;
331
- var heroScale = $source.outerHeight() / $source.outerWidth();
332
-
333
- // how many scaled pixels are on/off the viewport
334
- var imgOnScreenX = (imgScale / heroScale) * imgWidth;
335
- var imgOffScreenX = imgWidth - imgOnScreenX;
336
- var imgOnScreenY = (imgScale / heroScale) * imgHeight;
337
- var imgOffScreenY = imgHeight - imgOnScreenY;
338
-
339
- var viewFactorX = imgOffScreenX / imgOnScreenX;
340
- var viewFactorY = Math.abs(imgOffScreenY / imgOnScreenY);
341
-
342
- // how many actual pixels are on/off the viewport
343
- var heroOnScreenX = $source.outerWidth();
344
- var heroOffScreenX = heroOnScreenX * viewFactorX;
345
-
346
- var heroOnScreenY = $source.outerHeight();
347
- var heroOffScreenY = heroOnScreenY * viewFactorY;
348
-
349
- var offsetBlurY = $source.offset().top - $blur.offset().top;
350
- var offsetBlurX = $source.offset().left - $blur.offset().left;
351
-
352
- if (heroScale >= imgScale) {
353
- //console.log("image is wider than screen", heroOnScreenX, imgOffScreenX, heroOnScreenX, heroOffScreenX, viewFactorX, heroOnScreenY);
354
- offsetBlurX -= heroOffScreenX * xFocus;
355
- $blur.css('background-size', (heroOnScreenX + heroOffScreenX) + 'px ' + heroOnScreenY + "px");
356
- } else {
357
- //console.log("image is taller than screen", imgOnScreenY, imgOffScreenY, heroOnScreenY, heroOffScreenY, viewFactorY);
358
- $blur.css('background-size', heroOnScreenX + 'px auto');
359
- }
360
320
 
361
- $source.css('background-position', (xFocus * 100) + '% ' + '0%');
362
- $blur.css('background-position', (offsetBlurX) + 'px ' + (offsetBlurY) + 'px');
363
- };
321
+ (function UpdateHeroModule (elem) {
364
322
 
323
+ // percentage of 'x' position of center of focus for bg scaling
324
+ var xFocus = 0.8;
325
+ var yFocus = 0.5;
365
326
 
366
- var generateHeroBlur = function(done) {
367
- $('.hero-blur-block').blurjs({
368
- source: '.hero-blur',
369
- radius: 40,
370
- overlay: 'rgba(255,255,255,0.7)'
371
- }).on('loaded', function(e, canvas) {
372
- //console.log('loaded');
373
- done(e, canvas);
374
- });
375
- };
327
+ this.blurGenerated = false;
328
+ this.windowWidth = $(window).width();
329
+
330
+ this.updateHeroPosition = function updateHeroPosition() {
331
+ var $source = $('.hero-blur');
332
+ var $blur = $(".hero-block-blur");
333
+
334
+ var imgWidth = $blur.attr('data-hero-width');
335
+ var imgHeight = $blur.attr('data-hero-height');
336
+ var imgScale = imgHeight / imgWidth;
337
+ var heroScale = $source.outerHeight() / $source.outerWidth();
338
+
339
+ // how many scaled pixels are on/off the viewport
340
+ var imgOnScreenX = (imgScale / heroScale) * imgWidth;
341
+ var imgOffScreenX = imgWidth - imgOnScreenX;
342
+ var imgOnScreenY = (imgScale / heroScale) * imgHeight;
343
+ var imgOffScreenY = imgHeight - imgOnScreenY;
344
+
345
+ var viewFactorX = imgOffScreenX / imgOnScreenX;
346
+ var viewFactorY = Math.abs(imgOffScreenY / imgOnScreenY);
347
+
348
+ // how many actual pixels are on/off the viewport
349
+ var heroOnScreenX = $source.outerWidth();
350
+ var heroOffScreenX = heroOnScreenX * viewFactorX;
351
+
352
+ var heroOnScreenY = $source.outerHeight();
353
+ var heroOffScreenY = heroOnScreenY * viewFactorY;
354
+
355
+ var offsetBlurY = $source.offset().top - $blur.offset().top;
356
+ var offsetBlurX = $source.offset().left - $blur.offset().left;
357
+
358
+ if (heroScale >= imgScale) {
359
+ //console.log("image is wider than screen", heroOnScreenX, imgOffScreenX, heroOnScreenX, heroOffScreenX, viewFactorX, heroOnScreenY);
360
+ offsetBlurX -= heroOffScreenX * xFocus;
361
+ $blur.css('background-size', (heroOnScreenX + heroOffScreenX) + 'px ' + heroOnScreenY + "px");
362
+ } else {
363
+ //console.log("image is taller than screen", imgOnScreenY, imgOffScreenY, heroOnScreenY, heroOffScreenY, viewFactorY);
364
+ $blur.css('background-size', heroOnScreenX + 'px auto');
365
+ }
366
+
367
+ $source.css('background-position', (xFocus * 100) + '% ' + '0%');
368
+ $blur.css('background-position', (offsetBlurX) + 'px ' + (offsetBlurY) + 'px');
369
+ };
370
+
371
+ this.generateHeroBlur = function(done) {
372
+ $('.hero-block-blur').blurjs({
373
+ source: '.hero-blur',
374
+ radius: 30,
375
+ overlay: 'rgba(255,255,255,0.8)'
376
+ }).on('loaded', function(e, canvas) {
377
+ done(e, canvas);
378
+ });
379
+ };
380
+
381
+ this.initialize = function() {
382
+ $(".hero-blur").addClass('hero-blur-visible');
383
+
384
+ this.generateHeroBlur(function(e, canvas) {
385
+ this.blurGenerated = true;
386
+ // initializes position upon load
387
+ $(e.target).addClass('hero-block-blur-visible');
388
+ this.updateHeroPosition();
389
+ });
390
+
391
+ this.updateHeroPosition();
392
+ };
393
+
394
+ elem.UpdateHeroModule = this;
395
+ })(window);
376
396
 
377
397
  // initialize
378
398
  $(function() {
379
- $(".hero-blur").addClass('hero-blur-visible');
399
+ // prevents a race condition where var heroOnScreenY = $source.outerHeight(); above returns an incorrect height
400
+ setTimeout(function() {
401
+ window.UpdateHeroModule.initialize();
402
+ }, 100);
380
403
 
381
404
  // mobile images will use optimized image fallback
382
405
  if ($(window).width() <= 768) {
383
- $(".hero-blur-block-side").addClass('hero-blur-block-visible');
406
+ $(".hero-blur").addClass('hero-blur-visible');
407
+ $(".hero-block-side .hero-block-blur").addClass('hero-block-blur-visible');
384
408
  }
385
-
386
- generateHeroBlur(function(e, canvas) {
387
- blurGenerated = true;
388
- // initializes position upon load
389
- $(e.target).addClass('hero-blur-block-visible');
390
- updateHeroPosition();
391
- });
392
-
393
- updateHeroPosition();
394
409
  });
395
410
 
396
- var windowWidth = $(window).width();
397
411
 
398
412
  $(window).resize(function() {
413
+ var updateHeroModule = window.UpdateHeroModule;
399
414
 
400
415
  // Check window width has actually changed and it's not just iOS triggering a resize event on scroll
401
- if ($(window).width() != windowWidth) {
402
- updateHeroPosition();
416
+ if ($(window).width() != updateHeroModule.windowWidth) {
417
+ updateHeroModule.updateHeroPosition();
403
418
  // Update the window width for next time
404
- windowWidth = $(window).width();
419
+ updateHeroModule.windowWidth = $(window).width();
405
420
  }
406
421
 
407
422
  // if mobile optimized image was loaded, now generate a proper blur image (mostly for local testing)
408
- if (!blurGenerated && $(window).width() >= 768) {
409
- blurGenerated = true;
410
- $(".hero-blur-block").removeClass('hero-blur-block-visible');
411
- generateHeroBlur(function(e, canvas) {
412
- $(e.target).addClass('hero-blur-block-visible');
413
- updateHeroPosition();
423
+ if (!updateHeroModule.blurGenerated && $(window).width() >= 768) {
424
+ updateHeroModule.blurGenerated = true;
425
+ $(".hero-block-blur").removeClass('hero-block-blur-visible');
426
+ updateHeroModule.generateHeroBlur(function(e, canvas) {
427
+ $(e.target).addClass('hero-block-blur-visible');
428
+ updateHeroModule.updateHeroPosition();
414
429
  });
415
430
  }
416
-
417
- });
418
-
419
- $(window).scroll(function() {
420
- // enables fixed display behavior
421
- //updateHeroPosition();
422
431
  });
@@ -1,8 +1,18 @@
1
1
  $(function () {
2
2
  $(".list-group-toggle-trigger").click(function (e) {
3
3
  e.preventDefault();
4
- $(this).next('.list-group-item-child').toggleClass("is-open");
5
- $("i",this).toggleClass("fa-plus fa-minus");
6
- $(this).toggleClass("is-open");
4
+ $(this).next('.list-group-item-child').toggleClass("is_open");
5
+ $("i", this).toggleClass("fa-plus fa-minus");
7
6
  })
8
7
  });
8
+
9
+ $(function () {
10
+ var activeListItems = $('.list-group-link-is_active');
11
+
12
+ if ($(activeListItems).length) {
13
+ $(activeListItems).append('<i class="fa fa-times"></i>');
14
+ $(activeListItems).parents('.list-group-item-child').addClass('is_open');
15
+ $(activeListItems).parents('.list-group-item').addClass('is_active');
16
+ $(activeListItems).parents('.list-group-item').find('.list-group-toggle-trigger .fa').toggleClass("fa-plus fa-minus");
17
+ }
18
+ });
@@ -14,6 +14,8 @@
14
14
  @import "select";
15
15
  @import "checkbox";
16
16
  @import "hero";
17
+ @import "hero-block";
18
+ @import "hero-product";
17
19
  @import "hero-blur";
18
20
  @import "progress";
19
21
  @import "dropdown-menu";
@@ -190,6 +190,15 @@
190
190
 
191
191
  // Because of Action buttons particular formatting, it requires some special positioning adjustments
192
192
  &.btn-action {
193
+
194
+ &.btn-link {
195
+ &:hover,
196
+ &:active,
197
+ &:focus {
198
+ text-decoration: none;
199
+ }
200
+ }
201
+
193
202
  .btn-action-label {
194
203
  margin: 0;
195
204
  padding-top: 0px;
@@ -0,0 +1,82 @@
1
+ .hero-block {
2
+ background-size: cover;
3
+ padding: 30px;
4
+ }
5
+ .hero-block-title {
6
+ font-size: 35px;
7
+ color: color('white');
8
+ text-shadow: color('gray-700') 0 2px 10px !important;
9
+
10
+ @media (min-width: $screen-sm) {
11
+ font-size: 40px;
12
+ }
13
+ @media (min-width: $screen-lg) {
14
+ font-size: 50px;
15
+ }
16
+ }
17
+ .hero-block-description {
18
+ color: color('white');
19
+ text-shadow: color('gray-700') 0 1px 5px !important;
20
+ }
21
+
22
+ .hero-block-side {
23
+ width: 400px;
24
+ margin-top: 0;
25
+ margin-left: 50px;
26
+ padding: 30px;
27
+
28
+ @media (max-width: $screen-sm) {
29
+ width: 100%;
30
+ margin: 0;
31
+ }
32
+ @media (min-width: $screen-lg) {
33
+ margin-bottom: 0;
34
+ }
35
+ @media (min-width: $screen-xl) {
36
+ width: 500px;
37
+ padding-top: 50px;
38
+ padding-bottom: 50px;
39
+ margin-bottom: 0;
40
+ }
41
+ @media (min-width: $screen-xxl) {
42
+ width: 600px;
43
+ padding-top: 140px;
44
+ padding-bottom: 140px;
45
+ }
46
+
47
+ .hero-block-description {
48
+ margin-top: 40px;
49
+ padding-top: 40px;
50
+ padding-bottom: 50px;
51
+ color: color('gray-700');
52
+ line-height: 1.4;
53
+ text-align: left;
54
+ text-shadow: none !important;
55
+ border-top: 1px solid color('gray-600');
56
+ border-bottom: 1px solid color('gray-600');
57
+
58
+ @media (max-width: $screen-sm) {
59
+ margin-top: 20px;
60
+ padding-top: 20px;
61
+ padding-bottom: 20px;
62
+ }
63
+ }
64
+ }
65
+ .hero-block-cta {
66
+ margin-top: 5px;
67
+
68
+ // for hero CTAs layout in between xs -> sm breakpoints
69
+ @media (max-width: 580px) {
70
+ width: 100%;
71
+ }
72
+ }
73
+ .hero-block-cta-justified {
74
+ width: 250px;
75
+ }
76
+ .hero-block-actions {
77
+ text-align: left;
78
+
79
+ @media (max-width: $screen-sm) {
80
+ text-align: center;
81
+ }
82
+ }
@@ -9,7 +9,7 @@
9
9
  @include transition-timing-function(ease-in);
10
10
  }
11
11
 
12
- .hero-blur-block {
12
+ .hero-block-blur {
13
13
  position: relative;
14
14
  margin-top: 150px;
15
15
  opacity: 0;
@@ -22,126 +22,15 @@
22
22
  margin-top: 250px;
23
23
  margin-bottom: 50px;
24
24
  }
25
- @media(min-width: $screen-xl) {
25
+ @media (min-width: $screen-xl) {
26
26
  margin-top: 300px;
27
27
  margin-bottom: 100px;
28
28
  }
29
+ &.hero-block-side {
30
+ @extend .hero-block-side;
31
+ }
29
32
  }
30
- .hero-blur-block-visible,
33
+ .hero-block-blur-visible,
31
34
  .hero-blur-visible {
32
35
  opacity: 1.0;
33
36
  }
34
-
35
- .hero-block {
36
- background-size: cover;
37
- padding: 30px;
38
- }
39
-
40
- .hero-blur-block-side {
41
- width: 400px;
42
- margin-top: 0;
43
- margin-left: 50px;
44
- padding: 30px;
45
-
46
- @media (max-width: $screen-sm) {
47
- width: 100%;
48
- margin: 0;
49
- }
50
- @media (min-width: $screen-lg) {
51
- margin-bottom: 0;
52
- }
53
- @media (min-width: $screen-xl) {
54
- width: 500px;
55
- padding-top: 50px;
56
- padding-bottom: 50px;
57
- margin-bottom: 0;
58
- }
59
- @media (min-width: $screen-xxl) {
60
- width: 600px;
61
- padding-top: 140px;
62
- padding-bottom: 140px;
63
- }
64
-
65
- .hero-block-description {
66
- margin-top: 40px;
67
- padding-top: 40px;
68
- padding-bottom: 50px;
69
- color: color('gray-700');
70
- line-height: 1.4;
71
- text-align: left;
72
- text-shadow: none !important;
73
- border-top: 1px solid color('gray-600');
74
- border-bottom: 1px solid color('gray-600');
75
-
76
- @media (max-width: $screen-sm) {
77
- text-align: center;
78
- }
79
- @media (max-width: $screen-xs) {
80
- border: 0;
81
- padding-top: 20px;
82
- padding-bottom: 20px;
83
- }
84
- }
85
- }
86
-
87
- .hero-block-title {
88
- font-size: 35px;
89
- color: color('white');
90
- text-shadow: color('gray-700') 0 2px 10px !important;
91
-
92
- @media (min-width: $screen-sm) {
93
- font-size: 40px;
94
- }
95
- @media (min-width: $screen-lg) {
96
- font-size: 50px;
97
- }
98
- }
99
- .hero-block-description {
100
- color: color('white');
101
- text-shadow: color('gray-700') 0 1px 5px !important;
102
- }
103
- .hero-block-cta {
104
- margin-top: 5px;
105
-
106
- // for hero CTAs layout in between xs -> sm breakpoints
107
- @media (max-width: 580px) {
108
- width: 100%;
109
- }
110
- }
111
- .hero-block-cta-justified {
112
- width: 250px;
113
- }
114
-
115
- .hero-product-logo {
116
- margin-left: 0;
117
- padding-top: 40px;
118
-
119
- @media (max-width: $screen-sm) {
120
- position: relative;
121
- padding: 0;
122
- margin: auto;
123
- width: 100%;
124
- max-width: 500px;
125
- }
126
-
127
- .hero-product-details {
128
- font-size: font-size(500);
129
- padding: 30px 10px;
130
-
131
- @media (max-width: $screen-sm) {
132
- font-size: font-size(400);
133
- padding: 20px 0;
134
- }
135
- }
136
- }
137
- .hero-product-logo-block {
138
- height: 100px;
139
- }
140
-
141
- .hero-block-actions {
142
- text-align: left;
143
-
144
- @media (max-width: $screen-sm) {
145
- text-align: center;
146
- }
147
- }