create-template-bricks 0.0.0-stage → 1.0.1
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 +85 -2
- package/bin/cli.js +403 -0
- package/package.json +49 -4
- package/templates/base/.babelrc +18 -0
- package/templates/base/.editorconfig +22 -0
- package/templates/base/.eslintrc.json +130 -0
- package/templates/base/AGENTS.md +49 -0
- package/templates/base/README.md +121 -0
- package/templates/base/gulpfile.js +46 -0
- package/templates/base/package.json +82 -0
- package/templates/base/postcss.config.mjs +6 -0
- package/templates/base/src/assets/css/vendor/.gitkeep +0 -0
- package/templates/base/src/assets/fonts/.gitkeep +0 -0
- package/templates/base/src/assets/img/Logo.svg +32 -0
- package/templates/base/src/assets/img/favicons/favicon.ico +0 -0
- package/templates/base/src/assets/img/sprite/cup-bronze.png +0 -0
- package/templates/base/src/assets/img/sprite/cup-bronze@2x.png +0 -0
- package/templates/base/src/assets/img/sprite.png +0 -0
- package/templates/base/src/assets/img/sprite@2x.png +0 -0
- package/templates/base/src/assets/img/svg-sprite/close.svg +3 -0
- package/templates/base/src/assets/img/svg-sprite/favorite.svg +3 -0
- package/templates/base/src/assets/img/svg-sprite/keyboard.svg +3 -0
- package/templates/base/src/assets/js/vendor/.gitkeep +0 -0
- package/templates/base/src/styles/core/base.scss +31 -0
- package/templates/base/src/styles/core/extends.scss +11 -0
- package/templates/base/src/styles/core/fonts.scss +0 -0
- package/templates/base/src/styles/core/index.scss +10 -0
- package/templates/base/src/styles/core/keyframes.scss +49 -0
- package/templates/base/src/styles/core/layouts/footer.scss +1 -0
- package/templates/base/src/styles/core/layouts/header/index.scss +1 -0
- package/templates/base/src/styles/core/layouts/index.scss +2 -0
- package/templates/base/src/styles/core/page.scss +16 -0
- package/templates/base/src/styles/core/typography.scss +1 -0
- package/templates/base/src/styles/core/ui/icons.scss +31 -0
- package/templates/base/src/styles/core/ui/index.scss +2 -0
- package/templates/base/src/styles/core/ui/scrollbar.scss +14 -0
- package/templates/base/src/styles/core/variables.scss +41 -0
- package/templates/base/src/styles/index.scss +1 -0
- package/templates/base/src/styles/plugins/functions.scss +0 -0
- package/templates/base/src/styles/plugins/media.scss +63 -0
- package/templates/base/src/styles/plugins/mixins.scss +31 -0
- package/templates/base/src/styles/plugins/sprite-mixin.scss +75 -0
- package/templates/base/src/styles/plugins/sprite.scss +154 -0
- package/templates/base/src/styles.scss +2 -0
- package/templates/base/src/tailwind.css +1 -0
- package/templates/base/src/tmplConfig.js +22 -0
- package/templates/base/tailwind.config.js +23 -0
- package/templates/base/tasks/archive.js +37 -0
- package/templates/base/tasks/clean.js +17 -0
- package/templates/base/tasks/config.js +98 -0
- package/templates/base/tasks/copy.js +53 -0
- package/templates/base/tasks/helper.js +31 -0
- package/templates/base/tasks/images/image-optimize.js +46 -0
- package/templates/base/tasks/images/index.js +27 -0
- package/templates/base/tasks/images/plugins/optimize-raster.js +44 -0
- package/templates/base/tasks/images/png-sprite.js +43 -0
- package/templates/base/tasks/template/data.js +28 -0
- package/templates/base/tasks/template/index.js +48 -0
- package/templates/base/tasks/template/plugins/generate-static-path.js +37 -0
- package/templates/base/tasks/template/plugins/nunjucks-relative-paths-includes.js +39 -0
- package/templates/base/tasks/template/plugins/nunjucks-relative-system-loader.js +28 -0
- package/templates/base/tasks/template/plugins/template-dependencies.js +246 -0
- package/templates/base/tasks/template/template.js +172 -0
- package/templates/base/tasks/watcher.js +233 -0
- package/templates/base/tasks/webpack/env.js +21 -0
- package/templates/base/tasks/webpack/plugins/build-status-plugin.js +74 -0
- package/templates/base/tasks/webpack/plugins/current-color-plugin.js +225 -0
- package/templates/base/tasks/webpack/plugins/removeFilesOnlyJs.js +28 -0
- package/templates/base/tasks/webpack/scripts.config.js +147 -0
- package/templates/base/tasks/webpack/styles.config.js +126 -0
- package/templates/base/tasks/webpack/svg-sprite.config.js +95 -0
- package/templates/base/tasks/webpack/watch.js +50 -0
- package/templates/base/tsconfig.json +20 -0
- package/templates/base/user.config.js +102 -0
- package/templates/base/webpack.config.js +9 -0
- package/templates/template-js/js/api/api.js +0 -0
- package/templates/template-js/js/core/core.js +56 -0
- package/templates/template-js/js/main.js +6 -0
- package/templates/template-js/js/modules/header.js +15 -0
- package/templates/template-js/js/modules/index.js +24 -0
- package/templates/template-js/js/services/index.js +1 -0
- package/templates/template-js/js/services/query-params.js +19 -0
- package/templates/template-js/js/styles.js +2 -0
- package/templates/template-js/js/ui/index.js +18 -0
- package/templates/template-js/js/utils/constants.js +0 -0
- package/templates/template-js/js/utils/create-factory.js +65 -0
- package/templates/template-js/js/utils/debounce.js +8 -0
- package/templates/template-js/js/utils/delay.js +4 -0
- package/templates/template-js/js/utils/is-platform.js +15 -0
- package/templates/template-js/js/utils/throttle.js +16 -0
- package/templates/template-mjml/emails/assets/images/address-btn.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/address.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/banner.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/close.png +0 -0
- package/templates/template-mjml/emails/assets/images/confirm-btn.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/facebook.png +0 -0
- package/templates/template-mjml/emails/assets/images/forgot.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/icon-info.png +0 -0
- package/templates/template-mjml/emails/assets/images/img-send.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/instagram.png +0 -0
- package/templates/template-mjml/emails/assets/images/logo.png +0 -0
- package/templates/template-mjml/emails/assets/images/reset-btn.jpg +0 -0
- package/templates/template-mjml/emails/assets/images/twitter.png +0 -0
- package/templates/template-mjml/emails/pages/address.mjml +55 -0
- package/templates/template-mjml/emails/pages/confirm-resend.mjml +63 -0
- package/templates/template-mjml/emails/pages/confirm.mjml +44 -0
- package/templates/template-mjml/emails/pages/forgot-password.mjml +65 -0
- package/templates/template-mjml/emails/shared/ui/head/fonts.mjml +211 -0
- package/templates/template-mjml/emails/shared/ui/head/index.mjml +146 -0
- package/templates/template-mjml/emails/widgets/footer/ui/index.mjml +12 -0
- package/templates/template-nunjucks/templates/layouts/base.njk +23 -0
- package/templates/template-nunjucks/templates/pages/index.njk +9 -0
- package/templates/template-nunjucks/templates/shared/ui/head/data.json +8 -0
- package/templates/template-nunjucks/templates/shared/ui/head/index.njk +13 -0
- package/templates/template-nunjucks/templates/shared/ui/icon/index.njk +5 -0
- package/templates/template-nunjucks/templates/widgets/footer/index.njk +5 -0
- package/templates/template-nunjucks/templates/widgets/footer/model/data.json +4 -0
- package/templates/template-nunjucks/templates/widgets/footer/ui/index.njk +7 -0
- package/templates/template-nunjucks/templates/widgets/home-hero/index.njk +1 -0
- package/templates/template-nunjucks/templates/widgets/home-hero/ui/index.njk +9 -0
- package/templates/template-pug/templates/layouts/base.pug +19 -0
- package/templates/template-pug/templates/pages/index.pug +12 -0
- package/templates/template-pug/templates/shared/lib/blocks.pug +21 -0
- package/templates/template-pug/templates/shared/ui/head/data.json +8 -0
- package/templates/template-pug/templates/shared/ui/head/index.pug +10 -0
- package/templates/template-pug/templates/shared/ui/icon/index.pug +3 -0
- package/templates/template-pug/templates/widgets/footer/index.pug +1 -0
- package/templates/template-pug/templates/widgets/footer/model/data.json +4 -0
- package/templates/template-pug/templates/widgets/footer/ui/index.pug +4 -0
- package/templates/template-pug/templates/widgets/home-hero/index.pug +1 -0
- package/templates/template-pug/templates/widgets/home-hero/ui/index.pug +6 -0
- package/templates/template-ts/ts/api/api.ts +0 -0
- package/templates/template-ts/ts/core/core.ts +66 -0
- package/templates/template-ts/ts/interfaces/factory.ts +5 -0
- package/templates/template-ts/ts/main.ts +6 -0
- package/templates/template-ts/ts/modules/header.ts +17 -0
- package/templates/template-ts/ts/modules/index.ts +26 -0
- package/templates/template-ts/ts/services/index.ts +2 -0
- package/templates/template-ts/ts/services/query-params.ts +23 -0
- package/templates/template-ts/ts/styles.ts +2 -0
- package/templates/template-ts/ts/ui/index.ts +23 -0
- package/templates/template-ts/ts/utils/constants.ts +0 -0
- package/templates/template-ts/ts/utils/create-factory.ts +91 -0
- package/templates/template-ts/ts/utils/debounce.ts +10 -0
- package/templates/template-ts/ts/utils/delay.ts +5 -0
- package/templates/template-ts/ts/utils/is-platform.ts +21 -0
- package/templates/template-ts/ts/utils/throttle.ts +19 -0
- package/templates/template-twig/templates/layouts/base.html.twig +26 -0
- package/templates/template-twig/templates/pages/index.html.twig +8 -0
- package/templates/template-twig/templates/shared/ui/head/data.json +8 -0
- package/templates/template-twig/templates/shared/ui/head/index.html.twig +11 -0
- package/templates/template-twig/templates/shared/ui/icon/index.html.twig +21 -0
- package/templates/template-twig/templates/widgets/footer/index.html.twig +1 -0
- package/templates/template-twig/templates/widgets/footer/model/data.json +4 -0
- package/templates/template-twig/templates/widgets/footer/ui/index.html.twig +5 -0
- package/templates/template-twig/templates/widgets/home-hero/index.html.twig +1 -0
- package/templates/template-twig/templates/widgets/home-hero/ui/index.html.twig +9 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const isTouchDevices = (): boolean => {
|
|
2
|
+
const win = window as Window & { DocumentTouch?: unknown };
|
|
3
|
+
|
|
4
|
+
return ('ontouchstart' in window) || (typeof win.DocumentTouch !== 'undefined');
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const isMobile = () => {
|
|
8
|
+
return /iPhone|iPad|Android|blackberry|windows phone|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const isIOS = () => {
|
|
12
|
+
return /iPad|iPhone|iPod/i.test(navigator.userAgent);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const isPlatformClasses = () => {
|
|
16
|
+
const root = document.documentElement;
|
|
17
|
+
|
|
18
|
+
root.classList.toggle('is-touch', isTouchDevices());
|
|
19
|
+
root.classList.toggle('is-mobile', isMobile());
|
|
20
|
+
root.classList.toggle('ios', isIOS());
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const throttle = (cb, delay) => {
|
|
2
|
+
let timeoutId = null;
|
|
3
|
+
let lastArgs;
|
|
4
|
+
let lastContext;
|
|
5
|
+
|
|
6
|
+
return function (...args) {
|
|
7
|
+
lastArgs = args;
|
|
8
|
+
lastContext = this as unknown;
|
|
9
|
+
|
|
10
|
+
if (!timeoutId) {
|
|
11
|
+
timeoutId = setTimeout(() => {
|
|
12
|
+
cb.apply(lastContext, lastArgs);
|
|
13
|
+
timeoutId = null;
|
|
14
|
+
}, delay);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default throttle;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="{{ lang }}">
|
|
3
|
+
{% include "../shared/ui/head/index.html.twig" with {
|
|
4
|
+
data: head.default,
|
|
5
|
+
page: page,
|
|
6
|
+
PATH: pathPrefix
|
|
7
|
+
} %}
|
|
8
|
+
<body>
|
|
9
|
+
%symbols%
|
|
10
|
+
<div class="page-wrapper">
|
|
11
|
+
{% block header %}{% endblock %}
|
|
12
|
+
|
|
13
|
+
<main class="page-content">
|
|
14
|
+
{% block content %}{% endblock %}
|
|
15
|
+
</main>
|
|
16
|
+
|
|
17
|
+
{% block footer %}
|
|
18
|
+
{% include "../widgets/footer/index.html.twig" %}
|
|
19
|
+
{% endblock %}
|
|
20
|
+
</div>
|
|
21
|
+
{% block scripts %}
|
|
22
|
+
<script src="{{ staticPath.js }}/vendor.js{{ version }}"></script>
|
|
23
|
+
<script src="{{ staticPath.js }}/main.js{{ version }}"></script>
|
|
24
|
+
{% endblock %}
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<meta charset="utf-8"/>
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
4
|
+
<title>{{ page.title ?? data.title }}</title>
|
|
5
|
+
<meta name="description" content="{{ data.description }}"/>
|
|
6
|
+
{% block styles %}
|
|
7
|
+
<link href="{{ staticPath.css }}/vendor.css{{ version }}" rel="stylesheet">
|
|
8
|
+
<link href="{{ staticPath.css }}/styles.css{{ version }}" rel="stylesheet">
|
|
9
|
+
{% endblock %}
|
|
10
|
+
<link rel="apple-touch-icon" sizes="57x57" href="{{ staticPath.img }}/favicons/favicon.ico"/>
|
|
11
|
+
</head>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% macro icon(name, width = null, height = null, attributes = {}) %}
|
|
2
|
+
{% set height = height ?? width %}
|
|
3
|
+
|
|
4
|
+
{% set href = symbolsInject
|
|
5
|
+
? '#' ~ name
|
|
6
|
+
: (PATH ?? pathPrefix ?? '') ~ 'assets/img/symbols.svg' ~ (version ?? '') ~ '#' ~ name
|
|
7
|
+
%}
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
class="icon icon-{{ name }}{% if attributes.class is defined %} {{ attributes.class }}{% endif %}"
|
|
11
|
+
{% if width %}width="{{ width }}"{% endif %}
|
|
12
|
+
{% if height %}height="{{ height }}"{% endif %}
|
|
13
|
+
{% for key, value in attributes %}
|
|
14
|
+
{% if key != 'class' %}
|
|
15
|
+
{{ key }}="{{ value }}"
|
|
16
|
+
{% endif %}
|
|
17
|
+
{% endfor %}
|
|
18
|
+
>
|
|
19
|
+
<use xlink:href="{{ href }}"></use>
|
|
20
|
+
</svg>
|
|
21
|
+
{% endmacro %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include "./ui/index.html.twig" %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include "./ui/index.html.twig" %}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class="container">
|
|
2
|
+
<div class="mt-12">
|
|
3
|
+
<img src="{{ images.logo }}" width="200" alt="">
|
|
4
|
+
</div>
|
|
5
|
+
<h1 class="text-4xl md:text-[120px] font-bold">{{ page.title }}</h1>
|
|
6
|
+
<p class="mt-10">
|
|
7
|
+
Create projects from ready-to-use frontend templates.
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|