@awesomeness-js/server 1.0.1 → 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 -22
- 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,150 @@
|
|
|
1
|
+
(function(){
|
|
2
|
+
|
|
3
|
+
// IMPORTANT NOTE: with custom sortFn's use toLowerCase !!
|
|
4
|
+
$.fn.extend({
|
|
5
|
+
|
|
6
|
+
//Name the function
|
|
7
|
+
insertIntoList: function($ul, options) {
|
|
8
|
+
|
|
9
|
+
var defaults = {
|
|
10
|
+
'sortFn':function($elm){
|
|
11
|
+
|
|
12
|
+
return $elm.html().toLowerCase();
|
|
13
|
+
|
|
14
|
+
},
|
|
15
|
+
'insertBeforeLast':false,
|
|
16
|
+
'za':false,
|
|
17
|
+
'selector':null
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var options = $.extend(defaults, options); // jshint ignore:line
|
|
21
|
+
|
|
22
|
+
return this.each(function() {
|
|
23
|
+
|
|
24
|
+
if(!$ul){
|
|
25
|
+
|
|
26
|
+
return false;
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// From here on in, it's "normal" jQuery
|
|
31
|
+
|
|
32
|
+
var $li = $(this); // new item
|
|
33
|
+
var $lis;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if(options.selector){
|
|
37
|
+
|
|
38
|
+
$lis = $ul.children(options.selector); // existing items
|
|
39
|
+
|
|
40
|
+
} else {
|
|
41
|
+
|
|
42
|
+
$lis = $ul.children(); // existing items
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var newHtml = options.sortFn($li);
|
|
47
|
+
|
|
48
|
+
if($lis.length === 0){
|
|
49
|
+
|
|
50
|
+
$li.appendTo($ul);
|
|
51
|
+
|
|
52
|
+
return;
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
$lis.each(function(k,e){
|
|
57
|
+
|
|
58
|
+
var $t = $(this);
|
|
59
|
+
|
|
60
|
+
// meta hack for skip
|
|
61
|
+
if($t.data('insertIntoListSkip') === true){
|
|
62
|
+
|
|
63
|
+
return true;
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var isLast = $t.is( ":last-child" );
|
|
68
|
+
var current = options.sortFn($t);
|
|
69
|
+
|
|
70
|
+
if(options.insertBeforeLast && isLast){
|
|
71
|
+
|
|
72
|
+
// insert before last child
|
|
73
|
+
$li.insertBefore($t);
|
|
74
|
+
|
|
75
|
+
return false;
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if(options.za){
|
|
80
|
+
|
|
81
|
+
if(current < newHtml){
|
|
82
|
+
|
|
83
|
+
$li.insertBefore($t);
|
|
84
|
+
|
|
85
|
+
return false;
|
|
86
|
+
|
|
87
|
+
} else {
|
|
88
|
+
|
|
89
|
+
// continue if it is not the last item
|
|
90
|
+
if(!isLast){
|
|
91
|
+
|
|
92
|
+
return true;
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// it is the last item
|
|
97
|
+
if(options.insertBeforeLast){
|
|
98
|
+
|
|
99
|
+
$li.insertBefore($t);
|
|
100
|
+
|
|
101
|
+
} else {
|
|
102
|
+
|
|
103
|
+
$li.insertAfter($t);
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
} else {
|
|
110
|
+
|
|
111
|
+
if(current > newHtml){
|
|
112
|
+
|
|
113
|
+
$li.insertBefore($t);
|
|
114
|
+
|
|
115
|
+
return false;
|
|
116
|
+
|
|
117
|
+
} else {
|
|
118
|
+
|
|
119
|
+
// continue if it is not the last item
|
|
120
|
+
if(!isLast){
|
|
121
|
+
|
|
122
|
+
return true;
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// it is the last item
|
|
127
|
+
if(options.insertBeforeLast){
|
|
128
|
+
|
|
129
|
+
$li.insertBefore($t);
|
|
130
|
+
|
|
131
|
+
} else {
|
|
132
|
+
|
|
133
|
+
$li.insertAfter($t);
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
}); // each CORE
|
|
145
|
+
|
|
146
|
+
} // xoSelect Function
|
|
147
|
+
|
|
148
|
+
}); // extend
|
|
149
|
+
|
|
150
|
+
})();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import ui from '#ui';
|
|
2
|
+
|
|
3
|
+
export default (tags)=>{
|
|
4
|
+
|
|
5
|
+
if(typeof(tags) === 'string'){
|
|
6
|
+
|
|
7
|
+
tags = [ tags ];
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const $tags = $('<div class="tags"></div>');
|
|
12
|
+
|
|
13
|
+
tags.forEach((tag)=>{
|
|
14
|
+
|
|
15
|
+
const catClass = `category-${ui.tag.category(tag)}`;
|
|
16
|
+
|
|
17
|
+
const $tag = $(`<span class="tag ${catClass}">${tag}</span>`).appendTo($tags);
|
|
18
|
+
|
|
19
|
+
if(typeof tag.callback === 'function'){
|
|
20
|
+
|
|
21
|
+
$tag.click(()=>{
|
|
22
|
+
|
|
23
|
+
tag.callback(tag, catClass);
|
|
24
|
+
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return $tags;
|
|
32
|
+
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ui from '#ui';
|
|
2
|
+
// awesomeness import 'insertIntoList';
|
|
3
|
+
|
|
4
|
+
export default ({
|
|
5
|
+
tags,
|
|
6
|
+
title = 'Categories',
|
|
7
|
+
onClick = (tag)=>{}
|
|
8
|
+
})=>{
|
|
9
|
+
|
|
10
|
+
const $area = $('<div class="tag-map"></div>').appendTo('body');
|
|
11
|
+
|
|
12
|
+
let $categoriesH = $(`<h1 class="">${title}</h1>`).appendTo($area);
|
|
13
|
+
let $categories = $(`<div class="tag-list"></div>`).appendTo($area);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
let allLength = tags.length;
|
|
17
|
+
|
|
18
|
+
tags.forEach((tag) => {
|
|
19
|
+
|
|
20
|
+
const tagCat = ui.tag.category(tag.name);
|
|
21
|
+
|
|
22
|
+
let $tag = $(`<div class="tag category-${tagCat}">${tag.name} <span>${tag.count}</span></div>`)
|
|
23
|
+
.data('tagCount', tag.count)
|
|
24
|
+
.data('tag', tag.name)
|
|
25
|
+
.insertIntoList($categories,{
|
|
26
|
+
za: true,
|
|
27
|
+
sortFn: ($elm)=>{
|
|
28
|
+
|
|
29
|
+
return $elm.data('tagCount') * 1;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
}).click(()=>{
|
|
33
|
+
|
|
34
|
+
onClick(tag);
|
|
35
|
+
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return $area;
|
|
41
|
+
|
|
42
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// awesomeness import 'insertIntoList';
|
|
2
|
+
|
|
3
|
+
export default ({
|
|
4
|
+
datas,
|
|
5
|
+
title = 'Categories',
|
|
6
|
+
onClick = (category)=>{}
|
|
7
|
+
})=>{
|
|
8
|
+
|
|
9
|
+
let categories = {};
|
|
10
|
+
|
|
11
|
+
datas.forEach(function(thing){
|
|
12
|
+
|
|
13
|
+
thing.tags.forEach(function(tag){
|
|
14
|
+
|
|
15
|
+
if(!categories[tag]) categories[tag] = [];
|
|
16
|
+
categories[tag].push(thing);
|
|
17
|
+
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const $area = $('<div class="tag-map"></div>').appendTo('body');
|
|
23
|
+
|
|
24
|
+
$(`<h1>${title}</h1>`).appendTo($area);
|
|
25
|
+
let $tagMap = $('<div class="tag-map"></div>').appendTo($area);
|
|
26
|
+
|
|
27
|
+
function tagCategory(tag){
|
|
28
|
+
|
|
29
|
+
return tag
|
|
30
|
+
.toLowerCase() // Convert to lowercase
|
|
31
|
+
.replace(/[^a-z\s]/g, '') // Remove non a-z characters
|
|
32
|
+
.replace(/\s+/g, '-'); // Replace spaces with hyphens
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let allLength = datas.length;
|
|
37
|
+
|
|
38
|
+
categories['all'] = datas;
|
|
39
|
+
|
|
40
|
+
$.each(categories, function(category, things){
|
|
41
|
+
|
|
42
|
+
const tagCat = tagCategory(category);
|
|
43
|
+
|
|
44
|
+
let $category = $(`<div class="category tag category-${tagCat}">${category} <span>${things.length}</span></div>`)
|
|
45
|
+
.data('categoryCount', things.length)
|
|
46
|
+
.data('category', category)
|
|
47
|
+
.insertIntoList($tagMap,{
|
|
48
|
+
za: true,
|
|
49
|
+
sortFn: ($elm)=>{
|
|
50
|
+
|
|
51
|
+
return $elm.data('categoryCount') * 1;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
}).click(()=>{
|
|
55
|
+
|
|
56
|
+
onClick(category);
|
|
57
|
+
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return $area;
|
|
63
|
+
|
|
64
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.tag-map {
|
|
2
|
+
display: block;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow-x: hidden;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.tag-map .tag-list {
|
|
9
|
+
margin-top: 20px;
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tag-map .tag-list .tag {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.app-size-p .tag-list .category {
|
|
18
|
+
font-size: 1em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.app-size-t .tag-list .category {
|
|
22
|
+
font-size: 1.2em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tag-map .tag {
|
|
26
|
+
background-color: #ffffff;
|
|
27
|
+
color: #2b2b2b;
|
|
28
|
+
padding: 12px 20px;
|
|
29
|
+
margin-right: 10px;
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
border-radius: 3px;
|
|
32
|
+
border: solid 1px #dddddd;
|
|
33
|
+
font-size: 1.5em;
|
|
34
|
+
font-weight: 300;
|
|
35
|
+
font-family: Raleway;
|
|
36
|
+
letter-spacing: 3px;
|
|
37
|
+
transition: all 200ms ease-in-out;
|
|
38
|
+
position: relative;
|
|
39
|
+
padding-right: 50px;
|
|
40
|
+
display: inline-block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tag-map .tag:hover {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tag-map .tag span {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 10px;
|
|
50
|
+
right: 10px;
|
|
51
|
+
font-size: 0.6em;
|
|
52
|
+
background-color: #ffffff;
|
|
53
|
+
color: #777;
|
|
54
|
+
width: 32px;
|
|
55
|
+
height: 32px;
|
|
56
|
+
text-align: center;
|
|
57
|
+
border-radius: 33px;
|
|
58
|
+
padding-top: 7px;
|
|
59
|
+
padding-left: 3px;
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.tags{
|
|
2
|
+
margin-top: 10px;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tags span {
|
|
7
|
+
font-family: 'Raleway';
|
|
8
|
+
font-size: 0.8em;
|
|
9
|
+
padding: 5px 8px;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
margin-right: 6px;
|
|
12
|
+
border: solid 1px #e4e4e4;
|
|
13
|
+
margin-bottom: 6px;
|
|
14
|
+
display: inline-block;
|
|
15
|
+
color: #777;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tags span:hover {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#app {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
background-color: #fdfdfd
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
* {
|
|
8
|
+
-webkit-box-sizing: border-box;
|
|
9
|
+
-moz-box-sizing: border-box;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
|
|
12
|
+
-webkit-tap-highlight-color: transparent;
|
|
13
|
+
-ms-touch-action: manipulation;
|
|
14
|
+
touch-action: manipulation;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html {
|
|
18
|
+
width:100%;
|
|
19
|
+
height:100%;
|
|
20
|
+
margin:0;
|
|
21
|
+
padding:0;
|
|
22
|
+
font-family: 'Montserrat', 'Work Sans', sans-serif;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
width:100%;
|
|
27
|
+
height:100%;
|
|
28
|
+
overflow-x:hidden;
|
|
29
|
+
margin:0;
|
|
30
|
+
padding:0;
|
|
31
|
+
/* stupid iphone notches */
|
|
32
|
+
padding-top: constant(safe-area-inset-top); /* iOS 11.0 */
|
|
33
|
+
padding-top: env(safe-area-inset-top); /* iOS 11.2 */
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h1, h2, h3, h4, h5, h6 {
|
|
37
|
+
font-weight:normal;
|
|
38
|
+
margin:0;
|
|
39
|
+
padding:0;
|
|
40
|
+
width:100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[class^="ico"] { line-height: 0px; }
|
|
44
|
+
|
|
45
|
+
a {
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
color: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.no-select, .no-select * {
|
|
51
|
+
-webkit-touch-callout: none;
|
|
52
|
+
-webkit-user-select: none;
|
|
53
|
+
-khtml-user-select: none;
|
|
54
|
+
-moz-user-select: none;
|
|
55
|
+
-ms-user-select: none;
|
|
56
|
+
user-select: none;
|
|
57
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default function(sizes = [
|
|
2
|
+
'xl',
|
|
3
|
+
'd',
|
|
4
|
+
't',
|
|
5
|
+
'p'
|
|
6
|
+
], max = 12) {
|
|
7
|
+
|
|
8
|
+
let data = ` `;
|
|
9
|
+
|
|
10
|
+
// dynamic display
|
|
11
|
+
data += ".flex { display: flex; } ";
|
|
12
|
+
data += ".flex-wrap { flex-wrap: wrap; } ";
|
|
13
|
+
|
|
14
|
+
for (let i = 1; i <= max; i++) {
|
|
15
|
+
|
|
16
|
+
// float
|
|
17
|
+
data += `.flex-${i} { flex:${i} ; } `;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
sizes.forEach((s) => {
|
|
22
|
+
|
|
23
|
+
for (let i = 1; i <= max; i++) {
|
|
24
|
+
|
|
25
|
+
// float
|
|
26
|
+
data += `.app-size-${s} .flex-${i}-${s} { flex:${i} ; } `;
|
|
27
|
+
data += `.app-size-${s} .flex-wrap-${s} { flex-wrap: wrap; } `;
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
return data;
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
export default function({
|
|
2
|
+
sizes = [
|
|
3
|
+
'xl',
|
|
4
|
+
'd',
|
|
5
|
+
't',
|
|
6
|
+
'p'
|
|
7
|
+
],
|
|
8
|
+
pixels = 126
|
|
9
|
+
} = {}) {
|
|
10
|
+
|
|
11
|
+
let data = ` `;
|
|
12
|
+
|
|
13
|
+
const grids = 12;
|
|
14
|
+
|
|
15
|
+
data += `.grid { display: grid; grid-template-columns: auto auto; } `;
|
|
16
|
+
|
|
17
|
+
// justify
|
|
18
|
+
data += `.justify-center { justify-content: center; } `;
|
|
19
|
+
data += `.justify-start { justify-content: start; } `;
|
|
20
|
+
data += `.justify-end { justify-content: end; } `;
|
|
21
|
+
data += `.justify-between { justify-content: space-between; } `;
|
|
22
|
+
data += `.justify-around { justify-content: space-around; } `;
|
|
23
|
+
data += `.justify-evenly { justify-content: space-evenly; } `;
|
|
24
|
+
|
|
25
|
+
// align
|
|
26
|
+
data += `.align-center { align-items: center; } `;
|
|
27
|
+
data += `.align-start { align-items: start; } `;
|
|
28
|
+
data += `.align-end { align-items: end; } `;
|
|
29
|
+
data += `.align-baseline { align-items: baseline; } `;
|
|
30
|
+
data += `.align-stretch { align-items: stretch; } `;
|
|
31
|
+
|
|
32
|
+
// justify-items
|
|
33
|
+
data += `.justify-items-start { justify-items: start; } `;
|
|
34
|
+
data += `.justify-items-center { justify-items: center; } `;
|
|
35
|
+
data += `.justify-items-end { justify-items: end; } `;
|
|
36
|
+
data += `.justify-items-stretch { justify-items: stretch; } `;
|
|
37
|
+
|
|
38
|
+
// justify
|
|
39
|
+
data += `.grid.center { justify-self: center; } `;
|
|
40
|
+
data += `.grid.left { justify-self: start; } `;
|
|
41
|
+
data += `.grid.right { justify-self: end; } `;
|
|
42
|
+
|
|
43
|
+
data += `.justify-self-center { justify-self: center; } `;
|
|
44
|
+
data += `.justify-self-left { justify-self: start; } `;
|
|
45
|
+
data += `.justify-self-right { justify-self: end; } `;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
data += `.span-full { grid-column: 1 / -1; } `;
|
|
49
|
+
data += `.row-span-full { grid-row: 1 / -1; } `;
|
|
50
|
+
|
|
51
|
+
sizes.forEach((s) => {
|
|
52
|
+
|
|
53
|
+
data += `.app-size-${s} .grid.center-${s} { justify-self: center; } `;
|
|
54
|
+
data += `.app-size-${s} .grid.left-${s} { justify-self: start; } `;
|
|
55
|
+
data += `.app-size-${s} .grid.right-${s} { justify-self: end; } `;
|
|
56
|
+
|
|
57
|
+
data += `.app-size-${s} .justify-self-center-${s} { justify-self: center; } `;
|
|
58
|
+
data += `.app-size-${s} .justify-self-start-${s} { justify-self: start; } `;
|
|
59
|
+
data += `.app-size-${s} .justify-self-end-${s} { justify-self: end; } `;
|
|
60
|
+
|
|
61
|
+
data += `.app-size-${s} .span-full-${s} { grid-column: 1 / -1; } `;
|
|
62
|
+
data += `.app-size-${s} .row-span-full-${s} { grid-row: 1 / -1; } `;
|
|
63
|
+
|
|
64
|
+
// justify
|
|
65
|
+
data += `.app-size-${s} .justify-center-${s} { justify-content: center; } `;
|
|
66
|
+
data += `.app-size-${s} .justify-start-${s} { justify-content: start; } `;
|
|
67
|
+
data += `.app-size-${s} .justify-end-${s} { justify-content: end; } `;
|
|
68
|
+
data += `.app-size-${s} .justify-between-${s} { justify-content: space-between; } `;
|
|
69
|
+
data += `.app-size-${s} .justify-around-${s} { justify-content: space-around; } `;
|
|
70
|
+
data += `.app-size-${s} .justify-evenly-${s} { justify-content: space-evenly; } `;
|
|
71
|
+
|
|
72
|
+
// justify-items
|
|
73
|
+
data += `.app-size-${s} .justify-items-start-${s} { justify-items: start; } `;
|
|
74
|
+
data += `.app-size-${s} .justify-items-center-${s} { justify-items: center; } `;
|
|
75
|
+
data += `.app-size-${s} .justify-items-end-${s} { justify-items: end; } `;
|
|
76
|
+
data += `.app-size-${s} .justify-items-stretch-${s} { justify-items: stretch; } `;
|
|
77
|
+
|
|
78
|
+
// align
|
|
79
|
+
data += `.app-size-${s} .align-center-${s} { align-items: center; } `;
|
|
80
|
+
data += `.app-size-${s} .align-start-${s} { align-items: start; } `;
|
|
81
|
+
data += `.app-size-${s} .align-end-${s} { align-items: end; } `;
|
|
82
|
+
data += `.app-size-${s} .align-baseline-${s} { align-items: baseline; } `;
|
|
83
|
+
data += `.app-size-${s} .align-stretch-${s} { align-items: stretch; } `;
|
|
84
|
+
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
for (let i = 1; i <= grids; i++) {
|
|
89
|
+
|
|
90
|
+
// cols
|
|
91
|
+
data += `.grid-${i} { display: grid; grid-template-columns: repeat(${i}, 1fr); } `;
|
|
92
|
+
|
|
93
|
+
// spans
|
|
94
|
+
data += `.span-${i} { grid-column: span ${i} / span ${i}; } `;
|
|
95
|
+
|
|
96
|
+
// start
|
|
97
|
+
data += `.start-${i} { grid-column-start: ${i}; } `;
|
|
98
|
+
|
|
99
|
+
// end
|
|
100
|
+
data += `.end-${i} { grid-column-end: ${i}; } `;
|
|
101
|
+
|
|
102
|
+
// rows
|
|
103
|
+
data += `.grid-rows-${i} { grid-template-rows: repeat(${i}, 1fr); } `;
|
|
104
|
+
|
|
105
|
+
// spans
|
|
106
|
+
data += `.row-span-${i} { grid-row: span ${i} / span ${i}; } `;
|
|
107
|
+
|
|
108
|
+
// start
|
|
109
|
+
data += `.row-start-${i} { grid-row-start: ${i}; } `;
|
|
110
|
+
|
|
111
|
+
// end
|
|
112
|
+
data += `.row-end-${i} { grid-row-end: ${i}; } `;
|
|
113
|
+
|
|
114
|
+
// order
|
|
115
|
+
data += `.order-${i} { order: ${i}; } `;
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
sizes.forEach((s) => {
|
|
119
|
+
|
|
120
|
+
// cols
|
|
121
|
+
data += `.app-size-${s} .grid-${i}-${s} { display: grid; grid-template-columns: repeat(${i}, 1fr); } `;
|
|
122
|
+
|
|
123
|
+
// spans
|
|
124
|
+
data += `.app-size-${s} .span-${i}-${s} { grid-column: span ${i} / span ${i}; } `;
|
|
125
|
+
|
|
126
|
+
// start
|
|
127
|
+
data += `.app-size-${s} .start-${i}-${s} { grid-column-start: ${i}; } `;
|
|
128
|
+
|
|
129
|
+
// end
|
|
130
|
+
data += `.app-size-${s} .end-${i}-${s} { grid-column-end: ${i}; } `;
|
|
131
|
+
|
|
132
|
+
// rows
|
|
133
|
+
data += `.app-size-${s} .grid-rows-${i}-${s} { grid-template-rows: repeat(${i}, 1fr); } `;
|
|
134
|
+
|
|
135
|
+
// spans
|
|
136
|
+
data += `.app-size-${s} .row-span-${i}-${s} { grid-row: span ${i} / span ${i}; } `;
|
|
137
|
+
|
|
138
|
+
// start
|
|
139
|
+
data += `.app-size-${s} .row-start-${i}-${s} { grid-row-start: ${i}; } `;
|
|
140
|
+
|
|
141
|
+
// end
|
|
142
|
+
data += `.app-size-${s} .row-end-${i}-${s} { grid-row-end: ${i}; } `;
|
|
143
|
+
|
|
144
|
+
// order
|
|
145
|
+
data += `.app-size-${s} .order-${i}-${s} { order: ${i}; } `;
|
|
146
|
+
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// add and extra for start and end for both col and row
|
|
152
|
+
data += `.start-${grids +1} { grid-column-start: ${grids +1}; } `;
|
|
153
|
+
data += `.end-${grids +1} { grid-column-end: ${grids +1}; } `;
|
|
154
|
+
|
|
155
|
+
sizes.forEach((s) => {
|
|
156
|
+
|
|
157
|
+
data += `.app-size-${s} .start-${grids +1}-${s} { grid-column-start: ${grids +1}; } `;
|
|
158
|
+
data += `.app-size-${s} .end-${grids +1}-${s} { grid-column-end: ${grids +1}; } `;
|
|
159
|
+
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
// gap
|
|
164
|
+
for(let i = 1; i <= pixels; i++) {
|
|
165
|
+
|
|
166
|
+
data += `.gap-${i} { gap: ${i}px; } `;
|
|
167
|
+
data += `.gap-x-${i} { column-gap: ${i}px; } `;
|
|
168
|
+
data += `.gap-y-${i} { row-gap: ${i}px; } `;
|
|
169
|
+
|
|
170
|
+
sizes.forEach((s) => {
|
|
171
|
+
|
|
172
|
+
data += `.app-size-${s} .gap-${i}-${s} { gap: ${i}px; } `;
|
|
173
|
+
data += `.app-size-${s} .gap-x-${i}-${s} { column-gap: ${i}px; } `;
|
|
174
|
+
data += `.app-size-${s} .gap-y-${i}-${s} { row-gap: ${i}px; } `;
|
|
175
|
+
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
data += ` `;
|
|
182
|
+
|
|
183
|
+
return data;
|
|
184
|
+
|
|
185
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export default function(sizes = [
|
|
2
|
+
'xl',
|
|
3
|
+
'd',
|
|
4
|
+
't',
|
|
5
|
+
'p'
|
|
6
|
+
]) {
|
|
7
|
+
|
|
8
|
+
let data = ` `;
|
|
9
|
+
|
|
10
|
+
// dynamic display
|
|
11
|
+
data += ".hidden {display: none !important;} ";
|
|
12
|
+
data += ".fl{float:left !important;} ";
|
|
13
|
+
data += ".fr{float:right !important;} ";
|
|
14
|
+
data += ".m0a{margin: 0 auto;} ";
|
|
15
|
+
|
|
16
|
+
// cursor pointer
|
|
17
|
+
data += ".cursor-pointer {cursor: pointer !important;} ";
|
|
18
|
+
data += ".cursor-default {cursor: default !important;} ";
|
|
19
|
+
|
|
20
|
+
// position
|
|
21
|
+
data += ".absolute {position:absolute !important;} ";
|
|
22
|
+
data += ".relative {position:relative !important;} ";
|
|
23
|
+
data += ".fixed {position:fixed !important;} ";
|
|
24
|
+
data += ".sticky {position:sticky !important;} ";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
sizes.forEach((s) => {
|
|
28
|
+
|
|
29
|
+
data += `.app-size-${s} .hidden-${s} {display: none !important;} `;
|
|
30
|
+
|
|
31
|
+
data += `.app-size-${s} .cursor-pointer-${s} {cursor: pointer !important;} `;
|
|
32
|
+
data += `.app-size-${s} .cursor-default${s} {cursor: default !important;} `;
|
|
33
|
+
|
|
34
|
+
data += `.app-size-${s} .fl {float:left !important;} `;
|
|
35
|
+
data += `.app-size-${s} .fr {float:right !important;} `;
|
|
36
|
+
|
|
37
|
+
data += `.app-size-${s} .absolute {position:absolute !important;} `;
|
|
38
|
+
data += `.app-size-${s} .relative {position:relative !important;} `;
|
|
39
|
+
data += `.app-size-${s} .fixed {position:fixed !important;} `;
|
|
40
|
+
data += `.app-size-${s} .sticky {position:sticky !important;} `;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return data;
|
|
47
|
+
|
|
48
|
+
}
|