@awesomeness-js/server 1.1.11 → 1.1.13
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/package.json +1 -1
- package/src/componentAndPageMemory.js +47 -19
- package/src/componentDependencies.js +2 -4
- package/tests/componentAndPageMemory.test.js +1 -0
- package/tests/fetchPage.test.js +2 -0
- package/tests/fixtures/site-and-components/components/app/cleanMain/index.js +26 -0
- package/tests/fixtures/site-and-components/components/app/cleanMain.js +14 -0
- package/tests/fixtures/site-and-components/components/app/index.css +4 -0
- package/tests/fixtures/site-and-components/components/app/index.js +42 -0
- package/tests/fixtures/site-and-components/components/app/insertIntoList.jquery.js +150 -0
- package/tests/fixtures/site-and-components/components/app/keyUpWithTimeout.jQuery.js +26 -0
- package/tests/fixtures/site-and-components/components/app/onEnter.jQuery.js +39 -0
- package/tests/fixtures/site-and-components/components/app/onResize.jQuery.js +64 -0
- package/tests/fixtures/site-and-components/components/app/pwa/_.css +305 -0
- package/tests/fixtures/site-and-components/components/app/pwa/index.js +235 -0
- package/tests/fixtures/site-and-components/components/app/pwa/updateProfileImage.js +7 -0
- package/tests/fixtures/site-and-components/components/app/shapes.css +3 -0
- package/tests/fixtures/site-and-components/components/app/simple/_.css +151 -0
- package/tests/fixtures/site-and-components/components/app/simple/index.js +170 -0
- package/tests/fixtures/site-and-components/components/app/start.js +165 -0
- package/tests/fixtures/site-and-components/components/app/vanilla/_.css +1 -0
- package/tests/fixtures/site-and-components/components/app/vanilla/index.js +27 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/elm.js +172 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/index.js +63 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/observerPoolGet.js +91 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/observerPoolRegistry.js +18 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/observerPoolSubscribe.js +37 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/observerPoolUnsubscribe.js +44 -0
- package/tests/fixtures/site-and-components/components/scrollSpy/top.js +86 -0
- package/tests/fixtures/site-and-components/sites/site-a/pages/home/js/index.js +41 -8
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/* =========================================================
|
|
2
|
+
AWESOMENESS PWA – base layout + nav + menus
|
|
3
|
+
========================================================= */
|
|
4
|
+
|
|
5
|
+
/* (optional) if you want predictable sizing everywhere */
|
|
6
|
+
.awesomeness-app-pwa,
|
|
7
|
+
.awesomeness-app-pwa * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* -------------------------
|
|
12
|
+
MAIN CONTENT AREA
|
|
13
|
+
------------------------- */
|
|
14
|
+
.awesomeness-app-pwa-main {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-height: 100%;
|
|
22
|
+
|
|
23
|
+
overflow-x: hidden;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
|
|
26
|
+
padding-top: 65px; /* account for fixed top nav bar */
|
|
27
|
+
padding-bottom: 65px; /* account for fixed bottom nav bar */
|
|
28
|
+
|
|
29
|
+
z-index: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/* -------------------------
|
|
34
|
+
NAV BARS (fixed)
|
|
35
|
+
------------------------- */
|
|
36
|
+
.awesomeness-app-pwa-top-navBar,
|
|
37
|
+
.awesomeness-app-pwa-bottom-navBar {
|
|
38
|
+
position: fixed;
|
|
39
|
+
left: 0;
|
|
40
|
+
right: 0;
|
|
41
|
+
|
|
42
|
+
height: 65px;
|
|
43
|
+
z-index: 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.awesomeness-app-pwa-top-navBar {
|
|
47
|
+
top: 0;
|
|
48
|
+
|
|
49
|
+
/* layout */
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
|
|
53
|
+
/* keep true 65px height; avoid vertical padding */
|
|
54
|
+
padding: 0 12px;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.awesomeness-app-pwa-bottom-navBar {
|
|
59
|
+
bottom: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* -------------------------
|
|
64
|
+
LEFT / RIGHT MENUS
|
|
65
|
+
------------------------- */
|
|
66
|
+
.awesomeness-app-pwa-left-menu,
|
|
67
|
+
.awesomeness-app-pwa-right-menu {
|
|
68
|
+
position: fixed;
|
|
69
|
+
top: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
|
|
72
|
+
width: 300px; /* use width instead of min-width for predictable translate */
|
|
73
|
+
max-width: 90vw;
|
|
74
|
+
|
|
75
|
+
transition: transform 200ms ease;
|
|
76
|
+
will-change: transform;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* LEFT MENU */
|
|
80
|
+
.awesomeness-app-pwa-left-menu {
|
|
81
|
+
left: 0;
|
|
82
|
+
z-index: 1;
|
|
83
|
+
transform: translate3d(-100%, 0, 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.awesomeness-app-pwa-left-menu.open {
|
|
87
|
+
transform: translate3d(0, 0, 0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* RIGHT MENU */
|
|
91
|
+
.awesomeness-app-pwa-right-menu {
|
|
92
|
+
right: 0;
|
|
93
|
+
z-index: 3;
|
|
94
|
+
transform: translate3d(100%, 0, 0);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.awesomeness-app-pwa-right-menu.open {
|
|
98
|
+
transform: translate3d(0, 0, 0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.awesomeness-app-pwa-left-menu.awesomeness-app-pwa-under-navBar,
|
|
102
|
+
.awesomeness-app-pwa-right-menu.awesomeness-app-pwa-under-navBar {
|
|
103
|
+
top: 65px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.awesomeness-app-pwa-left-menu.open {
|
|
107
|
+
left: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.awesomeness-app-pwa-right-menu.open {
|
|
111
|
+
right: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* -------------------------
|
|
115
|
+
SUB NAV ITEMS (bottom + top right clones)
|
|
116
|
+
------------------------- */
|
|
117
|
+
.awesomeness-app-pwa-sub-nav-item {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
text-align: center;
|
|
120
|
+
padding: 5px 5px 5px 0px;
|
|
121
|
+
border-bottom: solid 2px transparent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.awesomeness-app-pwa-top-navBar .awesomeness-app-pwa-sub-nav-item{
|
|
125
|
+
height: 65px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.awesomeness-app-pwa-sub-nav-item-ico {
|
|
129
|
+
font-size: 1.2em;
|
|
130
|
+
padding-bottom: 5px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.awesomeness-app-pwa-sub-nav-item-name {
|
|
134
|
+
font-size: 0.9em;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.app-size-p .awesomeness-app-pwa-sub-nav-item-name {
|
|
138
|
+
font-size: 0.8em;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.app-size-p .awesomeness-app-pwa-sub-nav-item {
|
|
142
|
+
padding: 0px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* -------------------------
|
|
146
|
+
TOP NAV CONTENT
|
|
147
|
+
Order: profile | logo | search (flex) | right group | menu
|
|
148
|
+
------------------------- */
|
|
149
|
+
|
|
150
|
+
/* profile pic (left) */
|
|
151
|
+
.awesomeness-app-pwa-profile-pic {
|
|
152
|
+
flex: 0 0 auto;
|
|
153
|
+
|
|
154
|
+
width: 45px;
|
|
155
|
+
height: 45px;
|
|
156
|
+
border-radius: 9999px;
|
|
157
|
+
|
|
158
|
+
text-align: center;
|
|
159
|
+
line-height: 45px;
|
|
160
|
+
|
|
161
|
+
margin-left: 10px; /* keep your offset */
|
|
162
|
+
|
|
163
|
+
background-position: center;
|
|
164
|
+
background-size: cover;
|
|
165
|
+
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* logo next to profile */
|
|
171
|
+
.awesomeness-app-pwa-logo {
|
|
172
|
+
flex: 0 0 auto;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
|
|
178
|
+
min-width: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.awesomeness-app-pwa-logo:hover{
|
|
182
|
+
color: var(--hover-color);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/* search takes ALL remaining space */
|
|
187
|
+
.awesomeness-app-pwa-search-area {
|
|
188
|
+
flex: 1 1 auto;
|
|
189
|
+
min-width: 0;
|
|
190
|
+
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
|
|
194
|
+
/* your requirement: items inside search stay to the right */
|
|
195
|
+
justify-content: flex-end;
|
|
196
|
+
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
|
|
200
|
+
padding: 0 20px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.app-size-p .awesomeness-app-pwa-search-area{
|
|
204
|
+
padding: 0px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* right group should only be as wide as its content (no hover slab) */
|
|
208
|
+
.awesomeness-app-pwa-top-navBar-right {
|
|
209
|
+
flex: 0 0 auto;
|
|
210
|
+
width: auto;
|
|
211
|
+
min-width: 0;
|
|
212
|
+
|
|
213
|
+
display: flex;
|
|
214
|
+
justify-content: flex-end;
|
|
215
|
+
gap: 20px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.app-size-t .awesomeness-app-pwa-top-navBar-right{
|
|
219
|
+
gap: 10px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* menu button pinned to far right naturally (since search is flex:1) */
|
|
223
|
+
.awesomeness-app-pwa-menu-button {
|
|
224
|
+
flex: 0 0 auto;
|
|
225
|
+
|
|
226
|
+
width: 40px;
|
|
227
|
+
height: 40px;
|
|
228
|
+
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
|
|
233
|
+
cursor: pointer;
|
|
234
|
+
|
|
235
|
+
/* keep the icon centered vertically in the fixed-height bar */
|
|
236
|
+
padding: 0;
|
|
237
|
+
font-size: 1.2em;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.awesomeness-app-pwa-search-icon{
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
font-size: 1.2em;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.awesomeness-app-pwa-click-to-close {
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
position: absolute;
|
|
248
|
+
top: 0;
|
|
249
|
+
left: 0;
|
|
250
|
+
bottom: 0;
|
|
251
|
+
right: 0;
|
|
252
|
+
width: 100%;
|
|
253
|
+
height: 100%;
|
|
254
|
+
z-index: 2;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.app-size-xl .awesomeness-app-pwa-top-navBar-right .awesomeness-app-pwa-sub-nav-item,
|
|
258
|
+
.app-size-d .awesomeness-app-pwa-top-navBar-right .awesomeness-app-pwa-sub-nav-item {
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
text-align: left;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.app-size-xl .awesomeness-app-pwa-top-navBar-right .awesomeness-app-pwa-sub-nav-item-ico,
|
|
265
|
+
.app-size-d .awesomeness-app-pwa-top-navBar-right .awesomeness-app-pwa-sub-nav-item-ico {
|
|
266
|
+
padding-bottom: 0;
|
|
267
|
+
padding-right: 5px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.awesomeness-app-pwa-search-input-container {
|
|
271
|
+
position: relative;
|
|
272
|
+
|
|
273
|
+
width: 100%;
|
|
274
|
+
max-width: 500px;
|
|
275
|
+
|
|
276
|
+
margin: 0 auto;
|
|
277
|
+
|
|
278
|
+
padding: 7px 50px 7px 40px;
|
|
279
|
+
border-radius: 50px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* shared icon centering */
|
|
283
|
+
.awesomeness-app-pwa-search-icon{
|
|
284
|
+
position: absolute;
|
|
285
|
+
top: 50%;
|
|
286
|
+
transform: translateY(-50%);
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* left icon */
|
|
292
|
+
.awesomeness-app-pwa-search-icon{
|
|
293
|
+
left: 10px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
.awesomeness-app-pwa-bottomNavUse-names .awesomeness-app-pwa-sub-nav-item-ico,
|
|
298
|
+
.awesomeness-app-pwa-topNavUse-names .awesomeness-app-pwa-sub-nav-item-ico {
|
|
299
|
+
display: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.awesomeness-app-pwa-bottomNavUse-icons .awesomeness-app-pwa-sub-nav-item-name,
|
|
303
|
+
.awesomeness-app-pwa-topNavUse-icons .awesomeness-app-pwa-sub-nav-item-name {
|
|
304
|
+
display: none;
|
|
305
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import ui from '#ui';
|
|
2
|
+
|
|
3
|
+
export default ({
|
|
4
|
+
replaceApp = true,
|
|
5
|
+
navItems = [],
|
|
6
|
+
topNavUse = 'icons', // or 'names' or 'both'
|
|
7
|
+
bottomNavUse = 'icons', // or 'names' or 'both'
|
|
8
|
+
logo = 'Awesomeness PWA',
|
|
9
|
+
profileImageURL = null,
|
|
10
|
+
logoURL = '/',
|
|
11
|
+
searchURL = '/search',
|
|
12
|
+
profileURL = '/profile',
|
|
13
|
+
beforeSearch = null,
|
|
14
|
+
} = {}) => {
|
|
15
|
+
|
|
16
|
+
let $app = ui.app.vanilla({ replaceApp });
|
|
17
|
+
|
|
18
|
+
const THEME = ui.theme();
|
|
19
|
+
|
|
20
|
+
const $topNavBar = $(`<div class="
|
|
21
|
+
awesomeness-app-pwa-top-navBar
|
|
22
|
+
${THEME.menu.base}
|
|
23
|
+
${THEME.text.secondary}
|
|
24
|
+
"></div>`)
|
|
25
|
+
.appendTo($app);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const $leftMenu = $(`<div class="awesomeness-app-pwa-left-menu ${THEME.menu.base}"></div>`).appendTo($app);
|
|
29
|
+
const $rightMenu = $(`<div class="awesomeness-app-pwa-right-menu ${THEME.menu.base}"></div>`).appendTo($app);
|
|
30
|
+
|
|
31
|
+
const $bottomNavBar = $(`<div class="
|
|
32
|
+
hidden-xl hidden-d
|
|
33
|
+
awesomeness-app-pwa-bottom-navBar
|
|
34
|
+
${THEME.menu.base}
|
|
35
|
+
${THEME.text.secondary}
|
|
36
|
+
"></div>`)
|
|
37
|
+
.appendTo($app);
|
|
38
|
+
|
|
39
|
+
if(THEME.menuBorderColor){
|
|
40
|
+
|
|
41
|
+
$topNavBar.addClass(THEME.border.color).css({ 'border-bottom': `1px solid` });
|
|
42
|
+
$bottomNavBar.addClass(THEME.border.color).css({ 'border-top': `1px solid` });
|
|
43
|
+
$leftMenu.addClass(THEME.border.color).css({ 'border-right': `1px solid` });
|
|
44
|
+
$rightMenu.addClass(THEME.border.color).css({ 'border-left': `1px solid` });
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const $link = ui.link({
|
|
49
|
+
link: logoURL,
|
|
50
|
+
beforeOpen: async () => {
|
|
51
|
+
|
|
52
|
+
closeNav($leftMenu);
|
|
53
|
+
closeNav($rightMenu);
|
|
54
|
+
|
|
55
|
+
if(beforeSearch){
|
|
56
|
+
|
|
57
|
+
return await beforeSearch();
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return null;
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
}).addClass(`
|
|
65
|
+
awesomeness-app-pwa-logo
|
|
66
|
+
${THEME.text.secondary}
|
|
67
|
+
${THEME.text.accent}--hover
|
|
68
|
+
`);
|
|
69
|
+
|
|
70
|
+
const $logo = $(`<div class="">${logo}</div>`).appendTo($link);
|
|
71
|
+
|
|
72
|
+
$link.appendTo($topNavBar);
|
|
73
|
+
|
|
74
|
+
const $searchArea = $(`<div class="awesomeness-app-pwa-search-area"></div>`).appendTo($topNavBar);
|
|
75
|
+
const $topNavBarRight = $(`<div class="hidden-p hidden-t awesomeness-app-pwa-top-navBar-right"></div>`).appendTo($topNavBar);
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if(searchURL){
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const $link = ui.link({
|
|
83
|
+
link: searchURL,
|
|
84
|
+
beforeOpen: async () => {
|
|
85
|
+
|
|
86
|
+
if(beforeSearch){
|
|
87
|
+
|
|
88
|
+
return await beforeSearch();
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
closeNav($leftMenu);
|
|
93
|
+
closeNav($rightMenu);
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const $searchIcon = $(`
|
|
99
|
+
<div class="
|
|
100
|
+
awesomeness-app-pwa-menu-button
|
|
101
|
+
awesomeness-app-pwa-sub-nav-item
|
|
102
|
+
${THEME.text.accent}--hover
|
|
103
|
+
color-${THEME.accent.color}--hover
|
|
104
|
+
border-${THEME.accent.color}--hover
|
|
105
|
+
mlr20
|
|
106
|
+
mr10-p
|
|
107
|
+
ml0-p
|
|
108
|
+
">
|
|
109
|
+
<i class="ico-search2"></i>
|
|
110
|
+
</div>`).appendTo($link);
|
|
111
|
+
|
|
112
|
+
$link.appendTo($topNavBar);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if(profileURL){
|
|
118
|
+
|
|
119
|
+
const $link = ui.link({
|
|
120
|
+
link: profileURL
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
$link.appendTo($topNavBar);
|
|
124
|
+
|
|
125
|
+
const $profilePic = $(`<div class="awesomeness-app-pwa-profile-pic ${THEME.surface.elevated}"></div>`)
|
|
126
|
+
.appendTo($link);
|
|
127
|
+
|
|
128
|
+
if(profileImageURL){
|
|
129
|
+
|
|
130
|
+
$profilePic
|
|
131
|
+
.css({
|
|
132
|
+
'background-image': `url(${profileImageURL})`
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
} else {
|
|
136
|
+
|
|
137
|
+
$profilePic
|
|
138
|
+
.css({
|
|
139
|
+
'background-image': `url(https://api.dicebear.com/5.x/miniavs/svg?backgroundColor=4a46e0&seed=${Math.random()})`,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
const $clickToClose = $(`<div class="awesomeness-app-pwa-click-to-close"></div>`)
|
|
149
|
+
.hide()
|
|
150
|
+
.css({
|
|
151
|
+
opacity: 0.7,
|
|
152
|
+
})
|
|
153
|
+
.appendTo($app);
|
|
154
|
+
|
|
155
|
+
$clickToClose.click(()=>{
|
|
156
|
+
|
|
157
|
+
closeNav($leftMenu);
|
|
158
|
+
closeNav($rightMenu);
|
|
159
|
+
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const $main = $(`<div id="main" class="awesomeness-app-pwa-main ${THEME.app.fg} ${THEME.app.bg}"></div>`).appendTo($app);
|
|
163
|
+
|
|
164
|
+
if(navItems.length > 0){
|
|
165
|
+
|
|
166
|
+
const $grid = $(`<div class="grid-${navItems.length} height-65"></div>`)
|
|
167
|
+
.appendTo($bottomNavBar);
|
|
168
|
+
|
|
169
|
+
navItems.forEach((item) => {
|
|
170
|
+
|
|
171
|
+
const $link = ui.link({
|
|
172
|
+
link: item.url,
|
|
173
|
+
}).appendTo($grid)
|
|
174
|
+
.addClass(`flex justify-center align-center`);
|
|
175
|
+
|
|
176
|
+
const $item = $(`<div class="
|
|
177
|
+
awesomeness-app-pwa-sub-nav-item
|
|
178
|
+
${THEME.text.accent}--hover
|
|
179
|
+
color-${THEME.accent.color}--hover
|
|
180
|
+
border-${THEME.accent.color}--hover
|
|
181
|
+
"></div>`)
|
|
182
|
+
.appendTo($link);
|
|
183
|
+
|
|
184
|
+
if(item.ico){
|
|
185
|
+
|
|
186
|
+
$(`<div class="awesomeness-app-pwa-sub-nav-item-ico"><i class="ico-${item.ico}"></i></div>`)
|
|
187
|
+
.appendTo($item);
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if(item.emoji){
|
|
192
|
+
|
|
193
|
+
$(`<div class="awesomeness-app-pwa-sub-nav-item-ico">${item.emoji}</div>`)
|
|
194
|
+
.appendTo($item);
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if(item.name){
|
|
199
|
+
|
|
200
|
+
$(`<div class="awesomeness-app-pwa-sub-nav-item-name">${item.name}</div>`)
|
|
201
|
+
.appendTo($item);
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
$link.clone(true).addClass(`awesomeness-app-pwa-topNavUse-${topNavUse}`).appendTo($topNavBarRight);
|
|
206
|
+
|
|
207
|
+
$link.addClass(`awesomeness-app-pwa-bottomNavUse-${bottomNavUse}`);
|
|
208
|
+
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
let navOpen = false;
|
|
214
|
+
|
|
215
|
+
function openNav($nav){
|
|
216
|
+
|
|
217
|
+
$clickToClose.show();
|
|
218
|
+
|
|
219
|
+
$nav.addClass('open');
|
|
220
|
+
navOpen = true;
|
|
221
|
+
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function closeNav($nav){
|
|
225
|
+
|
|
226
|
+
$nav.removeClass('open');
|
|
227
|
+
navOpen = false;
|
|
228
|
+
|
|
229
|
+
$clickToClose.hide();
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return $app;
|
|
234
|
+
|
|
235
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* ================================
|
|
2
|
+
Awesomeness App Simple - NAV ONLY
|
|
3
|
+
================================ */
|
|
4
|
+
|
|
5
|
+
.awesomeness-app-simple-main {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
min-height: 100%;
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
padding-top: 65px; /* account for fixed nav bar */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.awesomeness-app-simple-main.withFullScreenHero {
|
|
19
|
+
padding-top: 0px; /* account for fixed nav bar */
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.awesomeness-app-simple-navBar {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 65px;
|
|
29
|
+
z-index: 5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* NEW: interior wrapper */
|
|
33
|
+
.awesomeness-app-simple-navBar-interior{
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
height: 65px;
|
|
36
|
+
padding: 0 16px;
|
|
37
|
+
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.awesomeness-app-simple-logo{
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
user-select: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.awesomeness-app-simple-top-navItems{
|
|
52
|
+
margin-left: auto;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.awesomeness-app-simple-nav-item{
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
height: 65px;
|
|
63
|
+
padding: 0 14px;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Menu button */
|
|
69
|
+
.awesomeness-app-simple-menu-button{
|
|
70
|
+
margin-left: auto;
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
height: 65px;
|
|
75
|
+
padding: 0 12px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
-webkit-tap-highlight-color: transparent;
|
|
78
|
+
font-size: 1.2em;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Backdrop (z-index 2) */
|
|
83
|
+
.awesomeness-app-simple-menu-backdrop{
|
|
84
|
+
position: fixed;
|
|
85
|
+
inset: 0;
|
|
86
|
+
z-index: 2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Phone slide-down menu (z-index 3) */
|
|
90
|
+
.awesomeness-app-simple-phone-menu{
|
|
91
|
+
position: fixed;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
z-index: 4;
|
|
96
|
+
|
|
97
|
+
transform: translate3d(0, -100%, 0);
|
|
98
|
+
transition: transform 220ms ease;
|
|
99
|
+
|
|
100
|
+
padding-top: 65px;
|
|
101
|
+
padding-bottom: 30px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* open state */
|
|
105
|
+
.awesomeness-app-simple-phone-menu.is-open{
|
|
106
|
+
transform: translate3d(0, 0, 0);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Menu rows */
|
|
110
|
+
.awesomeness-app-simple-phone-menu a,
|
|
111
|
+
.awesomeness-app-simple-phone-menu .awesomeness-app-simple-nav-item{
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: flex-start;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 56px;
|
|
117
|
+
padding: 0 16px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
.awesomeness-app-simple-nav-item span {
|
|
122
|
+
position: relative;
|
|
123
|
+
display: inline-block;
|
|
124
|
+
padding-bottom: 4px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.awesomeness-app-simple-nav-item span::after {
|
|
128
|
+
content: "";
|
|
129
|
+
position: absolute;
|
|
130
|
+
left: 0;
|
|
131
|
+
bottom: 0;
|
|
132
|
+
|
|
133
|
+
height: 2px;
|
|
134
|
+
width: 100%;
|
|
135
|
+
|
|
136
|
+
background: currentColor;
|
|
137
|
+
|
|
138
|
+
transform: scaleX(0);
|
|
139
|
+
transform-origin: right center;
|
|
140
|
+
|
|
141
|
+
transition: transform 420ms ease !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.awesomeness-app-simple-nav-item:hover span::after {
|
|
145
|
+
transform: scaleX(1);
|
|
146
|
+
transform-origin: left center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.awesomeness-app-simple-nav-item span::after {
|
|
150
|
+
transition: transform 420ms cubic-bezier(.2,.8,.2,1);
|
|
151
|
+
}
|