Skip to content

Commit edfcd7a

Browse files
committed
Added scroll button behavior to red_white theme
1 parent b0791b1 commit edfcd7a

File tree

4 files changed

+44
-102
lines changed

4 files changed

+44
-102
lines changed

web/themes/custom/fds_redwhite_theme/dist/javascripts/app.js

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/fds_redwhite_theme/dist/stylesheets/stylesheet.css

Lines changed: 4 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/fds_redwhite_theme/src/javascripts/app.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@ document.addEventListener('DOMContentLoaded', function() {
8383
}
8484
});
8585

86+
// Cover arrow adjustments.
87+
document.addEventListener('DOMContentLoaded', function() {
88+
var coverArrow = document.querySelector('.rk_cover_arrow_button_wrapper');
89+
90+
if (coverArrow) {
91+
coverArrow.parentNode.setAttribute('style', 'position: relative;');
92+
coverArrow.addEventListener('click', scroll);
93+
}
94+
95+
function scroll(event) {
96+
var scroll_to = jQuery(event.target)
97+
98+
jQuery([document.documentElement, document.body]).animate({
99+
scrollTop: scroll_to.offset().top - 200
100+
}, 1000);
101+
}
102+
});
103+
86104
// Open all file-links in a new window.
87105
(function() {
88106
var links = document.querySelectorAll('.field--type-file .file a');

web/themes/custom/fds_redwhite_theme/src/styles/theme/components/_custom-header.scss

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -89,39 +89,13 @@
8989
background: linear-gradient(90deg, rgba(0,102,50,1) 0%, rgba(0,102,50,0.75) 50%, rgba(0,102,50,0) 100%);
9090
}
9191

92-
.path-frontpage {
93-
94-
&, &.toolbar-fixed {
95-
padding-top: 0 !important;
96-
97-
&:not(.gin--vertical-toolbar) {
98-
99-
&.toolbar-horizontal {
100-
padding-top: 39px !important;
101-
102-
&.toolbar-tray-open {
103-
padding-top: 79px !important;
104-
}
105-
}
106-
}
107-
}
108-
}
109-
11092
body {
111-
11293
&, &.toolbar-fixed {
11394
padding-top: 74px !important;
95+
}
11496

115-
&:not(.gin--vertical-toolbar) {
116-
117-
&.toolbar-horizontal {
118-
padding-top: 74px + 39px !important;
119-
120-
&.toolbar-tray-open {
121-
padding-top: 74px + 79px !important;
122-
}
123-
}
124-
}
97+
&.toolbar-tray-open {
98+
padding-top: 79px !important;
12599
}
126100
}
127101

@@ -158,28 +132,6 @@ body {
158132
}
159133
}
160134

161-
.custom-header--fixed {
162-
position: fixed;
163-
164-
top: 0;
165-
left: 0;
166-
right: 0;
167-
168-
z-index: 300;
169-
170-
.toolbar-horizontal:not(.gin--vertical-toolbar) {
171-
top: 39px;
172-
}
173-
174-
.toolbar-horizontal.toolbar-tray-open:not(.gin--vertical-toolbar) & {
175-
top: 79px; // Height of toolbar tray.
176-
}
177-
178-
.path-frontpage & {
179-
display: none;
180-
}
181-
}
182-
183135
.custom-header__button {
184136
padding: 10px; // For fat thumbs.
185137

@@ -462,25 +414,6 @@ body {
462414

463415
// Desktop - and up
464416
@include media-breakpoint-up(md) {
465-
466-
body {
467-
468-
&, &.toolbar-fixed {
469-
padding-top: 132px !important; // Height of .custom-header--fixed (recalculated by JS)
470-
471-
&:not(.gin--vertical-toolbar) {
472-
473-
&.toolbar-horizontal {
474-
padding-top: 132px + 39px !important;
475-
476-
&.toolbar-tray-open {
477-
padding-top: 132px + 79px !important;
478-
}
479-
}
480-
}
481-
}
482-
}
483-
484417
.custom-header {
485418

486419
.views-exposed-form {

0 commit comments

Comments
 (0)