pageflow-progress-navigation-bar 0.4.0 → 0.5.0

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/.scss-lint.yml +147 -0
  3. data/CHANGELOG.md +29 -0
  4. data/Gemfile +0 -6
  5. data/README.md +2 -2
  6. data/app/assets/javascript/pageflow/progress_navigation_bar.js +7 -1
  7. data/app/assets/javascript/pageflow/progress_navigation_bar/widget.js +97 -43
  8. data/app/assets/stylesheets/pageflow/{progress_navigation_bar.css.scss → progress_navigation_bar.scss} +33 -195
  9. data/app/assets/stylesheets/pageflow/progress_navigation_bar/animations2.scss +82 -0
  10. data/app/assets/stylesheets/pageflow/progress_navigation_bar/cross_dependant_styles.scss +37 -0
  11. data/app/assets/stylesheets/pageflow/progress_navigation_bar/horizontal.scss +234 -0
  12. data/app/assets/stylesheets/pageflow/progress_navigation_bar/mixins.scss +54 -0
  13. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default.scss +273 -0
  14. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/buttons.scss +22 -0
  15. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/credits.scss +9 -0
  16. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/icons/icon_font.scss +206 -0
  17. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/icons/sprite.scss +152 -0
  18. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/menu_boxes.scss +42 -0
  19. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/share_box.scss +9 -0
  20. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/typography.scss +90 -0
  21. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/widget_margin.scss +23 -0
  22. data/app/assets/stylesheets/pageflow/progress_navigation_bar/vertical.scss +97 -0
  23. data/app/views/pageflow/progress_navigation_bar/_widget.html.erb +7 -3
  24. data/app/views/pageflow/progress_navigation_bar/widget/_bar_top.html.erb +6 -22
  25. data/app/views/pageflow/progress_navigation_bar/widget/_overview_button.html.erb +8 -0
  26. data/app/views/pageflow/progress_navigation_bar/widget/_page.html.erb +1 -2
  27. data/config/locales/de.yml +4 -1
  28. data/config/locales/en.yml +4 -1
  29. data/lib/pageflow-progress-navigation-bar.rb +9 -1
  30. data/lib/pageflow/progress_navigation_bar/horizontal_widget_type.rb +17 -0
  31. data/lib/pageflow/progress_navigation_bar/version.rb +1 -1
  32. data/lib/pageflow/progress_navigation_bar/vertical_widget_type.rb +17 -0
  33. data/lib/pageflow/progress_navigation_bar/widget_type.rb +5 -4
  34. data/pageflow-progress-navigation-bar.gemspec +2 -2
  35. metadata +26 -10
  36. data/app/assets/stylesheets/pageflow/cross_dependant_styles.css.scss +0 -35
  37. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default.css.scss +0 -345
@@ -0,0 +1,37 @@
1
+ // Make room for narrow progress navigation bar that is displayed
2
+ // during page transitions.
3
+
4
+ body .widget_progress_navigation_bar_present .navigation_mobile {
5
+ .menu.index {
6
+ right: 20px;
7
+ }
8
+
9
+ &.active .menu.index {
10
+ right: 200px;
11
+ }
12
+
13
+ .parent_page {
14
+ right: 70px;
15
+ }
16
+
17
+ &.active .parent_page {
18
+ right: 250px;
19
+ }
20
+ }
21
+
22
+ // Progress navigation bar is not compatible with touch interfaces.
23
+ // Use default mobile navigation instead. Since the mobile navigation
24
+ // comes with its own parent page widget, hide the parent page box
25
+ // which would otherwise also be displayed on iPad landscape.
26
+
27
+ body.has_mobile_platform .widget_progress_navigation_bar_present,
28
+ body.has_mobile_platform .widget_progress_navigation_bar_horizontal_present {
29
+ .navigation_mobile,
30
+ .navigation_mobile > * {
31
+ display: block;
32
+ }
33
+
34
+ .parent_page_box {
35
+ display: none;
36
+ }
37
+ }
@@ -0,0 +1,234 @@
1
+ $thumbnail-width: 125px;
2
+ $thumbnail-small-width: 50px;
3
+
4
+ .js.progress_navigation_bar.horizontal {
5
+ top: 0;
6
+ left: 0;
7
+ height: 30px;
8
+ width: 100%;
9
+
10
+ @include pageflow-progress-mobile-variant {
11
+ display: none;
12
+ }
13
+
14
+ &:before {
15
+ display: none;
16
+ }
17
+
18
+ &.hover, &:hover, &:focus, &.focus {
19
+ .navigation_button_area {
20
+ height: 100px;
21
+ }
22
+ }
23
+
24
+ .navigation_button_area {
25
+ width: 100%;
26
+ height: 0;
27
+ top: 29px;
28
+ left: 0;
29
+ border: 0;
30
+ border-top: 1px solid transparent;
31
+
32
+ @include pageflow-progress-navigation-bar-small-width {
33
+ height: $thumbnail-small-width;
34
+ }
35
+
36
+ .navigation_bar_buttons {
37
+ height: 100%;
38
+ width: 100%;
39
+ text-align: center;
40
+ white-space: nowrap;
41
+
42
+ &:after {
43
+ background: none;
44
+ opacity: 0;
45
+ }
46
+
47
+ .navigation_credits_box {
48
+ p {
49
+ display: none;
50
+ }
51
+ }
52
+
53
+ .navigation_share_box {
54
+ right: -62.5px;
55
+ }
56
+
57
+ .navigation_credits_box {
58
+ right: 0;
59
+ }
60
+
61
+ .navigation_share_box, .navigation_credits_box {
62
+ top: 100px;
63
+
64
+ @include pageflow-progress-navigation-bar-small-width {
65
+ top: 70px;
66
+ }
67
+ }
68
+
69
+ li.menu_li {
70
+ display: none;
71
+ }
72
+
73
+ li.navigation_menu.mute {
74
+ height: 100%;
75
+
76
+ @include pageflow-progress-navigation-bar-small-width {
77
+ width: $thumbnail-width;
78
+ }
79
+
80
+ .navigation_volume_box {
81
+ position: absolute;
82
+ width: 100%;
83
+
84
+ .volume-control {
85
+ text-align: center;
86
+ display: inline-block;
87
+ margin: 30px 0 0 0;
88
+
89
+ .volume-slider {
90
+ display: inline-block;
91
+ position: relative;
92
+ left: -2px;
93
+ top: 0;
94
+ width: 78px;
95
+ height: 4px;
96
+ background-color: gray;
97
+ }
98
+
99
+ .volume-level {
100
+ height: 100%;
101
+ max-width: 62px;
102
+
103
+ &:before {
104
+ display: block;
105
+ content: "";
106
+ background-position: -66px top;
107
+ top: -9px;
108
+ width: 18px;
109
+ height: 16px;
110
+ right: -18px;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ li {
118
+ display: inline-block;
119
+ height: 100%;
120
+ width: $thumbnail-width;
121
+ border: 0;
122
+
123
+ @include pageflow-progress-navigation-bar-small-width {
124
+ width: $thumbnail-small-width;
125
+ }
126
+
127
+ .button {
128
+ top: 20%;
129
+ left: 0;
130
+ padding: 0;
131
+ margin: 0 auto;
132
+ position: relative;
133
+ }
134
+
135
+ .navi_hint {
136
+ top: 70px;
137
+ left: 0;
138
+ padding: 0;
139
+ margin: 0;
140
+ width: 100%;
141
+ position: absolute;
142
+ @include pageflow-progress-navigation-bar-small-width {
143
+ display: none;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ &.header_active .navigation_button_area {
151
+ opacity: 0;
152
+ }
153
+
154
+ .scroller {
155
+ top: 0;
156
+ left: 0;
157
+ width: 100%;
158
+ height: 100%;
159
+
160
+ &:after {
161
+ background-color: transparent;
162
+ opacity: 0.9;
163
+ }
164
+
165
+ li {
166
+ &.animate_in {
167
+ &.moving_forwards {
168
+ @include animation(pageflow-progress-navigation-bar-slide-in-from-bottom2 0.4s ease-out);
169
+ }
170
+
171
+ &.moving_backwards {
172
+ @include animation(pageflow-progress-navigation-bar-slide-in-from-top2 0.4s ease-out);
173
+ }
174
+
175
+ &.moving_down {
176
+ @include animation(pageflow-progress-navigation-bar-slide-in-from-right2 0.4s ease-out);
177
+ }
178
+
179
+ &.moving_up {
180
+ @include animation(pageflow-progress-navigation-bar-slide-in-from-left2 0.4s ease-out);
181
+ }
182
+ }
183
+
184
+ &.animate_out {
185
+ &.moving_forwards {
186
+ @include animation(pageflow-progress-navigation-bar-slide-out-to-top2 0.4s ease-in);
187
+ opacity: 0;
188
+ }
189
+
190
+ &.moving_backwards {
191
+ @include animation(pageflow-progress-navigation-bar-slide-out-to-bottom2 0.4s ease-in);
192
+ opacity: 0;
193
+ }
194
+
195
+ &.moving_down {
196
+ @include animation(pageflow-progress-navigation-bar-slide-out-to-left2 0.4s ease-in);
197
+ @include transform(translate3d(0, -50px, 0));
198
+ }
199
+
200
+ &.moving_up {
201
+ @include animation(pageflow-progress-navigation-bar-slide-out-to-right2 0.4s ease-in);
202
+ @include transform(translate3d(0, 50px, 0));
203
+ }
204
+ }
205
+ }
206
+ }
207
+
208
+ .navigation_dots {
209
+ width: 100%;
210
+ height: 100%;
211
+ left: 0;
212
+ margin: 6px 0 0 0;
213
+ text-align: center;
214
+ white-space: nowrap;
215
+
216
+ li {
217
+ width: 20px;
218
+ height: 18px;
219
+ margin-right: 1px;
220
+ display: inline-block;
221
+ @include box-sizing(border-box);
222
+
223
+ &:last-child {
224
+ margin-right: 0;
225
+ }
226
+ }
227
+ }
228
+
229
+ .navigation_site_detail {
230
+ width: 170px;
231
+ top: 30px;
232
+ right: 0;
233
+ }
234
+ }
@@ -0,0 +1,54 @@
1
+ @mixin pageflow-progress-navigation-bar-small-height {
2
+ @media screen and (max-height: 870px) {
3
+ @content;
4
+ }
5
+ }
6
+
7
+ @mixin pageflow-progress-navigation-bar-small-width {
8
+ @media screen and (max-width: 1070px) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin pageflow-progress-mobile-variant {
14
+ .has_mobile_platform & {
15
+ @content;
16
+ }
17
+
18
+ @include phone {
19
+ @content;
20
+ }
21
+
22
+ @include pad_portrait {
23
+ @content;
24
+ }
25
+ }
26
+
27
+ @mixin pageflow-progress-navigation-bar-transparent-background {
28
+ &:after {
29
+ height: 100%;
30
+ background-image: none;
31
+ width: 100%;
32
+ top: 0;
33
+ position: absolute;
34
+ z-index: -1;
35
+ content: "";
36
+ }
37
+ }
38
+
39
+ @mixin pageflow-progress-navigation-bar-box($margin-top, $right) {
40
+ visibility: hidden;
41
+ margin-top: $margin-top;
42
+ background-color: $bg-color;
43
+ border: 2px solid $nav-color;
44
+ position: absolute;
45
+ right: $right;
46
+ padding: 15px;
47
+ height: auto;
48
+ left: initial;
49
+
50
+ hr {
51
+ border: 0;
52
+ border-bottom: 1px solid $nav-color;
53
+ }
54
+ }
@@ -0,0 +1,273 @@
1
+ /// Type of icons to use:
2
+ ///
3
+ /// - `"icon-font"`: Circular buttons with font awesome icons.
4
+ ///
5
+ /// - `"sprite"`: Custom icons from `icon_sprite.png` in theme
6
+ /// directory.
7
+ $progress-navigation-bar-icons: $widget-icons !default;
8
+
9
+ /// Display button to toggle header
10
+ $progress-navigation-bar-display-header-button: $navigation-display-header-button !default;
11
+
12
+ /// Display social share menu
13
+ $progress-navigation-bar-display-share-button: $navigation-display-share-button !default;
14
+
15
+ /// Display hide text menu button
16
+ $progress-navigation-bar-display-hide-text-button: $navigation-display-hide-text-button !default;
17
+
18
+ // Legacy
19
+
20
+ $nav-color: $main-color;
21
+
22
+ $nav-active-chapter: desaturate($main-color, 50%);
23
+ $nav-active-page: $main-color;
24
+
25
+ $nav-active-chapter-beginning: desaturate($main-color, 40%);
26
+
27
+ $nav-hint-color: #A9A9A9 !default;
28
+
29
+ $nav-chapter-beginning: #afafaf;
30
+ $nav-dot-even: #9B9B9B;
31
+ $nav-dot-odd: #afafaf;
32
+
33
+ $nav-bg-color: $basic-background-color;
34
+ $bg-color: $nav-bg-color;
35
+ $nav-bg-color-transparent: $basic-background-color-transparent;
36
+
37
+ @import "../mixins";
38
+ @import "./default/widget_margin";
39
+
40
+ .progress_navigation_bar {
41
+ @import "./default/buttons";
42
+ @import "./default/credits";
43
+ @import "./default/icons/icon_font";
44
+ @import "./default/icons/sprite";
45
+ @import "./default/menu_boxes";
46
+ @import "./default/share_box";
47
+ @import "./default/typography";
48
+
49
+ @if $progress-navigation-bar-icons == "sprite" {
50
+ @include progress-navigation-bar-icons-sprite;
51
+ } @else {
52
+ @include progress-navigation-bar-icons-icon-font;
53
+ }
54
+
55
+ .navigation_site_detail .thumbnail {
56
+ @if $progress-navigation-bar-pictogram-visibility == visible {
57
+ @extend %pageflow_page_type_thumbnail;
58
+ }
59
+
60
+ position: relative;
61
+ width: 170px;
62
+ height: 95px;
63
+ margin-top: 12px;
64
+
65
+ &:after {
66
+ content: "";
67
+ position: absolute;
68
+ top: 28px;
69
+ left: 66px;
70
+ width: 38px;
71
+ height: 38px;
72
+ background-size: 76px 38px;
73
+ background-repeat: no-repeat;
74
+ }
75
+ }
76
+
77
+ @if $progress-navigation-bar-display-header-button {
78
+ &.horizontal .scroller .navigation_dots {
79
+ width: calc(100% - 40px);
80
+ }
81
+
82
+ .header_button {
83
+ display: block;
84
+ position: absolute;
85
+ right: 7px;
86
+ top: 2px;
87
+ width: 26px;
88
+ height: 26px;
89
+
90
+ a {
91
+ display: block;
92
+ text-decoration: none;
93
+ padding: 0;
94
+
95
+ .button {
96
+ width: 28px;
97
+ height: 28px;
98
+ background-image: image-url("pageflow/progress_navigation_bar/indicator.png");
99
+ background-position: 0 0;
100
+ }
101
+
102
+ .button.close {
103
+ background-position: -28px 0;
104
+ }
105
+ }
106
+ }
107
+
108
+ .navigation_button_area .navigation_bar_buttons li {
109
+ height: 11.11%;
110
+
111
+ &.mute {
112
+ height: 22.22%;
113
+ }
114
+ }
115
+
116
+ &.with_home_button {
117
+ .navigation_button_area .navigation_bar_buttons li {
118
+ height: 10%;
119
+
120
+ &.mute {
121
+ height: 20%;
122
+ }
123
+ }
124
+ }
125
+ } @else {
126
+ .navigation_button_area .navigation_bar_buttons li {
127
+ height: 12.25%;
128
+
129
+ &.menu_li {
130
+ display: none;
131
+ }
132
+
133
+ &.mute {
134
+ height: 25%;
135
+ }
136
+ }
137
+
138
+ &.with_home_button {
139
+ .navigation_button_area .navigation_bar_buttons li {
140
+ height: 11.11%;
141
+
142
+ &.mute {
143
+ height: 22.22%;
144
+ }
145
+ }
146
+ }
147
+ }
148
+
149
+ @if not $progress-navigation-bar-display-share-button {
150
+ .navigation_menu.share {
151
+ display: none;
152
+ }
153
+ }
154
+
155
+ @if not $progress-navigation-bar-display-hide-text-button {
156
+ .hide_text {
157
+ display: none;
158
+ }
159
+ }
160
+
161
+ &.horizontal.js {
162
+ background-color: $nav-bg-color-transparent;
163
+
164
+ .navigation_button_area .navigation_bar_buttons {
165
+ background: $nav-bg-color-transparent;
166
+
167
+ @if not $progress-navigation-bar-display-share-button {
168
+ .navigation_menu.share {
169
+ display: none;
170
+ }
171
+ }
172
+
173
+ @if not $progress-navigation-bar-display-hide-text-button {
174
+ .hide_text {
175
+ display: none;
176
+ }
177
+ }
178
+ }
179
+ }
180
+
181
+ .navigation_button_area .navigation_bar_buttons {
182
+ &:after {
183
+ background-color: $nav-bg-color-transparent;
184
+ }
185
+
186
+ &.js .navigation_bar_bottom li.fullscreen {
187
+ height: auto;
188
+ }
189
+
190
+ &.js a.scroll_indicator {
191
+ background-image: image-url('pageflow/themes/default/scroll_indicator_sprite.png');
192
+ }
193
+
194
+ .navigation_share_box {
195
+ a {
196
+ text-align: center;
197
+ }
198
+
199
+ a.active,
200
+ a:hover {
201
+ p {
202
+ color: $nav-color;
203
+ }
204
+
205
+ .share_google, .share_facebook, .share_twitter {
206
+ &:before {
207
+ color: $nav-color;
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
213
+
214
+ &.js .scroller:after {
215
+ background-color: $nav-bg-color-transparent;
216
+ }
217
+
218
+ .scroller ul, &.js .scroller ul {
219
+ a {
220
+ position: absolute;
221
+ top: 0;
222
+ left: 0;
223
+ height: 100%;
224
+ width: 100%;
225
+ background-color: $nav-dot-even;
226
+ border-bottom: 1px solid $nav-bg-color-transparent;
227
+ @include box-sizing(border-box);
228
+
229
+ &.in_active_chapter {
230
+ background-color: $nav-active-chapter;
231
+ }
232
+
233
+ &.active {
234
+ cursor: default;
235
+ background-color: $nav-active-page;
236
+
237
+ img {
238
+ border-left: 5px solid $nav-active-page;
239
+ }
240
+ }
241
+ }
242
+
243
+ li.chapter_beginning a {
244
+ background-color: $nav-chapter-beginning;
245
+
246
+ &.in_active_chapter {
247
+ background-color: $nav-active-chapter-beginning;
248
+ }
249
+
250
+ &.active {
251
+ background-color: $main-color;
252
+ }
253
+ }
254
+
255
+ img {
256
+ display: block;
257
+ }
258
+
259
+ &.no_chapters {
260
+ li.chapter_beginning a, li a.in_active_chapter, li.chapter_beginning a.in_active_chapter {
261
+ background-color: $nav-dot-even;
262
+
263
+ &.active {
264
+ background-color: $nav-active-page;
265
+ }
266
+ }
267
+ }
268
+ }
269
+
270
+ &.js .volume-control .volume-level {
271
+ background-color: $nav-color;
272
+ }
273
+ }