@awesomeness-js/server 1.0.2 → 1.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/README.md +61 -0
- package/build/build.js +7 -0
- package/build/postBuild.js +7 -0
- package/example-.awesomeness/componentLocations.js +15 -0
- package/example-.awesomeness/config.js +5 -21
- package/example-site/example.awesomenessjs.com/api/readme.md +1 -0
- package/example-site/example.awesomenessjs.com/components/example/index.js +3 -0
- package/example-site/example.awesomenessjs.com/components/notCommonExample/_.css +1 -0
- package/example-site/example.awesomenessjs.com/components/notCommonExample/index.js +3 -0
- package/example-site/example.awesomenessjs.com/pages/_md/_info.js +15 -0
- package/example-site/example.awesomenessjs.com/pages/_md/css/example.css +4 -0
- package/example-site/example.awesomenessjs.com/pages/_md/drafts/example.md +32 -0
- package/example-site/example.awesomenessjs.com/pages/_md/getBlogData.js +117 -0
- package/example-site/example.awesomenessjs.com/pages/_md/getData.js +36 -0
- package/example-site/example.awesomenessjs.com/pages/_md/js/callToAction.js +43 -0
- package/example-site/example.awesomenessjs.com/pages/_md/js/init.js +88 -0
- package/example-site/example.awesomenessjs.com/pages/_md/meta.template.md +33 -0
- package/example-site/example.awesomenessjs.com/pages/_md/pages/mission.md +345 -0
- package/example-site/example.awesomenessjs.com/pages/_template/_info.js +9 -0
- package/example-site/example.awesomenessjs.com/pages/_template/css/_.css +4 -0
- package/example-site/example.awesomenessjs.com/pages/_template/getData.js +6 -0
- package/example-site/example.awesomenessjs.com/pages/_template/js/init.js +3 -0
- package/example-site/example.awesomenessjs.com/pages/blog/_info.js +14 -0
- package/example-site/example.awesomenessjs.com/pages/blog/css/topics.css +17 -0
- package/example-site/example.awesomenessjs.com/pages/blog/getData.js +22 -0
- package/example-site/example.awesomenessjs.com/pages/blog/js/colors.js +159 -0
- package/example-site/example.awesomenessjs.com/pages/blog/js/init.js +242 -0
- package/example-site/example.awesomenessjs.com/pages/blog/js/tag.js +111 -0
- package/example-site/example.awesomenessjs.com/pages/examples/_info.js +9 -0
- package/example-site/example.awesomenessjs.com/pages/examples/css/footer.css +6 -0
- package/example-site/example.awesomenessjs.com/pages/examples/css/intro.css +67 -0
- package/example-site/example.awesomenessjs.com/pages/examples/css/nav.css +221 -0
- package/example-site/example.awesomenessjs.com/pages/examples/getData.js +8 -0
- package/example-site/example.awesomenessjs.com/pages/examples/js/init.js +15 -0
- package/example-site/example.awesomenessjs.com/pages/examples/js/updateState.js +14 -0
- package/example-site/example.awesomenessjs.com/pages/start/_info.js +11 -0
- package/example-site/example.awesomenessjs.com/pages/start/css/footer.css +6 -0
- package/example-site/example.awesomenessjs.com/pages/start/css/intro.css +67 -0
- package/example-site/example.awesomenessjs.com/pages/start/css/nav.css +221 -0
- package/example-site/example.awesomenessjs.com/pages/start/getData.js +8 -0
- package/example-site/example.awesomenessjs.com/pages/start/js/init.js +30 -0
- package/example-site/example.awesomenessjs.com/pages/start/js/updateState.js +14 -0
- package/example-site/example.awesomenessjs.com/public/images/awesomeness.webp +0 -0
- package/example-site/example.awesomenessjs.com/public/manifest.webmanifest.json +8 -0
- package/example-site/example.awesomenessjs.com/specialRoutes.js +14 -0
- package/index.js +105 -25
- package/package.json +5 -2
- package/{server → src}/applicationMap.js +1 -1
- package/{server → src}/awesomenessNormalizeRequest.js +24 -3
- package/{server → src}/componentDependencies.js +11 -5
- package/{config.js → src/config.js} +6 -1
- package/{server → src}/fetchPage.js +6 -6
- package/src/getConfig.js +3 -0
- package/src/init.js +3 -0
- package/{server → src}/koa/attachAwesomenessRequest.js +5 -6
- package/{server → src}/koa/cors.js +2 -4
- package/{server → src}/koa/errorHandler.js +3 -3
- package/{server → src}/koa/finalFormat.js +2 -5
- package/{server → src}/koa/jsonBodyParser.js +3 -3
- package/src/koa/routeRequest.js +334 -0
- package/{server → src}/koa/serverUp.js +2 -4
- package/{server → src}/koa/staticFiles.js +10 -11
- package/{server → src}/koa/timeout.js +3 -3
- package/{server → src}/pageInfo.js +6 -6
- package/{server → src}/reRoute.js +3 -2
- package/{server → src}/resolveRealCasePath.js +1 -1
- package/{start.js → src/start.js} +14 -13
- package/{server → src}/validateRequest.js +1 -1
- package/{server → src}/ws/handlers.js +4 -2
- package/{server → src}/ws/index.js +2 -2
- package/ui/README.md +438 -0
- package/ui/awesomeness-ui.instructions.md +156 -0
- package/ui/build.js +119 -0
- package/ui/commonComponent.test.js +27 -0
- package/ui/components/blogPost/all.css +371 -0
- package/ui/components/blogPost/headerImage.js +153 -0
- package/ui/components/blogPost/index.js +45 -0
- package/ui/components/blogPost/marked.js +74 -0
- package/ui/components/blogPost/md.js +73 -0
- package/ui/components/blogPost/parseAwesomeness.jQuery.js +47 -0
- package/ui/components/blogPost/readme.md +8 -0
- package/ui/components/colors/README.md +65 -0
- package/ui/components/colors/dynamic.css +1884 -0
- package/ui/components/colors/dynamic.css.js +135 -0
- package/ui/components/colors/dynamic.css.php +79 -0
- package/ui/components/colors/example.js +133 -0
- package/ui/components/colors/index.js +65 -0
- package/ui/components/colors/map.js +13 -0
- package/ui/components/colors/random.js +17 -0
- package/ui/components/colors/tailwind-colors.css +247 -0
- package/ui/components/insertIntoList/insertIntoList.jquery.js +150 -0
- package/ui/components/tag/category.js +8 -0
- package/ui/components/tag/index.js +33 -0
- package/ui/components/tag/list.js +42 -0
- package/ui/components/tag/map.js +64 -0
- package/ui/components/tag/tagMap.css +60 -0
- package/ui/components/tag/tags.css +20 -0
- package/ui/core/css/_normalize.css +57 -0
- package/ui/core/css/dynamic/flex.js +36 -0
- package/ui/core/css/dynamic/grid.js +185 -0
- package/ui/core/css/dynamic/shortcuts.js +48 -0
- package/ui/core/css/dynamic/spacing.js +61 -0
- package/ui/core/css/dynamic/text.js +80 -0
- package/ui/core/css/dynamic/width.js +75 -0
- package/ui/core/css/dynamic.js +40 -0
- package/ui/core/js/app/api.js +143 -0
- package/ui/core/js/app/init.js +88 -0
- package/ui/core/js/app/initDarkMode.js +26 -0
- package/ui/core/js/app/initialScroll.js +28 -0
- package/ui/core/js/app/meta/update/components.js +65 -0
- package/ui/core/js/app/meta/update/pages.js +86 -0
- package/ui/core/js/app/metaUpdates.js +10 -0
- package/ui/core/js/app/page.js +319 -0
- package/ui/core/js/app/resize.js +52 -0
- package/ui/core/js/app/state/back.js +16 -0
- package/ui/core/js/app/state/create.js +50 -0
- package/ui/core/js/app/state/get.js +5 -0
- package/ui/core/js/app/state/init.js +25 -0
- package/ui/core/js/app.js +41 -0
- package/ui/core/js/jquery-3.7.1.min.js +2 -0
- package/ui/core/public/app.css +1 -0
- package/ui/core/public/app.js +975 -0
- package/ui/core/public/favicon.ico +0 -0
- package/ui/core/public/index.html +40 -0
- package/server/koa/routeRequest.js +0 -286
- /package/{server/errors.js → errors.js} +0 -0
- /package/{server → src}/brotliJsonResponse.js +0 -0
- /package/{server → src}/checkAccess.js +0 -0
- /package/{server → src}/getMD.js +0 -0
- /package/{server → src}/specialPaths.js +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import ui from '#ui';
|
|
2
|
+
|
|
3
|
+
app.pages.wisdom.init = (data) => {
|
|
4
|
+
|
|
5
|
+
if(data){
|
|
6
|
+
|
|
7
|
+
app.pages.wisdom.data = data;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
ui.cleanMain();
|
|
12
|
+
|
|
13
|
+
if(data.tag){
|
|
14
|
+
|
|
15
|
+
app.pages.wisdom.tag(data.tag);
|
|
16
|
+
|
|
17
|
+
return;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const $introContainer = $(`<div class="grid center p30"></div>`).appendTo(app.$main);
|
|
23
|
+
const $intro = $(`<div class="max-width-800"></div>`).appendTo($introContainer);
|
|
24
|
+
|
|
25
|
+
const $title = $(`<h1 class="mtb50 text-center mb10">I know <em>some</em> stuff...</h1>`).appendTo($intro);
|
|
26
|
+
const $subtitle = $(`<p class="text-xl ptb20">
|
|
27
|
+
... but, I'm not <b><u>the</u> expert</b> on anything;
|
|
28
|
+
I try to cite people smarter than me whenever possible.
|
|
29
|
+
I have a degree in Aeronautical
|
|
30
|
+
</p>`).appendTo($intro);
|
|
31
|
+
|
|
32
|
+
const $readMore = $(`<a class="link">... read more</a>`).appendTo($subtitle).click(()=>{
|
|
33
|
+
|
|
34
|
+
$readMore.remove();
|
|
35
|
+
|
|
36
|
+
$(`<span>
|
|
37
|
+
Science with Minors in Business and Law and MBA with a specialization in Finance,
|
|
38
|
+
but honestly most of what I know I've learned from experience,
|
|
39
|
+
making dumb mistakes, asking questions and learning from people
|
|
40
|
+
<a class="link text-600" href="/shout-outs">smarter than me</a>.
|
|
41
|
+
<br/><br/>
|
|
42
|
+
Being a pilot for example —
|
|
43
|
+
I'm a certified flight instructor and used to fly private jets —
|
|
44
|
+
you don't need a degree to fly a plane,
|
|
45
|
+
but you do need to learn a lot of stuff to do it safely.
|
|
46
|
+
But legally, and in all reality, you learn from other pilots (instructors)
|
|
47
|
+
who may or may not have any degree and straight up just know how to fly.
|
|
48
|
+
<br/><br/>
|
|
49
|
+
One thing I learned after spending $230,0000 on my education is that
|
|
50
|
+
<a class="link" href="/do-I-need-college">you don't need a degree</a> to be "successful" or become an expert in something.
|
|
51
|
+
<br/><br/>
|
|
52
|
+
Most of the things I know,
|
|
53
|
+
I can point your to
|
|
54
|
+
<a class="link" href="/shout-outs">YouTube videos</a>,
|
|
55
|
+
<a class="link" href="/shout-outs">podcasts</a> and
|
|
56
|
+
<a class="link" href="/library">books</a>
|
|
57
|
+
that will teach better than your would-be professor.
|
|
58
|
+
<em>Most "good" professors have their own YouTube channels or podcasts anyway</em>.
|
|
59
|
+
<br/><br/>
|
|
60
|
+
I hope this site eventually becomes a resource like that.
|
|
61
|
+
<br/><br/>
|
|
62
|
+
I'm not 100% anti-college, but I'm 100% have an specific goal,
|
|
63
|
+
like networking, or becoming a Rocket Scientist, or Doctor, etc.
|
|
64
|
+
in mind before spending a penny.
|
|
65
|
+
<br/><br/>
|
|
66
|
+
All that said, <b>I've learned a few things</b> over the years that I think are worth sharing.
|
|
67
|
+
Most of what I write about are things people ask me about frequently,
|
|
68
|
+
things I wish I knew when I was starting out,
|
|
69
|
+
or <b>important lessons I want my kids to know</b> when they grow up.
|
|
70
|
+
<br/><br/>
|
|
71
|
+
</span>`).appendTo($subtitle);
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
const $categories = $('<div class="mt50 plr35"></div>').appendTo(app.$main);
|
|
79
|
+
const $catHeader = $('<h2 class="mb15">Browse by Popular Topics</h2>').appendTo($categories);
|
|
80
|
+
|
|
81
|
+
const $catList = $('<div class=""></div>').appendTo($categories);
|
|
82
|
+
|
|
83
|
+
const tagsWithImages = [ ... data.tags ].filter((tag) =>{
|
|
84
|
+
|
|
85
|
+
return tag.image ?? false;
|
|
86
|
+
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
tagsWithImages.push({
|
|
90
|
+
name: "All Posts",
|
|
91
|
+
image: "/tools/images/tags/all.webp",
|
|
92
|
+
count: data.posts.length
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
tagsWithImages.sort((a, b) => b.count - a.count);
|
|
96
|
+
|
|
97
|
+
console.log(tagsWithImages);
|
|
98
|
+
|
|
99
|
+
// floating-box
|
|
100
|
+
const $carousel = ui.carousel({
|
|
101
|
+
items: tagsWithImages,
|
|
102
|
+
print: (item, index) => {
|
|
103
|
+
|
|
104
|
+
const $topic = $(`<div class="blog-topic cursor-pointer"></div>`);
|
|
105
|
+
|
|
106
|
+
const $image = $(`<div class="blog-topic-image"></div>`)
|
|
107
|
+
.appendTo($topic)
|
|
108
|
+
.css({
|
|
109
|
+
'background-image': `url(${item.image})`
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const $words = $(`<div class="p20"></div>`).appendTo($topic);
|
|
113
|
+
|
|
114
|
+
const $title = $(`<div class="text-500 text-m text-natural-700"><span>${item.name}</span></div>`).appendTo($words);
|
|
115
|
+
const $count = $(`<span class="text-300 text-s text-natural-400 ml10">(${item.count})</span>`).appendTo($title);
|
|
116
|
+
|
|
117
|
+
$topic.click(() => {
|
|
118
|
+
|
|
119
|
+
if(item.name === 'All Posts'){
|
|
120
|
+
|
|
121
|
+
$list.trigger('search', '');
|
|
122
|
+
|
|
123
|
+
} else {
|
|
124
|
+
|
|
125
|
+
$list.trigger('search', 'category: ' + item.name);
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return $topic;
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
}).appendTo($catList);
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
// post 1
|
|
139
|
+
const $mainPostContainer = $(`<div class="ptb50 max-width-1200 width100 justify-self-center"></div>`).appendTo(app.$main);
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
ui.posts.preview2(data.posts[0]).click((e)=>{
|
|
143
|
+
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
e.stopPropagation();
|
|
146
|
+
|
|
147
|
+
app.page(data.posts[0].url);
|
|
148
|
+
|
|
149
|
+
}).appendTo($mainPostContainer);
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
const $top = $(`<div class="p40"></div>`).appendTo(app.$main);
|
|
153
|
+
|
|
154
|
+
const $categoryCloud = ui.categoryCloud({
|
|
155
|
+
data: data.tags,
|
|
156
|
+
limit: 20,
|
|
157
|
+
search: data.tags.length > 20,
|
|
158
|
+
colorMap: app.pages.wisdom.colors,
|
|
159
|
+
callback: (name) => {
|
|
160
|
+
|
|
161
|
+
$list.trigger('search', 'category: ' + name);
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
}).appendTo($top);
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
const $mainPosts = $('<div class="plr20-p plr40 max-width-1200 width100 justify-self-center"></div>').appendTo(app.$main);
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
ui.posts.preLoadImages(data.posts);
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
const $list = ui.list({
|
|
176
|
+
data: data.posts,
|
|
177
|
+
autoLoad: true,
|
|
178
|
+
listClass: 'grid-1 gap-25 gap-50-d gap-100-xl',
|
|
179
|
+
searchInputClass: 'text-xl',
|
|
180
|
+
placeholder: 'Search posts by title, subtitle, or tag...',
|
|
181
|
+
animationStyle: 'rotateIn',
|
|
182
|
+
searchCallback: (val) => {
|
|
183
|
+
|
|
184
|
+
// scroll to $list
|
|
185
|
+
$list[0].scrollIntoView({ behavior: 'smooth' });
|
|
186
|
+
|
|
187
|
+
},
|
|
188
|
+
searchFn: ({
|
|
189
|
+
item: post,
|
|
190
|
+
val
|
|
191
|
+
}) => {
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
if(!val){
|
|
195
|
+
|
|
196
|
+
return true;
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
const v = String((val ?? '')).toLowerCase().trim();
|
|
202
|
+
|
|
203
|
+
const isCategory = v.startsWith('category: ');
|
|
204
|
+
|
|
205
|
+
if(isCategory){
|
|
206
|
+
|
|
207
|
+
const categorySearch = v.slice(9).trim(); // remove 'category: '
|
|
208
|
+
|
|
209
|
+
const winner = !!categorySearch
|
|
210
|
+
&& Array.isArray(post.tags)
|
|
211
|
+
&& post.tags.some((tag) => String(tag).toLowerCase().trim().includes(categorySearch));
|
|
212
|
+
|
|
213
|
+
return winner;
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
post.title.toLowerCase().includes(v) ||
|
|
219
|
+
(post.subtitle && post.subtitle.toLowerCase().includes(v)) ||
|
|
220
|
+
post.tags.some((tag) => String(tag).toLowerCase().trim().includes(v))
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
},
|
|
224
|
+
printFn: (post) => {
|
|
225
|
+
|
|
226
|
+
return ui.posts.preview2(post).click((e) => {
|
|
227
|
+
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
e.stopPropagation();
|
|
230
|
+
|
|
231
|
+
app.page(post.url);
|
|
232
|
+
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
},
|
|
236
|
+
limit: 3
|
|
237
|
+
}).appendTo($mainPosts).addClass('pt80');
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import ui from '#ui';
|
|
2
|
+
|
|
3
|
+
app.pages.wisdom.tag = (tag) => {
|
|
4
|
+
|
|
5
|
+
ui.cleanMain();
|
|
6
|
+
|
|
7
|
+
const tagWord = tag.replaceAll('-', ' ');
|
|
8
|
+
|
|
9
|
+
// capitalize first letter of each word
|
|
10
|
+
const tagTitle = tagWord.replace(/\b\w/g, (c) => c.toUpperCase());
|
|
11
|
+
|
|
12
|
+
// state management
|
|
13
|
+
app.state.create({
|
|
14
|
+
title: `Wisdom | ${tagTitle}`,
|
|
15
|
+
url: `/wisdom/${tag}`,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
ui.breadcrumbs({
|
|
19
|
+
data: [
|
|
20
|
+
{ '/wisdom': 'Wisdom' },
|
|
21
|
+
{ [`/wisdom/${tag}`]: tagTitle }
|
|
22
|
+
],
|
|
23
|
+
color: 'cyan',
|
|
24
|
+
callback:(item)=>{
|
|
25
|
+
|
|
26
|
+
app.page(item.url);
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
}).appendTo(app.$main);
|
|
30
|
+
|
|
31
|
+
const $mainPosts = $(`<div class="p20-p p40 w100 max-width-1200 m0a"></div>`)
|
|
32
|
+
.appendTo(app.$main);
|
|
33
|
+
|
|
34
|
+
const { data } = app.pages.wisdom;
|
|
35
|
+
|
|
36
|
+
const limitedData = data.posts.filter((post) => {
|
|
37
|
+
|
|
38
|
+
return Array.isArray(post.tags)
|
|
39
|
+
&& post.tags.some((tagItem) => String(tagItem).toLowerCase().trim() === tagWord.toLowerCase().trim());
|
|
40
|
+
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const $top = $('<div class="mt20 mb70 text-center"></div>').appendTo($mainPosts);
|
|
44
|
+
|
|
45
|
+
$(`<h1>${tagTitle}</h1>`).appendTo($top);
|
|
46
|
+
$(`<h2 class="mb20">${limitedData.length} posts</h2>`).appendTo($top);
|
|
47
|
+
|
|
48
|
+
const $list = ui.list({
|
|
49
|
+
data: limitedData,
|
|
50
|
+
autoLoad: true,
|
|
51
|
+
listClass: ' grid-1 gap-100',
|
|
52
|
+
searchInputClass: 'mb40 text-xl',
|
|
53
|
+
placeholder: `Search ${tagWord}`,
|
|
54
|
+
animationStyle: 'rotateIn',
|
|
55
|
+
searchFn: ({
|
|
56
|
+
item: post,
|
|
57
|
+
val
|
|
58
|
+
}) => {
|
|
59
|
+
|
|
60
|
+
if(!val){
|
|
61
|
+
|
|
62
|
+
return true;
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const v = String((val ?? '')).toLowerCase().trim();
|
|
67
|
+
|
|
68
|
+
const isCategory = v.startsWith('category: ');
|
|
69
|
+
|
|
70
|
+
if(isCategory){
|
|
71
|
+
|
|
72
|
+
const categorySearch = v.slice(9).trim(); // remove 'category: '
|
|
73
|
+
|
|
74
|
+
const winner = !!categorySearch
|
|
75
|
+
&& Array.isArray(post.tags)
|
|
76
|
+
&& post.tags.some((tag) => String(tag).toLowerCase().trim().includes(categorySearch));
|
|
77
|
+
|
|
78
|
+
return winner;
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
post.title.toLowerCase().includes(v) ||
|
|
84
|
+
(post.subtitle && post.subtitle.toLowerCase().includes(v)) ||
|
|
85
|
+
post.tags.some((tag) => String(tag).toLowerCase().trim().includes(v))
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
},
|
|
89
|
+
printFn: (post) => {
|
|
90
|
+
|
|
91
|
+
return ui.posts.preview2(post).click(()=>{
|
|
92
|
+
|
|
93
|
+
app.page(post.url);
|
|
94
|
+
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
},
|
|
98
|
+
limit: 3
|
|
99
|
+
}).appendTo($mainPosts);
|
|
100
|
+
|
|
101
|
+
ui.posts.preLoadImages(limitedData);
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
limitedData.forEach((post) => {
|
|
105
|
+
|
|
106
|
+
post.style = 'header-image';
|
|
107
|
+
post.image = post.image;
|
|
108
|
+
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.introPage{
|
|
2
|
+
background-image: url('/tools/images/awesomeness.webp');
|
|
3
|
+
background-repeat: no-repeat;
|
|
4
|
+
background-size: cover;
|
|
5
|
+
background-position: 50% 50%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.landing-area {
|
|
9
|
+
overflow: auto;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 40%;
|
|
12
|
+
text-align: center;
|
|
13
|
+
color: #fff;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.app-size-xl .landing-area { width: 60%; }
|
|
17
|
+
.app-size-d .landing-area { width: 60%; }
|
|
18
|
+
.app-size-t .landing-area { width: 70%; }
|
|
19
|
+
.app-size-p .landing-area { width: 95%; }
|
|
20
|
+
|
|
21
|
+
.landing-area h1{
|
|
22
|
+
color: #fff;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.landing-area h2{
|
|
28
|
+
margin-bottom: 10px;
|
|
29
|
+
font-weight: 300;
|
|
30
|
+
font-size: 1.4em;
|
|
31
|
+
text-transform: capitalize;
|
|
32
|
+
color: #fff;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.landing-area button {
|
|
36
|
+
width: 46%;
|
|
37
|
+
margin: 2%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.landing-area button i{
|
|
41
|
+
text-align: center;
|
|
42
|
+
font-size: 2em;
|
|
43
|
+
position: relative;
|
|
44
|
+
display: block;
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding-bottom: 23px;
|
|
47
|
+
right:auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.landing-area .a-button {
|
|
51
|
+
background-color: #fff;
|
|
52
|
+
color: #13408d;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.landing-area .b-button {
|
|
56
|
+
background-color: #13408d;
|
|
57
|
+
color: #fff;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.divider{
|
|
61
|
+
width: 50%;
|
|
62
|
+
height: 1px;
|
|
63
|
+
display: block;
|
|
64
|
+
margin-left: 25%;
|
|
65
|
+
background-color: #fff;
|
|
66
|
+
margin: 19px 25%;
|
|
67
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
.main-nav {
|
|
2
|
+
background-color: #010816;
|
|
3
|
+
overflow: auto;
|
|
4
|
+
z-index: 3;
|
|
5
|
+
position: absolute;
|
|
6
|
+
width: 100%;
|
|
7
|
+
top: 62px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.main{
|
|
11
|
+
padding-top: 137px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.nav-container {
|
|
15
|
+
background-color: #010816;
|
|
16
|
+
color: #fff;
|
|
17
|
+
opacity: 1;
|
|
18
|
+
position: fixed;
|
|
19
|
+
right: 0;
|
|
20
|
+
top: -63px;
|
|
21
|
+
transition: all 420ms;
|
|
22
|
+
width: 100%;
|
|
23
|
+
z-index: 3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.nav-container.showExtra{
|
|
27
|
+
top:0px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nav-logo {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
float: left;
|
|
33
|
+
font-size: 2em;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
height: 75px;
|
|
36
|
+
padding-top: 15px;
|
|
37
|
+
text-align: center;
|
|
38
|
+
width: 300px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nav-list {
|
|
42
|
+
float: right;
|
|
43
|
+
height: 75px;
|
|
44
|
+
margin: 0px;
|
|
45
|
+
padding: 25px 45px 25px 0px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.app-size-p .nav-list,
|
|
49
|
+
.app-size-t .nav-list{
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: inherit;
|
|
52
|
+
padding-top: 0px;
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
.app-size-p .nav-list.active,
|
|
56
|
+
.app-size-t .nav-list.active{
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
.app-size-p .nav-list li,
|
|
62
|
+
.app-size-t .nav-list li{
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: inherit;
|
|
65
|
+
text-align: right;
|
|
66
|
+
padding: 10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
.nav-list li {
|
|
71
|
+
-webkit-touch-callout: none;
|
|
72
|
+
-webkit-user-select: none;
|
|
73
|
+
-khtml-user-select: none;
|
|
74
|
+
-moz-user-select: none;
|
|
75
|
+
-ms-user-select: none;
|
|
76
|
+
user-select: none;
|
|
77
|
+
border-bottom: solid 1px #00000000;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
display: block;
|
|
80
|
+
float: left;
|
|
81
|
+
font-size: 1.3em;
|
|
82
|
+
font-weight: 300;
|
|
83
|
+
margin-left: 30px;
|
|
84
|
+
padding-bottom: 3px;
|
|
85
|
+
transition: all 420ms;
|
|
86
|
+
position: relative;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.nav-list li:hover,
|
|
90
|
+
.nav-sub-list li:hover,
|
|
91
|
+
.nav-button:hover,
|
|
92
|
+
.nav-logo:hover{
|
|
93
|
+
color:#ffab55;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.app-size-xl .nav-list li.active,
|
|
97
|
+
.app-size-d .nav-list li.active{
|
|
98
|
+
border-bottom: solid 1px #0858e1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.app-size-t .nav-list li,
|
|
102
|
+
.app-size-p .nav-list li{
|
|
103
|
+
padding-right:45px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.nav-button {
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
float: right;
|
|
109
|
+
height: 75px;
|
|
110
|
+
padding: 19px 12px 19px 0px;
|
|
111
|
+
text-align: center;
|
|
112
|
+
width: 60px;
|
|
113
|
+
display: none;
|
|
114
|
+
font-size: 2.3em;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.app-size-p .nav-button,
|
|
118
|
+
.app-size-t .nav-button{
|
|
119
|
+
display: block;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
.nav-top {
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 3;
|
|
126
|
+
top: 0px;
|
|
127
|
+
width:100%;
|
|
128
|
+
display: block;
|
|
129
|
+
overflow: auto;
|
|
130
|
+
font-size: .85em;
|
|
131
|
+
padding: 13px 32px 13px 0px;
|
|
132
|
+
background-color: #0858e1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.app-size-p .nav-top,
|
|
136
|
+
.app-size-p .nav-call-to-action {
|
|
137
|
+
padding-right: 15px;
|
|
138
|
+
}
|
|
139
|
+
.app-size-p .nav-action{
|
|
140
|
+
padding-left: 15px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
.nav-action{
|
|
145
|
+
float: right;
|
|
146
|
+
background-color: #d92c2c;
|
|
147
|
+
padding: 10px 40px 10px 25px;
|
|
148
|
+
position: relative;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
transition: all 420ms;
|
|
151
|
+
}
|
|
152
|
+
.nav-action:hover{
|
|
153
|
+
background-color:#053587;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.nav-action i {
|
|
157
|
+
font-size: 1em;
|
|
158
|
+
float: right;
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 12px;
|
|
161
|
+
right: 13px;
|
|
162
|
+
}
|
|
163
|
+
.nav-call-to-action{
|
|
164
|
+
float: right;
|
|
165
|
+
padding: 10px 25px 10px 0px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.nav-sub-list{
|
|
169
|
+
transition: all 420ms;
|
|
170
|
+
display: block;
|
|
171
|
+
width: 100%;
|
|
172
|
+
overflow: auto;
|
|
173
|
+
background-color:#182a4d;
|
|
174
|
+
margin-bottom: 0px;
|
|
175
|
+
top: 0px;
|
|
176
|
+
position: absolute;
|
|
177
|
+
padding-right: 10px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.nav-sub-list li{
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
z-index: 0;
|
|
183
|
+
transition: all 420ms;
|
|
184
|
+
display: inline-block;
|
|
185
|
+
overflow: auto;
|
|
186
|
+
background-color: #182a4d;
|
|
187
|
+
float: left;
|
|
188
|
+
padding: 20px 22px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.nav-sub-list.active{
|
|
192
|
+
top: 120px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.app-size-t .nav-sub-list,
|
|
196
|
+
.app-size-p .nav-sub-list{
|
|
197
|
+
top: -235px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.app-size-t .nav-sub-list li,
|
|
201
|
+
.app-size-p .nav-sub-list li{
|
|
202
|
+
padding-right: 50px;
|
|
203
|
+
text-align: right;
|
|
204
|
+
width: 100%;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.app-size-p .nav-sub-list.active,
|
|
208
|
+
.app-size-t .nav-sub-list.active{
|
|
209
|
+
top: 415px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.app-size-p .nav-list li i,
|
|
213
|
+
.app-size-t .nav-list li i {
|
|
214
|
+
position: absolute;
|
|
215
|
+
right: 4px;
|
|
216
|
+
top: 14px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.nav-list li i {
|
|
220
|
+
position: relative;
|
|
221
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
app.pages.examples.updateState = function(){
|
|
2
|
+
|
|
3
|
+
// set initial
|
|
4
|
+
history.replaceState(0,'Awesomeness PWA', '/examples');
|
|
5
|
+
document.title = 'Awesomeness | Vanilla JS to build PWAs';
|
|
6
|
+
|
|
7
|
+
var startData = {};
|
|
8
|
+
|
|
9
|
+
startData.title = 'Awesomeness | Vanilla JS to build PWA';
|
|
10
|
+
startData.url = '/examples';
|
|
11
|
+
|
|
12
|
+
app.state.state[0] = startData;
|
|
13
|
+
|
|
14
|
+
};
|