hi
This commit is contained in:
parent
9970de958f
commit
a859fb4dc7
12 changed files with 174 additions and 95 deletions
|
@ -1,30 +1,30 @@
|
||||||
{
|
{
|
||||||
"name": "lightning",
|
"name": "lightning",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "solid-start dev",
|
"dev": "solid-start dev",
|
||||||
"build": "solid-start build",
|
"build": "solid-start build",
|
||||||
"start": "solid-start start"
|
"start": "solid-start start"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.11.18",
|
"@types/node": "^18.11.18",
|
||||||
"esbuild": "^0.14.54",
|
"esbuild": "^0.14.54",
|
||||||
"postcss": "^8.4.21",
|
"postcss": "^8.4.21",
|
||||||
"solid-start-node": "^0.2.19",
|
"solid-start-node": "^0.2.19",
|
||||||
"typescript": "^4.9.4",
|
"typescript": "^4.9.4",
|
||||||
"vite": "^4.1.4"
|
"vite": "^4.1.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@solidjs/meta": "^0.28.2",
|
"@solidjs/meta": "^0.28.2",
|
||||||
"@solidjs/router": "^0.8.2",
|
"@solidjs/router": "^0.8.2",
|
||||||
"mapbox-gl": "npm:empty-npm-package@1.0.0",
|
"mapbox-gl": "npm:empty-npm-package@1.0.0",
|
||||||
"maplibre-gl": "^2.4.0",
|
"maplibre-gl": "^2.4.0",
|
||||||
"solid-js": "^1.7.2",
|
"solid-js": "^1.7.2",
|
||||||
"solid-map-gl": "^1.7.2",
|
"solid-map-gl": "^1.7.2",
|
||||||
"solid-start": "^0.2.26",
|
"solid-start": "^0.2.26",
|
||||||
"undici": "^5.15.1"
|
"undici": "^5.15.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.8"
|
"node": ">=16.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
lightning/public/5Q14.gif
Normal file
BIN
lightning/public/5Q14.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
20
lightning/src/components/Counter.css
Normal file
20
lightning/src/components/Counter.css
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.increment {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
padding: 1em 2em;
|
||||||
|
color: #335d92;
|
||||||
|
background-color: rgba(68, 107, 158, 0.1);
|
||||||
|
border-radius: 2em;
|
||||||
|
border: 2px solid rgba(68, 107, 158, 0);
|
||||||
|
outline: none;
|
||||||
|
width: 200px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.increment:focus {
|
||||||
|
border: 2px solid #335d92;
|
||||||
|
}
|
||||||
|
|
||||||
|
.increment:active {
|
||||||
|
background-color: rgba(68, 107, 158, 0.2);
|
||||||
|
}
|
11
lightning/src/components/Counter.tsx
Normal file
11
lightning/src/components/Counter.tsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { createSignal } from "solid-js";
|
||||||
|
import "./Counter.css";
|
||||||
|
|
||||||
|
export default function Counter() {
|
||||||
|
const [count, setCount] = createSignal(0);
|
||||||
|
return (
|
||||||
|
<button class="increment" onClick={() => setCount(count() + 1)}>
|
||||||
|
Clicks: {count()}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
import {
|
import {
|
||||||
createHandler,
|
createHandler,
|
||||||
renderAsync,
|
renderAsync,
|
||||||
StartServer,
|
StartServer,
|
||||||
} from "solid-start/entry-server";
|
} from "solid-start/entry-server";
|
||||||
|
|
||||||
export default createHandler(
|
export default createHandler(
|
||||||
renderAsync((event) => <StartServer event={event} />)
|
renderAsync((event) => <StartServer event={event} />)
|
||||||
);
|
);
|
||||||
|
|
|
@ -28,6 +28,10 @@ p {
|
||||||
margin: 2rem auto;
|
margin: 2rem auto;
|
||||||
line-height: 1.35;
|
line-height: 1.35;
|
||||||
}
|
}
|
||||||
|
ul {
|
||||||
|
max-width: 7rem;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 480px) {
|
@media (min-width: 480px) {
|
||||||
h1 {
|
h1 {
|
||||||
|
|
|
@ -1,39 +1,41 @@
|
||||||
// @refresh reload
|
// @refresh reload
|
||||||
import { Suspense } from "solid-js";
|
import { Suspense } from "solid-js";
|
||||||
import {
|
import {
|
||||||
A,
|
A,
|
||||||
Body,
|
Body,
|
||||||
ErrorBoundary,
|
ErrorBoundary,
|
||||||
FileRoutes,
|
FileRoutes,
|
||||||
Head,
|
Head,
|
||||||
Html,
|
Html,
|
||||||
Meta,
|
Meta,
|
||||||
Routes,
|
Routes,
|
||||||
Scripts,
|
Scripts,
|
||||||
Title,
|
Title,
|
||||||
} from "solid-start";
|
} from "solid-start";
|
||||||
|
import BadassMap from './components/BadassMap.tsx'
|
||||||
import "./root.css";
|
import "./root.css";
|
||||||
|
|
||||||
export default function Root() {
|
export default function Root() {
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head>
|
<Head>
|
||||||
<Title>SolidStart - Bare</Title>
|
<Title>SolidStart - Bare</Title>
|
||||||
<Meta charset="utf-8" />
|
<Meta charset="utf-8" />
|
||||||
<Meta name="viewport" content="width=device-width, initial-scale=1" />
|
<Meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
</Head>
|
</Head>
|
||||||
<Body>
|
<Body>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<A href="/">Index</A>
|
<A href="/">Map</A>
|
||||||
<A href="/about">About</A>
|
<A href="/about">About</A>
|
||||||
<Routes>
|
<BadassMap />
|
||||||
<FileRoutes />
|
<Routes>
|
||||||
</Routes>
|
<FileRoutes />
|
||||||
</ErrorBoundary>
|
</Routes>
|
||||||
</Suspense>
|
</ErrorBoundary>
|
||||||
<Scripts />
|
</Suspense>
|
||||||
</Body>
|
<Scripts />
|
||||||
</Html>
|
</Body>
|
||||||
);
|
</Html>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ import { Title } from "solid-start";
|
||||||
import { HttpStatusCode } from "solid-start/server";
|
import { HttpStatusCode } from "solid-start/server";
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<Title>Not Found</Title>
|
<Title>Not Found</Title>
|
||||||
<HttpStatusCode code={404} />
|
<HttpStatusCode code={404} />
|
||||||
<h1>Page Not Found</h1>
|
<h1>Page Not Found</h1>
|
||||||
<p>
|
<p>
|
||||||
Visit{" "}
|
Visit{" "}
|
||||||
<a href="https://start.solidjs.com" target="_blank">
|
<a href="https://start.solidjs.com" target="_blank">
|
||||||
start.solidjs.com
|
start.solidjs.com
|
||||||
</a>{" "}
|
</a>{" "}
|
||||||
to learn how to build SolidStart apps.
|
to learn how to build SolidStart apps.
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
38
lightning/src/routes/about.tsx
Normal file
38
lightning/src/routes/about.tsx
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import { Title } from 'solid-start';
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<main>
|
||||||
|
<Title>Lightning</Title>
|
||||||
|
<h1>About</h1>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="https://maplibre.org/" target="_blank">
|
||||||
|
MapLibre
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://openmaptiles.org/" target="_blank">
|
||||||
|
OpenMapTiles
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://start.solidjs.com/" target="_blank">
|
||||||
|
SolidStart
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://gis-hub.gitbook.io/solid-map-gl/" target="_blank">
|
||||||
|
Solid Map GL
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<img src='5Q14.gif' />
|
||||||
|
<p>
|
||||||
|
<a href="https://github.com/adoyle0/maps" target="_blank">
|
||||||
|
github.com/adoyle0/maps
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
import { Title } from "solid-start";
|
import { Title } from "solid-start";
|
||||||
import BadassMap from "~/components/BadassMap";
|
import Counter from "~/components/Counter";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<Title>Lightning</Title>
|
<Title>Lightning</Title>
|
||||||
<h1>Lightning</h1>
|
<h1>Lightning</h1>
|
||||||
<BadassMap />
|
<Counter />
|
||||||
<p>Click and drag to watch me explode!
|
<p>Click and drag to watch me explode!
|
||||||
</p>
|
</p>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"jsxImportSource": "solid-js",
|
"jsxImportSource": "solid-js",
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"types": ["solid-start/env"],
|
"types": [
|
||||||
"baseUrl": "./",
|
"solid-start/env"
|
||||||
"paths": {
|
],
|
||||||
"~/*": ["./src/*"]
|
"baseUrl": "./",
|
||||||
|
"paths": {
|
||||||
|
"~/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,5 @@ import solid from "solid-start/vite";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [solid()],
|
plugins: [solid()],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue