megatron 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +43 -2
  3. data/app/assets/javascripts/megatron/form.js +36 -0
  4. data/app/assets/javascripts/megatron/index.js +93 -0
  5. data/app/assets/javascripts/megatron/link.js +58 -0
  6. data/app/assets/javascripts/megatron/utils/auto-navigate.js +24 -0
  7. data/app/assets/javascripts/megatron/utils/form-notify.js +39 -0
  8. data/app/assets/javascripts/megatron/utils/index.js +112 -0
  9. data/app/assets/javascripts/megatron/utils/messages.js +97 -0
  10. data/app/assets/javascripts/megatron/utils/time/date-to-html.js +59 -0
  11. data/app/assets/javascripts/megatron/utils/time/time-switch.js +87 -0
  12. data/app/assets/javascripts/megatron/utils/time/timeago.js +95 -0
  13. data/app/assets/javascripts/megatron/utils/toggler.js +163 -0
  14. data/app/assets/stylesheets/_example.scss +76 -0
  15. data/app/assets/stylesheets/_grid.scss +41 -0
  16. data/app/assets/stylesheets/_typography.scss +38 -0
  17. data/app/assets/stylesheets/application.scss +19 -0
  18. data/app/assets/stylesheets/megatron/error-pages.scss +164 -0
  19. data/app/assets/stylesheets/megatron/error-pages/_animations.scss +96 -0
  20. data/app/assets/stylesheets/megatron/error-pages/_csi.scss +41 -0
  21. data/app/assets/stylesheets/megatron/error-pages/_waves.scss +36 -0
  22. data/app/assets/stylesheets/megatron/megatron.scss +3 -0
  23. data/app/assets/stylesheets/megatron/modules/_crop-height.scss +5 -0
  24. data/app/assets/stylesheets/megatron/modules/_index.scss +22 -0
  25. data/app/assets/stylesheets/megatron/modules/_logo.scss +67 -0
  26. data/app/assets/stylesheets/megatron/modules/_new-tag.scss +11 -0
  27. data/app/assets/stylesheets/megatron/modules/_progress.scss +80 -0
  28. data/app/assets/stylesheets/megatron/modules/app/_animation-classes.scss +3 -0
  29. data/app/assets/stylesheets/megatron/modules/app/_animations.scss +62 -0
  30. data/app/assets/stylesheets/megatron/modules/app/_index.scss +5 -0
  31. data/app/assets/stylesheets/megatron/modules/app/_layout.scss +261 -0
  32. data/app/assets/stylesheets/megatron/modules/app/_sizes.scss +28 -0
  33. data/app/assets/stylesheets/megatron/modules/app/_typography.scss +111 -0
  34. data/app/assets/stylesheets/megatron/modules/box/_base.scss +94 -0
  35. data/app/assets/stylesheets/megatron/modules/box/_color-box.scss +33 -0
  36. data/app/assets/stylesheets/megatron/modules/box/_deployment_box.scss +37 -0
  37. data/app/assets/stylesheets/megatron/modules/box/_index.scss +4 -0
  38. data/app/assets/stylesheets/megatron/modules/box/_placeholder.scss +6 -0
  39. data/app/assets/stylesheets/megatron/modules/buttons/_animations.scss +35 -0
  40. data/app/assets/stylesheets/megatron/modules/buttons/_buttons.scss +266 -0
  41. data/app/assets/stylesheets/megatron/modules/buttons/_index.scss +4 -0
  42. data/app/assets/stylesheets/megatron/modules/buttons/_mixins.scss +108 -0
  43. data/app/assets/stylesheets/megatron/modules/buttons/_pills.scss +44 -0
  44. data/app/assets/stylesheets/megatron/modules/code/_codemirror.scss +98 -0
  45. data/app/assets/stylesheets/megatron/modules/code/_highlighted.scss +65 -0
  46. data/app/assets/stylesheets/megatron/modules/code/_index.scss +3 -0
  47. data/app/assets/stylesheets/megatron/modules/code/_syntax.scss +18 -0
  48. data/app/assets/stylesheets/megatron/modules/core/_colored-items.scss +22 -0
  49. data/app/assets/stylesheets/megatron/modules/core/_colors.scss +163 -0
  50. data/app/assets/stylesheets/megatron/modules/core/_index.scss +3 -0
  51. data/app/assets/stylesheets/megatron/modules/core/_mixins.scss +262 -0
  52. data/app/assets/stylesheets/megatron/modules/core/_vars.scss +30 -0
  53. data/app/assets/stylesheets/megatron/modules/core/_z-index.scss +3 -0
  54. data/app/assets/stylesheets/megatron/modules/dialog/_animations.scss +48 -0
  55. data/app/assets/stylesheets/megatron/modules/dialog/_dialog.scss +81 -0
  56. data/app/assets/stylesheets/megatron/modules/dialog/_index.scss +2 -0
  57. data/app/assets/stylesheets/megatron/modules/forms/_base.scss +31 -0
  58. data/app/assets/stylesheets/megatron/modules/forms/_check-radio.scss +99 -0
  59. data/app/assets/stylesheets/megatron/modules/forms/_check-switch.scss +88 -0
  60. data/app/assets/stylesheets/megatron/modules/forms/_footer.scss +13 -0
  61. data/app/assets/stylesheets/megatron/modules/forms/_index.scss +10 -0
  62. data/app/assets/stylesheets/megatron/modules/forms/_login.scss +92 -0
  63. data/app/assets/stylesheets/megatron/modules/forms/_radio-nav.scss +62 -0
  64. data/app/assets/stylesheets/megatron/modules/forms/_select.scss +37 -0
  65. data/app/assets/stylesheets/megatron/modules/forms/_stacked-form.scss +29 -0
  66. data/app/assets/stylesheets/megatron/modules/forms/_table-form.scss +53 -0
  67. data/app/assets/stylesheets/megatron/modules/forms/_text-input.scss +118 -0
  68. data/app/assets/stylesheets/megatron/modules/grids/_alignment.scss +39 -0
  69. data/app/assets/stylesheets/megatron/modules/grids/_grid.scss +144 -0
  70. data/app/assets/stylesheets/megatron/modules/grids/_index.scss +2 -0
  71. data/app/assets/stylesheets/megatron/modules/headers/_actions.scss +10 -0
  72. data/app/assets/stylesheets/megatron/modules/headers/_base.scss +67 -0
  73. data/app/assets/stylesheets/megatron/modules/headers/_index.scss +4 -0
  74. data/app/assets/stylesheets/megatron/modules/headers/_meta.scss +10 -0
  75. data/app/assets/stylesheets/megatron/modules/headers/_site-header.scss +8 -0
  76. data/app/assets/stylesheets/megatron/modules/lib/_codemirror.scss +301 -0
  77. data/app/assets/stylesheets/megatron/modules/lists/_base.scss +13 -0
  78. data/app/assets/stylesheets/megatron/modules/lists/_box-list.scss +53 -0
  79. data/app/assets/stylesheets/megatron/modules/lists/_index.scss +2 -0
  80. data/app/assets/stylesheets/megatron/modules/messages/_index.scss +3 -0
  81. data/app/assets/stylesheets/megatron/modules/messages/_notice.scss +57 -0
  82. data/app/assets/stylesheets/megatron/modules/messages/_notifications.scss +126 -0
  83. data/app/assets/stylesheets/megatron/modules/messages/_pop-message.scss +157 -0
  84. data/app/assets/stylesheets/megatron/modules/nav/_auto-navigate.scss +7 -0
  85. data/app/assets/stylesheets/megatron/modules/nav/_breadcrumbs.scss +35 -0
  86. data/app/assets/stylesheets/megatron/modules/nav/_index.scss +8 -0
  87. data/app/assets/stylesheets/megatron/modules/nav/_main-sidebar.scss +21 -0
  88. data/app/assets/stylesheets/megatron/modules/nav/_mixins.scss +53 -0
  89. data/app/assets/stylesheets/megatron/modules/nav/_nav-toggle.scss +61 -0
  90. data/app/assets/stylesheets/megatron/modules/nav/_primary-nav.scss +120 -0
  91. data/app/assets/stylesheets/megatron/modules/nav/_secondary-nav.scss +105 -0
  92. data/app/assets/stylesheets/megatron/modules/nav/_tabs.scss +87 -0
  93. data/app/assets/stylesheets/megatron/modules/roboticons/_font.scss +62 -0
  94. data/app/assets/stylesheets/megatron/modules/roboticons/_icons.scss +219 -0
  95. data/app/assets/stylesheets/megatron/modules/roboticons/_index.scss +2 -0
  96. data/app/assets/stylesheets/megatron/modules/slider/_base.scss +49 -0
  97. data/app/assets/stylesheets/megatron/modules/slider/_index.scss +4 -0
  98. data/app/assets/stylesheets/megatron/modules/slider/_slider.scss +282 -0
  99. data/app/assets/stylesheets/megatron/modules/slider/_switch.scss +75 -0
  100. data/app/assets/stylesheets/megatron/modules/slider/_themes.scss +42 -0
  101. data/app/assets/stylesheets/megatron/modules/tables/_base.scss +170 -0
  102. data/app/assets/stylesheets/megatron/modules/tables/_border-table.scss +28 -0
  103. data/app/assets/stylesheets/megatron/modules/tables/_box-table.scss +36 -0
  104. data/app/assets/stylesheets/megatron/modules/tables/_columns.scss +8 -0
  105. data/app/assets/stylesheets/megatron/modules/tables/_doc-table.scss +22 -0
  106. data/app/assets/stylesheets/megatron/modules/tables/_icon-cell.scss +9 -0
  107. data/app/assets/stylesheets/megatron/modules/tables/_index.scss +7 -0
  108. data/app/assets/stylesheets/megatron/modules/tables/_link-cell.scss +8 -0
  109. data/app/assets/stylesheets/megatron/modules/tables/_responsive-table.scss +13 -0
  110. data/app/assets/stylesheets/megatron/modules/widgets/_index.scss +1 -0
  111. data/app/assets/stylesheets/megatron/modules/widgets/_time-switch.scss +24 -0
  112. data/lib/megatron.rb +1 -1
  113. data/lib/megatron/engine.rb +5 -0
  114. data/lib/megatron/version.rb +1 -1
  115. data/lib/tasks/megatron_tasks.rake +4 -4
  116. data/public/assets/megatron/megatron-0.0.4.css +3 -0
  117. data/public/assets/megatron/{megatron-0.0.3.css.map → megatron-0.0.4.css.map} +3 -3
  118. data/public/assets/megatron/{megatron-0.0.3.js → megatron-0.0.4.js} +1 -1
  119. data/public/assets/megatron/megatron-0.0.4.map.json +1 -0
  120. metadata +115 -6
  121. data/public/assets/megatron/megatron-0.0.3.css +0 -2
  122. data/public/assets/megatron/megatron-0.0.3.map.json +0 -1
@@ -0,0 +1,62 @@
1
+ //
2
+ // $icon-host: Optionally point to a remote host where files are being served.
3
+ // - e.g. $icon-host: "//megatron.dblayer.com"
4
+ //
5
+
6
+ $icon-host: "https://app.compose.io/assets/megatron" !default;
7
+
8
+ @font-face {
9
+ font-family: 'roboticons';
10
+ src:url('#{$icon-host}/fonts/roboticons.woff?hxraic') format('woff'),
11
+ url('#{$icon-host}/fonts/roboticons.ttf?hxraic') format('truetype');
12
+ font-weight: normal;
13
+ font-style: normal;
14
+ }
15
+
16
+ %icon-font {
17
+ font: {
18
+ family: 'roboticons';
19
+ style: normal;
20
+ weight: normal;
21
+ variant: normal;
22
+ }
23
+
24
+ text: {
25
+ decoration: none;
26
+ transform: none;
27
+ }
28
+
29
+ display: inline-block;
30
+ speak: none;
31
+ line-height: 1;
32
+ @include smooth-text;
33
+ }
34
+
35
+ [class*=_icon]:before { @extend %icon-font; }
36
+
37
+ // Aliases:
38
+
39
+ .x_fill_icon { @extend .x_circle_fill_thin_icon; }
40
+ .x_line_icon { @extend .x_circle_thin_icon; }
41
+
42
+ .hidden_label {
43
+ position: absolute !important;
44
+ height: 1px; width: 1px;
45
+ overflow: hidden;
46
+ clip: rect(1px, 1px, 1px, 1px);
47
+ }
48
+
49
+ $font-sizes: (
50
+ 'xx-small' : 10px,
51
+ 'x-small' : 12px,
52
+ 'small' : 14px,
53
+ 'medium' : 16px,
54
+ 'large' : 18px,
55
+ 'x-large' : 22px,
56
+ 'xx-large' : 26px,
57
+ 'xxx-large' : 32px
58
+ );
59
+
60
+ @each $name, $size in $font-sizes {
61
+ .#{$name}-text { font-size: $size; }
62
+ }
@@ -0,0 +1,219 @@
1
+ .eye_icon:before {
2
+ content: "\e647";
3
+ }
4
+ .eye_closed_icon:before {
5
+ content: "\e648";
6
+ }
7
+ .unlocked_icon:before {
8
+ content: "\e646";
9
+ }
10
+ .locked_icon:before {
11
+ content: "\e645";
12
+ }
13
+ .logs_icon:before {
14
+ content: "\e644";
15
+ }
16
+ .cli_icon:before {
17
+ content: "\e643";
18
+ }
19
+ .elasticsearch_deployment_icon:before {
20
+ content: "\e63f";
21
+ }
22
+ .mongodb_deployment_icon:before {
23
+ content: "\e640";
24
+ }
25
+ .redis_deployment_icon:before {
26
+ content: "\e641";
27
+ }
28
+ .rethinkdb_deployment_icon:before {
29
+ content: "\e642";
30
+ }
31
+ .x_circle_fill_icon:before {
32
+ content: "\e639";
33
+ }
34
+ .x_circle_icon:before {
35
+ content: "\e63a";
36
+ }
37
+ .arrow_left_circle_fill_icon:before {
38
+ content: "\e63b";
39
+ }
40
+ .arrow_left_circle_icon:before {
41
+ content: "\e63c";
42
+ }
43
+ .arrow_right_circle_fill_icon:before {
44
+ content: "\e63d";
45
+ }
46
+ .arrow_right_circle_icon:before {
47
+ content: "\e63e";
48
+ }
49
+ .plus_circle_fill_icon:before {
50
+ content: "\e636";
51
+ }
52
+ .plus_circle_icon:before {
53
+ content: "\e637";
54
+ }
55
+ .bubble_fill_icon:before {
56
+ content: "\e638";
57
+ }
58
+ .sandbox_icon:before {
59
+ content: "\e635";
60
+ }
61
+ .deployment_small_icon:before {
62
+ content: "\e634";
63
+ }
64
+ .database_small_icon:before {
65
+ content: "\e61e";
66
+ }
67
+ .transporter_icon:before {
68
+ content: "\e632";
69
+ }
70
+ .minus_icon:before {
71
+ content: "\e611";
72
+ }
73
+ .puzzle_icon:before {
74
+ content: "\e633";
75
+ }
76
+ .api_icon:before {
77
+ content: "\e62c";
78
+ }
79
+ .warning_icon:before {
80
+ content: "\e631";
81
+ }
82
+ .jobs_icon:before {
83
+ content: "\e620";
84
+ }
85
+ .gear_round_icon:before {
86
+ content: "\e62d";
87
+ }
88
+ .check_thin_icon:before {
89
+ content: "\e62e";
90
+ }
91
+ .check_circle_fill_icon:before {
92
+ content: "\e62f";
93
+ }
94
+ .check_circle_icon:before {
95
+ content: "\e630";
96
+ }
97
+ .x_icon:before {
98
+ content: "\e600";
99
+ }
100
+ .x_circle_thin_icon:before {
101
+ content: "\e601";
102
+ }
103
+ .x_circle_fill_thin_icon:before {
104
+ content: "\e602";
105
+ }
106
+ .watch_icon:before {
107
+ content: "\e603";
108
+ }
109
+ .users_icon:before {
110
+ content: "\e604";
111
+ }
112
+ .tools_icon:before {
113
+ content: "\e605";
114
+ }
115
+ .star_icon:before {
116
+ content: "\e606";
117
+ }
118
+ .scale_icon:before {
119
+ content: "\e607";
120
+ }
121
+ .rocket_icon:before {
122
+ content: "\e608";
123
+ }
124
+ .restore_icon:before {
125
+ content: "\e609";
126
+ }
127
+ .question_line_icon:before {
128
+ content: "\e60a";
129
+ }
130
+ .question_full_icon:before {
131
+ content: "\e60b";
132
+ }
133
+ .processing_icon:before {
134
+ content: "\e60c";
135
+ }
136
+ .power_icon:before {
137
+ content: "\e60d";
138
+ }
139
+ .plus_icon:before {
140
+ content: "\e60e";
141
+ }
142
+ .payment_icon:before {
143
+ content: "\e60f";
144
+ }
145
+ .monitoring_icon:before {
146
+ content: "\e610";
147
+ }
148
+ .lock_icon:before {
149
+ content: "\e612";
150
+ }
151
+ .info_icon:before {
152
+ content: "\e613";
153
+ }
154
+ .hourglass_icon:before {
155
+ content: "\e614";
156
+ }
157
+ .home_icon:before {
158
+ content: "\e615";
159
+ }
160
+ .help_icon:before {
161
+ content: "\e616";
162
+ }
163
+ .globe_icon:before {
164
+ content: "\e617";
165
+ }
166
+ .gear_icon:before {
167
+ content: "\e618";
168
+ }
169
+ .gear_line_icon:before {
170
+ content: "\e619";
171
+ }
172
+ .download_icon:before {
173
+ content: "\e61a";
174
+ }
175
+ .deployments_icon:before {
176
+ content: "\e61b";
177
+ }
178
+ .databases_icon:before {
179
+ content: "\e61c";
180
+ }
181
+ .databases_line_icon:before {
182
+ content: "\e61d";
183
+ }
184
+ .collections_icon:before {
185
+ content: "\e61f";
186
+ }
187
+ .clock_line_icon:before {
188
+ content: "\e621";
189
+ }
190
+ .clock_fill_icon:before {
191
+ content: "\e622";
192
+ }
193
+ .chevron_icon:before {
194
+ content: "\e623";
195
+ }
196
+ .chevron_thin_icon:before {
197
+ content: "\e624";
198
+ }
199
+ .check_icon:before {
200
+ content: "\e625";
201
+ }
202
+ .bubble_icon:before {
203
+ content: "\e626";
204
+ }
205
+ .bell_icon:before {
206
+ content: "\e627";
207
+ }
208
+ .backups_icon:before {
209
+ content: "\e628";
210
+ }
211
+ .alerts_icon:before {
212
+ content: "\e629";
213
+ }
214
+ .account_icon:before {
215
+ content: "\e62a";
216
+ }
217
+ .account_circle_icon:before {
218
+ content: "\e62b";
219
+ }
@@ -0,0 +1,2 @@
1
+ @import "font";
2
+ @import "icons";
@@ -0,0 +1,49 @@
1
+ $slider-red: hsl(0, 70, 65) !default;
2
+ $slider-orange: hsl(30, 90, 68) !default;
3
+ $slider-blue: hsl(205, 60, 55) !default;
4
+ $slider-purple: hsl(235, 60, 65) !default;
5
+ $slider-glow: hsl(199, 70%, 44%) !default;
6
+ $slider-font: Helvetica, Arial, sans;
7
+ $slider-font-size: 13px;
8
+ $slider-track: #e8e8e8;
9
+ $slider-switch-bg: #fafafa;
10
+ $slider-label-color: #555;
11
+
12
+ $slider-segment-width: 45px !default;
13
+ $slider-segment-height: 11px !default;
14
+ $slider-track-offset: 3px !default; //account for rounded corners
15
+
16
+ @mixin slider-fill-bg {
17
+ &, &:first-child:before { @content; }
18
+ }
19
+
20
+ @mixin slider-track-bg {
21
+ &, &:last-child:after { @content; }
22
+ }
23
+
24
+ @mixin slider-border($color) {
25
+ border-left-color: adjust-color($color, $lightness: 8%, $saturation: 20%);
26
+ border-right-color: adjust-color($color, $lightness: -10%, $saturation: -20%);
27
+ }
28
+
29
+ @mixin slider-fill-colors($color) {
30
+ @include slider-fill-bg {
31
+ background-color: $color;
32
+ }
33
+ @include slider-border($color);
34
+ }
35
+
36
+ %slider-segment {
37
+ width: $slider-segment-width;
38
+ height: $slider-segment-height;
39
+ display: inline-block;
40
+ float: left;
41
+ &:first-child { border-left-color: transparent; }
42
+ &:last-child { border-right-color: transparent; }
43
+ }
44
+
45
+ select.slider, .slider select {
46
+ position: absolute; opacity: 0;
47
+ font-size: 0;
48
+ }
49
+
@@ -0,0 +1,4 @@
1
+ @import "base";
2
+ @import "slider";
3
+ @import "switch";
4
+ @import "themes";
@@ -0,0 +1,282 @@
1
+ //----------------------------//
2
+ // Standard horizontal slider //
3
+ //----------------------------//
4
+
5
+
6
+ .select-slider {
7
+
8
+ // Base layout style
9
+
10
+ &,* { box-sizing: border-box; }
11
+
12
+ font-family: $slider-font;
13
+ line-height: 1em;
14
+ position: relative; z-index: 1;
15
+ cursor: pointer;
16
+ display: block;
17
+ margin: 1em {
18
+ left: $slider-track-offset * 2; // Rounded corners use pesudo elements and position absolute
19
+ right: $slider-track-offset * 2; // be sure they don't run into anything
20
+ }
21
+
22
+ // Stretch slider track containers and add box-shadow border
23
+
24
+ }
25
+
26
+ /*--------------------------------\
27
+ | Slider Track |
28
+ \--------------------------------*/
29
+
30
+ .select-slider {
31
+
32
+ // The background for the unselected portion of the track
33
+
34
+ .slider-track {
35
+ overflow: visible;
36
+ width: 100%;
37
+ height: $slider-segment-height;
38
+ position: relative; z-index: 0;
39
+ &:before {
40
+ content: "";
41
+ border-radius: 1em;
42
+ position: absolute;
43
+ top: 0; bottom: 0; left: -$slider-track-offset; right: -$slider-track-offset;
44
+ z-index: 3;
45
+ box-shadow: rgba(#000, .2) 0 0 0 1px inset, rgba(#fff, 1) 0 1px;
46
+ }
47
+ }
48
+
49
+ .slider-track-segments-wrapper {
50
+ position: absolute; top: 0; bottom: 0; right: 0; left: 0;
51
+ border-radius: 1em;
52
+ right: -$slider-track-offset;
53
+ overflow: hidden;
54
+ &:after {
55
+ content: "";
56
+ border-radius: 1em;
57
+ position: absolute;
58
+ top: 0; bottom: 0; left: -$slider-track-offset; right: -$slider-track-offset;
59
+ background-color: $slider-track;
60
+ }
61
+ }
62
+
63
+ // Wrapper for the track segments
64
+
65
+ .slider-track-segments {
66
+ height: $slider-segment-height;
67
+ position: absolute;
68
+ left: 0;
69
+ }
70
+
71
+ // Visually divides unselected slider divisions
72
+
73
+ .slider-track-segment {
74
+ @extend %slider-segment;
75
+ position: relative; z-index: 1;
76
+ border: {
77
+ left: 1px solid rgba(#fff, .5);
78
+ right: 1px solid rgba(#000, .15);
79
+ }
80
+
81
+ &:last-child {
82
+ border-right: 0;
83
+ &:after {
84
+ position: absolute; top: 0; bottom: 0; right: -3px;
85
+ content: "";
86
+ width: 3px;
87
+ z-index: 0;
88
+ border-right-radius: 1em;
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ /*--------------------------------\
95
+ | Slider Fill |
96
+ \--------------------------------*/
97
+
98
+ .select-slider {
99
+
100
+ // Fills in the selected amount of the slider track
101
+
102
+ .slider-fill {
103
+ position: absolute; top: 0; bottom: 0; right: 0; left: 0;
104
+ border-radius: 1em;
105
+ left: -$slider-track-offset;
106
+ overflow: hidden;
107
+
108
+ &:after {
109
+ content: "";
110
+ border-radius: 1em;
111
+ position: absolute; top: 0; bottom: 0; right: 0; left: 0;
112
+ box-shadow: rgba(#000, .2) 0 0 0 1px inset;
113
+ background-image: linear-gradient(rgba(#fff, .4), rgba(#fff, .1) 50%, rgba(#fff, 0));
114
+ }
115
+ }
116
+
117
+ // This wrapper is set to the full with of the slider by javascript.
118
+ // This prevents the child segments from wrapping
119
+
120
+ .slider-fill-segments {
121
+ position: relative; left: $slider-track-offset;
122
+ height: $slider-segment-height;
123
+ }
124
+
125
+ // Colored segments fill segments
126
+
127
+ .slider-fill-segment {
128
+ @extend %slider-segment;
129
+ border: 1px solid transparent { top: 0; bottom: 0; }
130
+ &:first-child {
131
+ border-left: 0;
132
+ &:before {
133
+ position: absolute; top: 0; bottom: 0; left: -($slider-track-offset);
134
+ content: "";
135
+ width: 20px;
136
+ border-radius: 1em;
137
+ z-index: 0;
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ /*--------------------------------\
144
+ | Slider Handle |
145
+ \--------------------------------*/
146
+
147
+ .select-slider {
148
+
149
+ // The handle is set to a one pixel width for minimal impact on the slider's offest.
150
+ // All of the visuals are accomplished through pseudo elements.
151
+
152
+ .slider-handle {
153
+ position: absolute;
154
+ z-index: 2;
155
+ top: 0px;
156
+ width: 1px;
157
+ height: $slider-segment-height;
158
+ z-index: 1;
159
+
160
+ &:before {
161
+ content: "";
162
+ height: 5px; width: 5px;
163
+ display: block;
164
+ margin: 0 auto;
165
+ background: #ccc;
166
+ box-shadow: rgba(#000, .2) 0 1px 1px inset;
167
+ position: absolute;
168
+ left: -2px; top: 3px;
169
+ z-index: 1;
170
+ border-radius: 1em;
171
+ }
172
+
173
+ &:after {
174
+ content: "";
175
+ position: absolute; left: -7px; right: -7px; top: -2px; bottom: -2px;
176
+ background-color: #e5e5e5;
177
+ border-radius: 1em;
178
+ background-image: linear-gradient(#fff, #eee);
179
+ box-shadow: rgba(#000, .3) 0 0 0 1px;
180
+ }
181
+
182
+ &:hover:before {
183
+ background: lighten($slider-glow, 25);
184
+ }
185
+ &:active:before {
186
+ background: lighten($slider-glow, 15);
187
+ }
188
+
189
+ }
190
+
191
+ // Handle styles for interaction
192
+
193
+ select:focus {
194
+ ~ .slider-handle {
195
+ &:before {
196
+ background: lighten($slider-glow, 15);
197
+ }
198
+ &:after {
199
+ box-shadow: #fff 0 1px 1px 1px inset,
200
+ rgba($slider-glow, .5) 0 0 0 1px,
201
+ $slider-glow 0 0 5px;
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ /*--------------------------------\
208
+ | Slider label |
209
+ |---------------------------------|
210
+ | Shows current values for slider |
211
+ \--------------------------------*/
212
+
213
+ .select-slider {
214
+
215
+ // Tip container
216
+ // Left position set by javascript
217
+
218
+ .slider-label {
219
+ position: absolute;
220
+ cursor: default;
221
+ height: 1px;
222
+ bottom: $slider-segment-height + 8;
223
+ font-size: $slider-font-size;
224
+ text-align: center;
225
+ line-height: 1.4em;
226
+ z-index: -1;
227
+ }
228
+
229
+ // Label text container
230
+
231
+ .slider-label-tip {
232
+ padding: 1px 5px;
233
+ border-radius: 4px;
234
+ border: 1px solid #aaa;
235
+ background: #fff;
236
+ color: $slider-label-color;
237
+ box-shadow: rgba(#000, .1) 0 1px 2px;
238
+
239
+ // Tip is hidden by default
240
+
241
+ opacity: 0;
242
+ position: absolute;
243
+ bottom: 0;
244
+ transform: translate3d(0, 20px, 0);
245
+ transition: all .2s ease-in-out;
246
+
247
+ // Bottom triangle
248
+
249
+ &:before, &:after {
250
+ content: "";
251
+ position: absolute;
252
+ left: 50%;
253
+ margin-left: -5px;
254
+ }
255
+ &:before {
256
+ @include triangle(down, #aaa, 6px);
257
+ bottom: -6px;
258
+ }
259
+ &:after {
260
+ @include triangle(down, #fff, 6px);
261
+ bottom: -5px;
262
+ }
263
+
264
+ // Prevent wrap for internal text
265
+
266
+ &, div { white-space: pre; }
267
+ }
268
+
269
+ // Show the tip whenever a user interacts with it
270
+
271
+ &:active, &:focus,
272
+ .slider-track:hover ~ .slider-label,
273
+ .slider-fill:hover ~ .slider-label,
274
+ .slider-handle:hover ~ .slider-label,
275
+ select:focus ~ .slider-label
276
+ {
277
+ .slider-label-tip {
278
+ opacity: 1;
279
+ transform: translate3d(0, 0, 0);
280
+ }
281
+ }
282
+ }