soames-gatsby-theme 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/README.md +24 -0
- package/dist/gatsby-config.js +47 -0
- package/dist/gatsby-node.js +7 -0
- package/dist/src/components/Bio.js +23 -0
- package/dist/src/components/BlogSidebar.js +30 -0
- package/dist/src/components/Footer.js +11 -0
- package/dist/src/components/FooterMenu.js +26 -0
- package/dist/src/components/Header.js +12 -0
- package/dist/src/components/HeaderMenu.js +34 -0
- package/dist/src/components/HeroHeader.js +39 -0
- package/dist/src/components/Layout.js +24 -0
- package/dist/src/components/Logo.js +17 -0
- package/dist/src/components/Seo.js +59 -0
- package/dist/src/components/shortcodes/RemoveContentAreaPadding.js +12 -0
- package/dist/src/components/shortcodes/SoamesFeature.js +9 -0
- package/dist/src/components/shortcodes/SoamesGalleryMenu.js +15 -0
- package/dist/src/components/shortcodes/SoamesIconList.js +15 -0
- package/dist/src/components/shortcodes/SoamesSoundCloud.js +18 -0
- package/dist/src/components/shortcodes/SoamesTextBlock.js +8 -0
- package/dist/src/components/shortcodes/SoamesTextList.js +8 -0
- package/dist/src/components/shortcodes/SoamesTitle.js +7 -0
- package/dist/src/components/shortcodes/SoamesTitleBar.js +7 -0
- package/dist/src/components/shortcodes/SoamesTitleBarLg.js +25 -0
- package/dist/src/components/shortcodes/SoamesVideo.js +8 -0
- package/dist/src/pages/index.js +9 -0
- package/dist/src/templates/blog-post-archive.js +59 -0
- package/dist/src/templates/blog-post.js +67 -0
- package/dist/src/templates/page.js +33 -0
- package/dist/src/utils/shortcodes/Shortcodes.js +105 -0
- package/dist/src/utils/shortcodes/getAttributes.js +18 -0
- package/dist/src/utils/shortcodes/getContent.js +7 -0
- package/gatsby-browser.js +11 -0
- package/gatsby-node.js +138 -0
- package/gatsby-ssr.js +12 -0
- package/package.json +76 -0
- package/src/components/Bio.tsx +63 -0
- package/src/components/BlogSidebar.tsx +86 -0
- package/src/components/Footer.tsx +53 -0
- package/src/components/FooterMenu.tsx +66 -0
- package/src/components/Header.tsx +37 -0
- package/src/components/HeaderMenu.tsx +123 -0
- package/src/components/HeroHeader.tsx +75 -0
- package/src/components/Layout.tsx +60 -0
- package/src/components/Logo.tsx +49 -0
- package/src/components/Seo.tsx +84 -0
- package/src/components/shortcodes/RemoveContentAreaPadding.tsx +13 -0
- package/src/components/shortcodes/SoamesFeature.tsx +54 -0
- package/src/components/shortcodes/SoamesGalleryMenu.tsx +63 -0
- package/src/components/shortcodes/SoamesIconList.tsx +57 -0
- package/src/components/shortcodes/SoamesSoundCloud.tsx +71 -0
- package/src/components/shortcodes/SoamesTextBlock.tsx +27 -0
- package/src/components/shortcodes/SoamesTextList.tsx +27 -0
- package/src/components/shortcodes/SoamesTitle.tsx +23 -0
- package/src/components/shortcodes/SoamesTitleBar.tsx +21 -0
- package/src/components/shortcodes/SoamesTitleBarLg.tsx +56 -0
- package/src/components/shortcodes/SoamesVideo.tsx +34 -0
- package/src/styles/soames/base.css +592 -0
- package/src/styles/soames/components.css +1551 -0
- package/src/styles/soames/layout.css +209 -0
- package/src/styles/soames/overrides.css +1779 -0
- package/src/styles/soames/typography.css +23 -0
- package/src/styles/theme.css +8 -0
- package/src/styles/vendor/normalize.css +343 -0
- package/src/styles/vendor/wordpress-blocks.css +3451 -0
- package/src/templates/blog-post-archive.tsx +167 -0
- package/src/templates/blog-post.tsx +183 -0
- package/src/templates/page.tsx +65 -0
- package/src/utils/shortcodes/Shortcodes.tsx +119 -0
- package/src/utils/shortcodes/getAttributes.ts +19 -0
- package/src/utils/shortcodes/getContent.ts +5 -0
- package/static/js/soames-nav-dropdown.js +646 -0
- package/static/js/soames-navbar-dropdown.js +127 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const jQuery = require("jquery");
|
|
2
|
+
|
|
3
|
+
jQuery(function($){
|
|
4
|
+
|
|
5
|
+
var DATA_KEY = 'bs.navbar-dropdown';
|
|
6
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
|
7
|
+
var DATA_API_KEY = '.data-api';
|
|
8
|
+
|
|
9
|
+
var Event = {
|
|
10
|
+
COLLAPSE: 'collapse' + EVENT_KEY,
|
|
11
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
|
12
|
+
SCROLL_DATA_API: 'scroll' + EVENT_KEY + DATA_API_KEY,
|
|
13
|
+
RESIZE_DATA_API: 'resize' + EVENT_KEY + DATA_API_KEY,
|
|
14
|
+
COLLAPSE_SHOW: 'show.bs.collapse',
|
|
15
|
+
COLLAPSE_HIDE: 'hide.bs.collapse',
|
|
16
|
+
DROPDOWN_COLLAPSE: 'collapse.bs.nav-dropdown'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var ClassName = {
|
|
20
|
+
IN: 'in',
|
|
21
|
+
OPENED: 'opened',
|
|
22
|
+
BG_COLOR: 'bg-color',
|
|
23
|
+
DROPDOWN_OPEN: 'navbar-dropdown-open',
|
|
24
|
+
SHORT: 'navbar-short'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var Selector = {
|
|
28
|
+
BODY: 'body',
|
|
29
|
+
BASE: '.navbar-dropdown',
|
|
30
|
+
TOGGLER: '.navbar-toggler[aria-expanded="true"]',
|
|
31
|
+
TRANSPARENT: '.transparent',
|
|
32
|
+
FIXED_TOP: '.navbar-fixed-top'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function _dataApiHandler(event) {
|
|
36
|
+
|
|
37
|
+
if (event.type === 'resize') {
|
|
38
|
+
|
|
39
|
+
$(Selector.BODY).removeClass(ClassName.DROPDOWN_OPEN);
|
|
40
|
+
$(Selector.BASE).find(".navbar-collapse").removeClass("show");
|
|
41
|
+
$(Selector.BASE)
|
|
42
|
+
.removeClass(ClassName.OPENED)
|
|
43
|
+
.find(Selector.TOGGLER).each(function(){
|
|
44
|
+
|
|
45
|
+
$( $(this).attr('data-target') )
|
|
46
|
+
.removeClass(ClassName.IN)
|
|
47
|
+
.add(this)
|
|
48
|
+
.attr('aria-expanded', 'false');
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var scrollTop = $(this).scrollTop();
|
|
55
|
+
$(Selector.BASE).each(function(){
|
|
56
|
+
|
|
57
|
+
if (!$(this).is(Selector.FIXED_TOP)) return;
|
|
58
|
+
|
|
59
|
+
if ($(this).is(Selector.TRANSPARENT) && !$(this).hasClass(ClassName.OPENED)) {
|
|
60
|
+
|
|
61
|
+
if (scrollTop > 0) {
|
|
62
|
+
$(this).removeClass(ClassName.BG_COLOR);
|
|
63
|
+
} else {
|
|
64
|
+
$(this).addClass(ClassName.BG_COLOR);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (scrollTop > 0) {
|
|
70
|
+
$(this).addClass(ClassName.SHORT);
|
|
71
|
+
} else {
|
|
72
|
+
$(this).removeClass(ClassName.SHORT);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var _timeout;
|
|
80
|
+
$(window)
|
|
81
|
+
.on(Event.SCROLL_DATA_API + ' ' + Event.RESIZE_DATA_API, function(event){
|
|
82
|
+
clearTimeout(_timeout);
|
|
83
|
+
_timeout = setTimeout(function(){
|
|
84
|
+
_dataApiHandler(event);
|
|
85
|
+
}, 10);
|
|
86
|
+
})
|
|
87
|
+
.trigger(Event.SCROLL_DATA_API);
|
|
88
|
+
|
|
89
|
+
$(document)
|
|
90
|
+
.on(Event.CLICK_DATA_API, Selector.BASE, function(event){
|
|
91
|
+
event.targetWrapper = this;
|
|
92
|
+
})
|
|
93
|
+
.on(Event.COLLAPSE_SHOW + ' ' + Event.COLLAPSE_HIDE, function(event){
|
|
94
|
+
|
|
95
|
+
$(event.target).closest(Selector.BASE).each(function(){
|
|
96
|
+
|
|
97
|
+
if (event.type === 'show') {
|
|
98
|
+
|
|
99
|
+
$(Selector.BODY).addClass(ClassName.DROPDOWN_OPEN);
|
|
100
|
+
|
|
101
|
+
$(this).addClass(ClassName.OPENED);
|
|
102
|
+
|
|
103
|
+
} else {
|
|
104
|
+
|
|
105
|
+
$(Selector.BODY).removeClass(ClassName.DROPDOWN_OPEN);
|
|
106
|
+
|
|
107
|
+
$(this).removeClass(ClassName.OPENED);
|
|
108
|
+
|
|
109
|
+
$(window).trigger(Event.SCROLL_DATA_API);
|
|
110
|
+
|
|
111
|
+
$(this).trigger(Event.COLLAPSE);
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
})
|
|
118
|
+
.on(Event.DROPDOWN_COLLAPSE, function(event){
|
|
119
|
+
|
|
120
|
+
$(event.relatedTarget)
|
|
121
|
+
.closest(Selector.BASE)
|
|
122
|
+
.find(Selector.TOGGLER)
|
|
123
|
+
.trigger('click');
|
|
124
|
+
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
});
|