-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.hbs
155 lines (128 loc) · 5.5 KB
/
index.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{{!< default}}
{{!-- The tag above means: insert everything in this file
into the {body} of the default.hbs template --}}
<header class="site-header outer border-primary-top">
<div class="inner-header">
<nav class="site-nav">
<div class="site-nav-left">
<a class="site-nav-logo" href="{{@site.url}}" aria-label="{{@site.title}}">
<img src="{{@site.logo}}">
</a>
</div>
<div class="inner-header">
<div class="category-holder">
<ul class="nav category-nav pull-left">
<li class="nav-tag"><a href="/tag/exclusives/" title="Exclusive">Exclusive</a></li>
<li class="nav-tag"><a href="/tag/news/" title="News">News</a></li>
<li class="nav-tag"><a href="/tag/devices/" title="Devices">Devices</a></li>
<li class="nav-tag"><a href="/tag/how-to/" title="How-To">How-To</a></li>
<li class="nav-tag"><a href="/tag/technology/" title="Technology">Technology</a></li>
<li class="nav-tag"><a href="/tag/apps/" title="Apps & Software">Apps & Software</a></li>
<li>
<a href="/categories">
<span style="margin-left:0.5rem;">More...</span>
</a>
</li>
</ul>
<a class="search-btn no-decoration pull-right" href="#searchinghost-easy">
<span style="color: white;">
<i class="fas fa-search fa-lg"></i>
</span>
</a>
<a class="category-search no-decoration category-xs" href="/categories">
<span style="margin-right:1.5rem;"><i class="fas fa-bars fa-2x"></i></span>
</a>
</div>
</div>
</nav>
</div>
</header>
{{!-- The main content area
<!-- Embla -->
{{> slider}}
--}}
{{!--
<div class="outer-search category-container">
<div class="inner-header">
<div class="category-holder">
<ul class="nav category-nav pull-left">
<li class="nav-tag"><a href="/tag/exlusive/" title="Exclusive">Exclusive</a></li>
<li class="nav-tag"><a href="/tag/news/" title="News">News</a></li>
<li class="nav-tag"><a href="/tag/devices/" title="Devices">Devices</a></li>
<li class="nav-tag"><a href="/tag/how-to/" title="How-To">How-To</a></li>
<li class="nav-tag"><a href="/tag/technology/" title="Technology">Technology</a></li>
<li class="nav-tag"><a href="/tag/apps/" title="Apps & Software">Apps & Software</a></li>
<li>
<a href="/categories">
<span style="margin-left:0.5rem;">More...</span>
</a>
</li>
</ul>
<a class="search-btn no-decoration pull-right" href="#ghosteasybar">
<span style="color: white;">
<i class="fas fa-search"></i>
</span>
</a>
<a class="category-search no-decoration category-xs" href="/categories">
<span style="margin-left:0.5rem;"><i class="fas fa-bars"></i> Categories</span>
</a>
</div>
</div>
</div>
--}}
<div class="inner posts">
<div class="post-feed">
{{#foreach posts}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
</div>
</main>
{{> site-header}}
{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
{{#contentFor "scripts"}}
<script>
// NOTE: Scroll performance is poor in Safari
// - this appears to be due to the events firing much more slowly in Safari.
// Dropping the scroll event and using only a raf loop results in smoother
// scrolling but continuous processing even when not scrolling
$(document).ready(function () {
var nav = document.querySelector('.site-nav-main .site-nav');
var feed = document.querySelector('.post-feed');
var lastScrollY = window.scrollY;
var lastWindowHeight = window.innerHeight;
var lastDocumentHeight = $(document).height();
var ticking = false;
function onScroll() {
lastScrollY = window.scrollY;
requestTick();
}
function onResize() {
lastWindowHeight = window.innerHeight;
lastDocumentHeight = $(document).height();
requestTick();
}
function requestTick() {
if (!ticking) {
requestAnimationFrame(update);
}
ticking = true;
}
function update() {
var trigger = feed.getBoundingClientRect().top + window.scrollY;
var progressMax = lastDocumentHeight - lastWindowHeight;
// show/hide nav
if (lastScrollY >= trigger - 20) {
nav.classList.add('fixed-nav-active');
} else {
nav.classList.remove('fixed-nav-active');
}
ticking = false;
}
window.addEventListener('scroll', onScroll, { passive: true });
window.addEventListener('resize', onResize, false);
update();
});
</script>
{{/contentFor}}