Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globe! #37

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
.cache/
/public
.DS_store
./dist
./dist
.idea
2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations/start.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/website-gatsby.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ node_modules
/public
.env
/src/public
/src/static

/**/static

*.glsl
4 changes: 3 additions & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ export default defineConfig({
name: "test",
hooks: {
"astro:build:done": async ({ routes }) => {
if (process.env.NODE_ENV !== "production") return;

const files = routes
.filter((route) => route.type === "page")
.map(({ distURL }) => distURL)
.filter((url): url is URL => typeof url !== 'undefined');
.filter((url): url is URL => typeof url !== "undefined");

for (const { pathname } of files) {
const htmlFile = readFileSync(pathname, "utf-8");
Expand Down
81 changes: 72 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
"node": "^20"
},
"dependencies": {
"clsx": "1.2.1"
"three": "0.160.0",
"tailwind-merge": "2.2.0"
},
"devDependencies": {
"@types/node": "20.11.0",
"@types/three": "0.160.0",
"astro": "4.1.2",
"autoprefixer": "10.4.16",
"htmlnano": "2.1.0",
Expand Down
27 changes: 27 additions & 0 deletions src/components/earth/earth.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
import { Picture } from 'astro:assets';
import Earth from "./static/earth-alpha-map.png";
import { twMerge } from "tailwind-merge";

interface Props {
className?: string;
}

const { className } = Astro.props;
---

<my-earth class={twMerge("block aspect-[4/3] w-[100%]", className)}>
<Picture
src={Earth}
class="invisible"
formats={["webp", "png"]}
aspectRatio="2:1"
alt=""
role="presentation"
aria-hidden="true"
/>
</my-earth>
<script>
import {MyEarth} from "./my-earth.wc.ts";
customElements.define("my-earth", MyEarth);
</script>
Loading
Loading