create-qwik 1.1.5 → 1.2.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/index.cjs +63 -62
- package/package.json +1 -1
- package/starters/apps/base/.eslintrc.cjs +23 -22
- package/starters/apps/base/.vscode/launch.json +2 -2
- package/starters/apps/base/.vscode/qwik-city.code-snippets +5 -13
- package/starters/apps/base/.vscode/qwik.code-snippets +77 -95
- package/starters/apps/base/.vscode/settings.json +3 -0
- package/starters/apps/base/README.md +5 -5
- package/starters/apps/base/gitignore +3 -1
- package/starters/apps/base/package.json +9 -9
- package/starters/apps/base/src/entry.dev.tsx +2 -2
- package/starters/apps/base/src/entry.preview.tsx +3 -3
- package/starters/apps/base/src/entry.ssr.tsx +7 -4
- package/starters/apps/base/src/global.css +3 -3
- package/starters/apps/base/src/routes/service-worker.ts +3 -4
- package/starters/apps/base/tsconfig.json +1 -1
- package/starters/apps/base/vite.config.ts +5 -5
- package/starters/apps/basic/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/basic/src/components/starter/counter/counter.tsx +12 -6
- package/starters/apps/basic/src/components/starter/footer/footer.tsx +3 -3
- package/starters/apps/basic/src/components/starter/gauge/index.tsx +9 -3
- package/starters/apps/basic/src/components/starter/header/header.tsx +16 -7
- package/starters/apps/basic/src/components/starter/hero/hero.module.css +10 -0
- package/starters/apps/basic/src/components/starter/hero/hero.tsx +16 -9
- package/starters/apps/basic/src/components/starter/icons/qwik.tsx +7 -1
- package/starters/apps/basic/src/components/starter/infobox/infobox.tsx +2 -2
- package/starters/apps/basic/src/components/starter/next-steps/next-steps.tsx +25 -15
- package/starters/apps/basic/src/global.css +3 -3
- package/starters/apps/basic/src/media/thunder.png +0 -0
- package/starters/apps/basic/src/root.tsx +10 -6
- package/starters/apps/basic/src/routes/demo/flower/flower.css +3 -1
- package/starters/apps/basic/src/routes/demo/flower/index.tsx +12 -7
- package/starters/apps/basic/src/routes/demo/todolist/index.tsx +12 -8
- package/starters/apps/basic/src/routes/index.tsx +10 -10
- package/starters/apps/basic/src/routes/layout.tsx +6 -6
- package/starters/apps/basic/src/routes/service-worker.ts +3 -3
- package/starters/apps/basic/src/routes/styles.css +4 -4
- package/starters/apps/empty/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/empty/src/root.tsx +9 -5
- package/starters/apps/empty/src/routes/index.tsx +5 -5
- package/starters/apps/empty/src/routes/layout.tsx +2 -2
- package/starters/apps/empty/src/routes/service-worker.ts +3 -3
- package/starters/apps/library/.eslintrc.cjs +21 -21
- package/starters/apps/library/package.json +7 -7
- package/starters/apps/library/src/components/counter/counter.tsx +1 -1
- package/starters/apps/library/src/components/logo/logo.tsx +1 -1
- package/starters/apps/library/src/entry.dev.tsx +2 -2
- package/starters/apps/library/src/entry.ssr.tsx +6 -3
- package/starters/apps/library/src/index.ts +2 -2
- package/starters/apps/library/src/root.tsx +2 -2
- package/starters/apps/library/vite.config.ts +6 -6
- package/starters/apps/site-with-visual-cms/README.md +15 -0
- package/starters/apps/site-with-visual-cms/package.json +2 -2
- package/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +15 -5
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css +0 -1
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +7 -7
- package/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +9 -3
- package/starters/apps/site-with-visual-cms/src/components/header/header.tsx +15 -6
- package/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +7 -1
- package/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/entry.dev.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/entry.preview.tsx +3 -3
- package/starters/apps/site-with-visual-cms/src/entry.ssr.tsx +7 -4
- package/starters/apps/site-with-visual-cms/src/global.css +3 -3
- package/starters/apps/site-with-visual-cms/src/root.tsx +10 -6
- package/starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx +11 -7
- package/starters/apps/site-with-visual-cms/src/routes/layout.tsx +3 -3
- package/starters/apps/site-with-visual-cms/src/routes/service-worker.ts +3 -3
- package/starters/apps/site-with-visual-cms/vite.config.ts +4 -4
- package/starters/apps/site-with-visual-cms/builder-integration.ts +0 -853
|
@@ -1,96 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
" track(() => $1);",
|
|
80
|
-
" $0",
|
|
81
|
-
"});",
|
|
82
|
-
""
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"useResource": {
|
|
86
|
-
"scope": "javascriptreact,typescriptreact",
|
|
87
|
-
"prefix": "quseResource$",
|
|
88
|
-
"description": "useResource$() declaration",
|
|
89
|
-
"body": [
|
|
90
|
-
"const $1 = useResource$(({ track, cleanup }) => {",
|
|
91
|
-
" $0",
|
|
92
|
-
"});",
|
|
93
|
-
""
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
2
|
+
"Qwik component (simple)": {
|
|
3
|
+
"scope": "javascriptreact,typescriptreact",
|
|
4
|
+
"prefix": "qcomponent$",
|
|
5
|
+
"description": "Simple Qwik component",
|
|
6
|
+
"body": [
|
|
7
|
+
"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {",
|
|
8
|
+
" return <${2:div}>$4</$2>",
|
|
9
|
+
"});"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"Qwik component (props)": {
|
|
13
|
+
"scope": "typescriptreact",
|
|
14
|
+
"prefix": "qcomponent$ + props",
|
|
15
|
+
"description": "Qwik component w/ props",
|
|
16
|
+
"body": [
|
|
17
|
+
"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {",
|
|
18
|
+
" $2",
|
|
19
|
+
"}",
|
|
20
|
+
"",
|
|
21
|
+
"export const $1 = component$<$1Props>((props) => {",
|
|
22
|
+
" const ${2:count} = useSignal(0);",
|
|
23
|
+
" return (",
|
|
24
|
+
" <${3:div} on${4:Click}$={(ev) => {$5}}>",
|
|
25
|
+
" $6",
|
|
26
|
+
" </${3}>",
|
|
27
|
+
" );",
|
|
28
|
+
"});"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"Qwik signal": {
|
|
32
|
+
"scope": "javascriptreact,typescriptreact",
|
|
33
|
+
"prefix": "quseSignal",
|
|
34
|
+
"description": "useSignal() declaration",
|
|
35
|
+
"body": ["const ${1:foo} = useSignal($2);", "$0"]
|
|
36
|
+
},
|
|
37
|
+
"Qwik store": {
|
|
38
|
+
"scope": "javascriptreact,typescriptreact",
|
|
39
|
+
"prefix": "quseStore",
|
|
40
|
+
"description": "useStore() declaration",
|
|
41
|
+
"body": ["const ${1:state} = useStore({", " $2", "});", "$0"]
|
|
42
|
+
},
|
|
43
|
+
"$ hook": {
|
|
44
|
+
"scope": "javascriptreact,typescriptreact",
|
|
45
|
+
"prefix": "q$",
|
|
46
|
+
"description": "$() function hook",
|
|
47
|
+
"body": ["$(() => {", " $0", "});", ""]
|
|
48
|
+
},
|
|
49
|
+
"useVisibleTask": {
|
|
50
|
+
"scope": "javascriptreact,typescriptreact",
|
|
51
|
+
"prefix": "quseVisibleTask",
|
|
52
|
+
"description": "useVisibleTask$() function hook",
|
|
53
|
+
"body": ["useVisibleTask$(({ track }) => {", " $0", "});", ""]
|
|
54
|
+
},
|
|
55
|
+
"useTask": {
|
|
56
|
+
"scope": "javascriptreact,typescriptreact",
|
|
57
|
+
"prefix": "quseTask$",
|
|
58
|
+
"description": "useTask$() function hook",
|
|
59
|
+
"body": [
|
|
60
|
+
"useTask$(({ track }) => {",
|
|
61
|
+
" track(() => $1);",
|
|
62
|
+
" $0",
|
|
63
|
+
"});",
|
|
64
|
+
""
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"useResource": {
|
|
68
|
+
"scope": "javascriptreact,typescriptreact",
|
|
69
|
+
"prefix": "quseResource$",
|
|
70
|
+
"description": "useResource$() declaration",
|
|
71
|
+
"body": [
|
|
72
|
+
"const $1 = useResource$(({ track, cleanup }) => {",
|
|
73
|
+
" $0",
|
|
74
|
+
"});",
|
|
75
|
+
""
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -24,7 +24,7 @@ Inside your project, you'll see the following directory structure:
|
|
|
24
24
|
└── ...
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
- `src/routes`: Provides the directory
|
|
27
|
+
- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.builder.io/qwikcity/routing/overview/) for more info.
|
|
28
28
|
|
|
29
29
|
- `src/components`: Recommended directory for components.
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ Inside your project, you'll see the following directory structure:
|
|
|
32
32
|
|
|
33
33
|
## Add Integrations and deployment
|
|
34
34
|
|
|
35
|
-
Use the `npm run qwik add` command to add additional integrations. Some examples of integrations
|
|
35
|
+
Use the `npm run qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/guides/static-site-generation/).
|
|
36
36
|
|
|
37
37
|
```shell
|
|
38
38
|
npm run qwik add # or `yarn qwik add`
|
|
@@ -40,7 +40,7 @@ npm run qwik add # or `yarn qwik add`
|
|
|
40
40
|
|
|
41
41
|
## Development
|
|
42
42
|
|
|
43
|
-
Development mode uses [Vite's development server](https://vitejs.dev/).
|
|
43
|
+
Development mode uses [Vite's development server](https://vitejs.dev/). The `dev` command will server-side render (SSR) the output during development.
|
|
44
44
|
|
|
45
45
|
```shell
|
|
46
46
|
npm start # or `yarn start`
|
|
@@ -50,7 +50,7 @@ npm start # or `yarn start`
|
|
|
50
50
|
|
|
51
51
|
## Preview
|
|
52
52
|
|
|
53
|
-
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to
|
|
53
|
+
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to preview a production build locally and should not be used as a production server.
|
|
54
54
|
|
|
55
55
|
```shell
|
|
56
56
|
npm run preview # or `yarn preview`
|
|
@@ -58,7 +58,7 @@ npm run preview # or `yarn preview`
|
|
|
58
58
|
|
|
59
59
|
## Production
|
|
60
60
|
|
|
61
|
-
The production build will generate client and server modules by running both client and server build commands.
|
|
61
|
+
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
|
|
62
62
|
|
|
63
63
|
```shell
|
|
64
64
|
npm run build # or `yarn build`
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@builder.io/qwik": "^1.1
|
|
20
|
-
"@builder.io/qwik-city": "^1.1
|
|
21
|
-
"@types/eslint": "8.40.
|
|
22
|
-
"@types/node": "^20.
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
24
|
-
"@typescript-eslint/parser": "5.
|
|
25
|
-
"eslint-plugin-qwik": "^1.1
|
|
26
|
-
"eslint": "8.
|
|
19
|
+
"@builder.io/qwik": "^1.2.1",
|
|
20
|
+
"@builder.io/qwik-city": "^1.2.1",
|
|
21
|
+
"@types/eslint": "8.40.2",
|
|
22
|
+
"@types/node": "^20.3.1",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
24
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
25
|
+
"eslint-plugin-qwik": "^1.2.1",
|
|
26
|
+
"eslint": "8.43.0",
|
|
27
27
|
"undici": "5.22.1",
|
|
28
28
|
"prettier": "2.8.8",
|
|
29
|
-
"typescript": "5.
|
|
29
|
+
"typescript": "5.1.3",
|
|
30
30
|
"vite": "4.3.9",
|
|
31
31
|
"vite-tsconfig-paths": "4.2.0"
|
|
32
32
|
},
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - More code is transferred to the browser than in SSR mode.
|
|
10
10
|
* - Optimizer/Serialization/Deserialization code is not exercised!
|
|
11
11
|
*/
|
|
12
|
-
import { render, type RenderOptions } from
|
|
13
|
-
import Root from
|
|
12
|
+
import { render, type RenderOptions } from "@builder.io/qwik";
|
|
13
|
+
import Root from "./root";
|
|
14
14
|
|
|
15
15
|
export default function (opts: RenderOptions) {
|
|
16
16
|
return render(document, <Root />, opts);
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* - https://vitejs.dev/config/preview-options.html#preview-options
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import { createQwikCity } from
|
|
14
|
-
import qwikCityPlan from
|
|
15
|
-
import render from
|
|
13
|
+
import { createQwikCity } from "@builder.io/qwik-city/middleware/node";
|
|
14
|
+
import qwikCityPlan from "@qwik-city-plan";
|
|
15
|
+
import render from "./entry.ssr";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* The default export is the QwikCity adapter used by Vite preview.
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
renderToStream,
|
|
15
|
+
type RenderToStreamOptions,
|
|
16
|
+
} from "@builder.io/qwik/server";
|
|
17
|
+
import { manifest } from "@qwik-client-manifest";
|
|
18
|
+
import Root from "./root";
|
|
16
19
|
|
|
17
20
|
export default function (opts: RenderToStreamOptions) {
|
|
18
21
|
return renderToStream(<Root />, {
|
|
@@ -20,7 +23,7 @@ export default function (opts: RenderToStreamOptions) {
|
|
|
20
23
|
...opts,
|
|
21
24
|
// Use container attributes to set attributes on the html tag.
|
|
22
25
|
containerAttributes: {
|
|
23
|
-
lang:
|
|
26
|
+
lang: "en-us",
|
|
24
27
|
...opts.containerAttributes,
|
|
25
28
|
},
|
|
26
29
|
});
|
|
@@ -10,9 +10,9 @@ html {
|
|
|
10
10
|
-moz-tab-size: 4;
|
|
11
11
|
-o-tab-size: 4;
|
|
12
12
|
tab-size: 4;
|
|
13
|
-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
14
|
+
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
15
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
body {
|
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
* Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
|
|
8
8
|
* You can also use this file to add more functionality that runs in the service worker.
|
|
9
9
|
*/
|
|
10
|
-
import { setupServiceWorker } from
|
|
10
|
+
import { setupServiceWorker } from "@builder.io/qwik-city/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
|
14
|
-
addEventListener(
|
|
15
|
-
|
|
16
|
-
addEventListener('activate', () => self.clients.claim());
|
|
14
|
+
self.addEventListener("install", () => self.skipWaiting());
|
|
15
|
+
self.addEventListener("activate", (ev) => ev.waitUntil(self.clients.claim()));
|
|
17
16
|
|
|
18
17
|
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
2
|
-
import { qwikVite } from
|
|
3
|
-
import { qwikCity } from
|
|
4
|
-
import tsconfigPaths from
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import { qwikVite } from "@builder.io/qwik/optimizer";
|
|
3
|
+
import { qwikCity } from "@builder.io/qwik-city/vite";
|
|
4
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
5
5
|
|
|
6
6
|
export default defineConfig(() => {
|
|
7
7
|
return {
|
|
8
8
|
plugins: [qwikCity(), qwikVite(), tsconfigPaths()],
|
|
9
9
|
preview: {
|
|
10
10
|
headers: {
|
|
11
|
-
|
|
11
|
+
"Cache-Control": "public, max-age=600",
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import { useDocumentHead, useLocation } from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import { useDocumentHead, useLocation } from "@builder.io/qwik-city";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The RouterHead component is placed inside of the document `<head>` element.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { component$, useSignal, $ } from
|
|
2
|
-
import styles from
|
|
3
|
-
import Gauge from
|
|
1
|
+
import { component$, useSignal, $ } from "@builder.io/qwik";
|
|
2
|
+
import styles from "./counter.module.css";
|
|
3
|
+
import Gauge from "../gauge";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
const count = useSignal(70);
|
|
@@ -13,12 +13,18 @@ export default component$(() => {
|
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<div class={styles[
|
|
17
|
-
<button
|
|
16
|
+
<div class={styles["counter-wrapper"]}>
|
|
17
|
+
<button
|
|
18
|
+
class="button-dark button-small"
|
|
19
|
+
onClick$={() => setCount(count.value - 1)}
|
|
20
|
+
>
|
|
18
21
|
-
|
|
19
22
|
</button>
|
|
20
23
|
<Gauge value={count.value} />
|
|
21
|
-
<button
|
|
24
|
+
<button
|
|
25
|
+
class="button-dark button-small"
|
|
26
|
+
onClick$={() => setCount(count.value + 1)}
|
|
27
|
+
>
|
|
22
28
|
+
|
|
23
29
|
</button>
|
|
24
30
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import { useServerTimeLoader } from
|
|
3
|
-
import styles from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import { useServerTimeLoader } from "~/routes/layout";
|
|
3
|
+
import styles from "./footer.module.css";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
const serverTime = useServerTimeLoader();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import styles from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import styles from "./gauge.module.css";
|
|
3
3
|
|
|
4
4
|
export default component$(({ value = 50 }: { value?: number }) => {
|
|
5
5
|
const safeValue = value < 0 || value > 100 ? 50 : value;
|
|
@@ -14,7 +14,13 @@ export default component$(({ value = 50 }: { value?: number }) => {
|
|
|
14
14
|
</linearGradient>
|
|
15
15
|
</defs>
|
|
16
16
|
|
|
17
|
-
<circle
|
|
17
|
+
<circle
|
|
18
|
+
r="56"
|
|
19
|
+
cx="60"
|
|
20
|
+
cy="60"
|
|
21
|
+
stroke-width="8"
|
|
22
|
+
style="fill: #000; stroke: #0000"
|
|
23
|
+
></circle>
|
|
18
24
|
|
|
19
25
|
<circle
|
|
20
26
|
r="56"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import { QwikLogo } from
|
|
3
|
-
import styles from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import { QwikLogo } from "../icons/qwik";
|
|
3
|
+
import styles from "./header.module.css";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
return (
|
|
7
7
|
<header class={styles.header}>
|
|
8
|
-
<div class={[
|
|
8
|
+
<div class={["container", styles.wrapper]}>
|
|
9
9
|
<div class={styles.logo}>
|
|
10
10
|
<a href="/" title="qwik">
|
|
11
11
|
<QwikLogo height={50} width={143} />
|
|
@@ -13,17 +13,26 @@ export default component$(() => {
|
|
|
13
13
|
</div>
|
|
14
14
|
<ul>
|
|
15
15
|
<li>
|
|
16
|
-
<a
|
|
16
|
+
<a
|
|
17
|
+
href="https://qwik.builder.io/docs/components/overview/"
|
|
18
|
+
target="_blank"
|
|
19
|
+
>
|
|
17
20
|
Docs
|
|
18
21
|
</a>
|
|
19
22
|
</li>
|
|
20
23
|
<li>
|
|
21
|
-
<a
|
|
24
|
+
<a
|
|
25
|
+
href="https://qwik.builder.io/examples/introduction/hello-world/"
|
|
26
|
+
target="_blank"
|
|
27
|
+
>
|
|
22
28
|
Examples
|
|
23
29
|
</a>
|
|
24
30
|
</li>
|
|
25
31
|
<li>
|
|
26
|
-
<a
|
|
32
|
+
<a
|
|
33
|
+
href="https://qwik.builder.io/tutorial/welcome/overview/"
|
|
34
|
+
target="_blank"
|
|
35
|
+
>
|
|
27
36
|
Tutorials
|
|
28
37
|
</a>
|
|
29
38
|
</li>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import styles from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import styles from "./hero.module.css";
|
|
3
|
+
import ImgThunder from "~/media/thunder.png?jsx";
|
|
3
4
|
|
|
4
5
|
export default component$(() => {
|
|
5
6
|
return (
|
|
6
|
-
<div class={[
|
|
7
|
+
<div class={["container", styles.hero]}>
|
|
8
|
+
<ImgThunder class={styles["hero-image"]} />
|
|
7
9
|
<h1>
|
|
8
10
|
So <span class="highlight">fantastic</span>
|
|
9
11
|
<br />
|
|
10
12
|
to have <span class="highlight">you</span> here
|
|
11
13
|
</h1>
|
|
12
14
|
<p>Have fun building your App with Qwik.</p>
|
|
13
|
-
<div class={styles[
|
|
15
|
+
<div class={styles["button-group"]}>
|
|
14
16
|
<button
|
|
15
17
|
onClick$={async () => {
|
|
16
18
|
const defaults = {
|
|
@@ -19,7 +21,7 @@ export default component$(() => {
|
|
|
19
21
|
gravity: 0,
|
|
20
22
|
decay: 0.95,
|
|
21
23
|
startVelocity: 30,
|
|
22
|
-
colors: [
|
|
24
|
+
colors: ["006ce9", "ac7ff4", "18b6f6", "713fc2", "ffffff"],
|
|
23
25
|
origin: {
|
|
24
26
|
x: 0.5,
|
|
25
27
|
y: 0.35,
|
|
@@ -31,10 +33,11 @@ export default component$(() => {
|
|
|
31
33
|
if ((globalThis as any).confetti) {
|
|
32
34
|
return resolve((globalThis as any).confetti as any);
|
|
33
35
|
}
|
|
34
|
-
const script = document.createElement(
|
|
36
|
+
const script = document.createElement("script");
|
|
35
37
|
script.src =
|
|
36
|
-
|
|
37
|
-
script.onload = () =>
|
|
38
|
+
"https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js";
|
|
39
|
+
script.onload = () =>
|
|
40
|
+
resolve((globalThis as any).confetti as any);
|
|
38
41
|
script.onerror = reject;
|
|
39
42
|
document.head.appendChild(script);
|
|
40
43
|
script.remove();
|
|
@@ -66,7 +69,11 @@ export default component$(() => {
|
|
|
66
69
|
>
|
|
67
70
|
Time to celebrate
|
|
68
71
|
</button>
|
|
69
|
-
<a
|
|
72
|
+
<a
|
|
73
|
+
href="https://qwik.builder.io/docs"
|
|
74
|
+
target="_blank"
|
|
75
|
+
class="button button-dark"
|
|
76
|
+
>
|
|
70
77
|
Explore the docs
|
|
71
78
|
</a>
|
|
72
79
|
</div>
|