diff --git a/astro.config.mjs b/astro.config.mjs
index da9df56..7baddcd 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,7 +1,10 @@
import { defineConfig } from 'astro/config';
+import preact from "@astrojs/preact";
+
// https://astro.build/config
export default defineConfig({
site: "https://djsiddz.github.io",
- base: "/space-ahead"
-});
+ base: "/space-ahead",
+ integrations: [preact()]
+});
\ No newline at end of file
diff --git a/package.json b/package.json
index 396cb0e..4ff05e3 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "space-ahead",
"type": "module",
- "version": "0.1.0",
+ "version": "0.6.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
@@ -10,7 +10,9 @@
"astro": "astro"
},
"dependencies": {
+ "@astrojs/preact": "^3.1.0",
"@astrojs/rss": "^4.0.5",
- "astro": "^4.3.1"
+ "astro": "^4.3.1",
+ "preact": "^10.19.4"
}
}
diff --git a/src/components/SpaceEmoji.jsx b/src/components/SpaceEmoji.jsx
new file mode 100644
index 0000000..4fbcafe
--- /dev/null
+++ b/src/components/SpaceEmoji.jsx
@@ -0,0 +1,8 @@
+import { useState } from "preact/hooks";
+
+export default function SpaceEmoji({emojis}) {
+ const getRandomEmoji = () => emojis[(Math.floor(Math.random() * emojis.length))];
+ const [emoji, setEmoji] = useState(getRandomEmoji());
+
+ return ;
+}
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 05ad828..a71e3db 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,6 +1,27 @@
---
+import SpaceEmoji from "../components/SpaceEmoji";
import MainLayout from "../layouts/MainLayout.astro";
+
+const emojis = [
+ "π To Infinity, And Beyond!",
+ "π In a galaxy far far away...",
+ "β May the force be with you!",
+ "βοΈ Game Over",
+ "βοΈ βTime is an illusion. Lunchtime doubly so.β β Douglas Adams, H2G2",
+ "π The Eagle has landed!",
+ "π°οΈ 42",
+ "π€ Wall-E",
+ "π½ E.T. Phone Home",
+ "π We'll be Counting Stars",
+ "πΎ Press Start",
+ "π Powered by Astro & Preact",
+ "π Live long and prosper!",
+];
---
+
- Space Ahead !
+
+ Space Ahead !
+
+
diff --git a/tsconfig.json b/tsconfig.json
index d78f81e..99df2e6 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,3 +1,7 @@
{
- "extends": "astro/tsconfigs/base"
-}
+ "extends": "astro/tsconfigs/base",
+ "compilerOptions": {
+ "jsx": "react-jsx",
+ "jsxImportSource": "preact"
+ }
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index ba2bb1e..6da9210 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -51,6 +51,23 @@ __metadata:
languageName: node
linkType: hard
+"@astrojs/preact@npm:^3.1.0":
+ version: 3.1.0
+ resolution: "@astrojs/preact@npm:3.1.0"
+ dependencies:
+ "@babel/plugin-transform-react-jsx": "npm:^7.22.5"
+ "@babel/plugin-transform-react-jsx-development": "npm:^7.22.5"
+ "@preact/preset-vite": "npm:^2.7.0"
+ "@preact/signals": "npm:^1.2.1"
+ babel-plugin-transform-hook-names: "npm:^1.0.2"
+ preact-render-to-string: "npm:^6.3.1"
+ preact-ssr-prepass: "npm:^1.2.1"
+ peerDependencies:
+ preact: ^10.6.5
+ checksum: 10c0/bf186c5f7909c8064043d5d96f42b182bd6e96441a7d93c2ffb9b764feaf7c3c382014ee87bf8369e0f473354daae12bd74f4da3880a9c08e86b534d4fe3180f
+ languageName: node
+ linkType: hard
+
"@astrojs/prism@npm:^3.0.0":
version: 3.0.0
resolution: "@astrojs/prism@npm:3.0.0"
@@ -102,7 +119,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/core@npm:^7.23.3":
+"@babel/core@npm:^7.22.1, @babel/core@npm:^7.23.3":
version: 7.23.9
resolution: "@babel/core@npm:7.23.9"
dependencies:
@@ -297,7 +314,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-react-jsx@npm:^7.22.5":
+"@babel/plugin-transform-react-jsx-development@npm:^7.22.5":
+ version: 7.22.5
+ resolution: "@babel/plugin-transform-react-jsx-development@npm:7.22.5"
+ dependencies:
+ "@babel/plugin-transform-react-jsx": "npm:^7.22.5"
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: 10c0/4d2e9e68383238feb873f6111df972df4a2ebf6256d6f787a8772241867efa975b3980f7d75ab7d750e7eaad4bd454e8cc6e106301fd7572dd389e553f5f69d2
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-react-jsx@npm:^7.22.15, @babel/plugin-transform-react-jsx@npm:^7.22.5":
version: 7.23.4
resolution: "@babel/plugin-transform-react-jsx@npm:7.23.4"
dependencies:
@@ -625,6 +653,94 @@ __metadata:
languageName: node
linkType: hard
+"@preact/preset-vite@npm:^2.7.0":
+ version: 2.8.1
+ resolution: "@preact/preset-vite@npm:2.8.1"
+ dependencies:
+ "@babel/plugin-transform-react-jsx": "npm:^7.22.15"
+ "@babel/plugin-transform-react-jsx-development": "npm:^7.22.5"
+ "@prefresh/vite": "npm:^2.4.1"
+ "@rollup/pluginutils": "npm:^4.1.1"
+ babel-plugin-transform-hook-names: "npm:^1.0.2"
+ debug: "npm:^4.3.4"
+ kolorist: "npm:^1.8.0"
+ magic-string: "npm:0.30.5"
+ node-html-parser: "npm:^6.1.10"
+ resolve: "npm:^1.22.8"
+ peerDependencies:
+ "@babel/core": 7.x
+ vite: 2.x || 3.x || 4.x || 5.x
+ checksum: 10c0/84abcda7b8bf0b714149958bcf224e0e73306d7b127600cfbd9b3199fa564fcd3abcc35b477cc7f1ccce66b54c3022df84b53c6f1f25b2572697119f5573dd22
+ languageName: node
+ linkType: hard
+
+"@preact/signals-core@npm:^1.4.0":
+ version: 1.5.1
+ resolution: "@preact/signals-core@npm:1.5.1"
+ checksum: 10c0/895d1addfdf6a59d0a22b5a754854d6f549cc71c5c08edb2048a137f155469e51f386b832961339cf930a432193151358b396453e56f9a41f9e3ad0ee2eba912
+ languageName: node
+ linkType: hard
+
+"@preact/signals@npm:^1.2.1":
+ version: 1.2.2
+ resolution: "@preact/signals@npm:1.2.2"
+ dependencies:
+ "@preact/signals-core": "npm:^1.4.0"
+ peerDependencies:
+ preact: 10.x
+ checksum: 10c0/ecc583edec5604ba1f7aecc3ae59912cf9e8428c38c0c5352e203e12f61c8fc956e2d0a5a5710d9c2bfeba07c6312a2a501b3e35a3085ac8a0a4398fc1ee77a3
+ languageName: node
+ linkType: hard
+
+"@prefresh/babel-plugin@npm:0.5.1":
+ version: 0.5.1
+ resolution: "@prefresh/babel-plugin@npm:0.5.1"
+ checksum: 10c0/f9153c210427adbddb4403502f8fa845f6207516de2d162f5d550683a87173dc3eaabc6be2bb4f1206b882cdd23339f2092567be8d09794a3d06a5626942b1e4
+ languageName: node
+ linkType: hard
+
+"@prefresh/core@npm:^1.5.1":
+ version: 1.5.2
+ resolution: "@prefresh/core@npm:1.5.2"
+ peerDependencies:
+ preact: ^10.0.0
+ checksum: 10c0/53d1ce714ed098ccc11f3a8e2826ff6b90237445c24df6281eb162791b534d1d7626a43c0c1c7427139d2ade658e1ba7020963c001135bbdbeeb15073008529b
+ languageName: node
+ linkType: hard
+
+"@prefresh/utils@npm:^1.2.0":
+ version: 1.2.0
+ resolution: "@prefresh/utils@npm:1.2.0"
+ checksum: 10c0/38cdc6cbb5e18df36996161214eb1097db3361cb0b6402a8012cbe500ba8fb5bcbdc39a687d3b6d67e99f6c340ed77d59f27ab167dfc1655eb4d783740d87d52
+ languageName: node
+ linkType: hard
+
+"@prefresh/vite@npm:^2.4.1":
+ version: 2.4.5
+ resolution: "@prefresh/vite@npm:2.4.5"
+ dependencies:
+ "@babel/core": "npm:^7.22.1"
+ "@prefresh/babel-plugin": "npm:0.5.1"
+ "@prefresh/core": "npm:^1.5.1"
+ "@prefresh/utils": "npm:^1.2.0"
+ "@rollup/pluginutils": "npm:^4.2.1"
+ peerDependencies:
+ preact: ^10.4.0
+ vite: ">=2.0.0"
+ checksum: 10c0/7a147c7b94a8e734e1df6fda2cec0f5796823e42261b08742d0763a60fed916555305e8b0a5f192ee06fc078c8e222cdf79dedc311819169cfd43083e9ab106d
+ languageName: node
+ linkType: hard
+
+"@rollup/pluginutils@npm:^4.1.1, @rollup/pluginutils@npm:^4.2.1":
+ version: 4.2.1
+ resolution: "@rollup/pluginutils@npm:4.2.1"
+ dependencies:
+ estree-walker: "npm:^2.0.1"
+ picomatch: "npm:^2.2.2"
+ checksum: 10c0/3ee56b2c8f1ed8dfd0a92631da1af3a2dfdd0321948f089b3752b4de1b54dc5076701eadd0e5fc18bd191b77af594ac1db6279e83951238ba16bf8a414c64c48
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-android-arm-eabi@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.6"
@@ -1047,6 +1163,15 @@ __metadata:
languageName: node
linkType: hard
+"babel-plugin-transform-hook-names@npm:^1.0.2":
+ version: 1.0.2
+ resolution: "babel-plugin-transform-hook-names@npm:1.0.2"
+ peerDependencies:
+ "@babel/core": ^7.12.10
+ checksum: 10c0/517b85fe0611d742b3fffad5d0e119fcbd29bf69f95c6970b9ede4cb66453c7106a2d3bf048b35255b78a9d6a9565ad37e73b46c0be1fe557e941c792fad79f0
+ languageName: node
+ linkType: hard
+
"bail@npm:^2.0.0":
version: 2.0.2
resolution: "bail@npm:2.0.2"
@@ -1104,6 +1229,13 @@ __metadata:
languageName: node
linkType: hard
+"boolbase@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "boolbase@npm:1.0.0"
+ checksum: 10c0/e4b53deb4f2b85c52be0e21a273f2045c7b6a6ea002b0e139c744cb6f95e9ec044439a52883b0d74dedd1ff3da55ed140cfdddfed7fb0cccbed373de5dce1bcf
+ languageName: node
+ linkType: hard
+
"boxen@npm:^7.1.1":
version: 7.1.1
resolution: "boxen@npm:7.1.1"
@@ -1427,6 +1559,26 @@ __metadata:
languageName: node
linkType: hard
+"css-select@npm:^5.1.0":
+ version: 5.1.0
+ resolution: "css-select@npm:5.1.0"
+ dependencies:
+ boolbase: "npm:^1.0.0"
+ css-what: "npm:^6.1.0"
+ domhandler: "npm:^5.0.2"
+ domutils: "npm:^3.0.1"
+ nth-check: "npm:^2.0.1"
+ checksum: 10c0/551c60dba5b54054741032c1793b5734f6ba45e23ae9e82761a3c0ed1acbb8cfedfa443aaba3a3c1a54cac12b456d2012a09d2cd5f0e82e430454c1b9d84d500
+ languageName: node
+ linkType: hard
+
+"css-what@npm:^6.1.0":
+ version: 6.1.0
+ resolution: "css-what@npm:6.1.0"
+ checksum: 10c0/a09f5a6b14ba8dcf57ae9a59474722e80f20406c53a61e9aedb0eedc693b135113ffe2983f4efc4b5065ae639442e9ae88df24941ef159c218b231011d733746
+ languageName: node
+ linkType: hard
+
"cssesc@npm:^3.0.0":
version: 3.0.0
resolution: "cssesc@npm:3.0.0"
@@ -1544,6 +1696,44 @@ __metadata:
languageName: node
linkType: hard
+"dom-serializer@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "dom-serializer@npm:2.0.0"
+ dependencies:
+ domelementtype: "npm:^2.3.0"
+ domhandler: "npm:^5.0.2"
+ entities: "npm:^4.2.0"
+ checksum: 10c0/d5ae2b7110ca3746b3643d3ef60ef823f5f078667baf530cec096433f1627ec4b6fa8c072f09d079d7cda915fd2c7bc1b7b935681e9b09e591e1e15f4040b8e2
+ languageName: node
+ linkType: hard
+
+"domelementtype@npm:^2.3.0":
+ version: 2.3.0
+ resolution: "domelementtype@npm:2.3.0"
+ checksum: 10c0/686f5a9ef0fff078c1412c05db73a0dce096190036f33e400a07e2a4518e9f56b1e324f5c576a0a747ef0e75b5d985c040b0d51945ce780c0dd3c625a18cd8c9
+ languageName: node
+ linkType: hard
+
+"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3":
+ version: 5.0.3
+ resolution: "domhandler@npm:5.0.3"
+ dependencies:
+ domelementtype: "npm:^2.3.0"
+ checksum: 10c0/bba1e5932b3e196ad6862286d76adc89a0dbf0c773e5ced1eb01f9af930c50093a084eff14b8de5ea60b895c56a04d5de8bbc4930c5543d029091916770b2d2a
+ languageName: node
+ linkType: hard
+
+"domutils@npm:^3.0.1":
+ version: 3.1.0
+ resolution: "domutils@npm:3.1.0"
+ dependencies:
+ dom-serializer: "npm:^2.0.0"
+ domelementtype: "npm:^2.3.0"
+ domhandler: "npm:^5.0.3"
+ checksum: 10c0/342d64cf4d07b8a0573fb51e0a6312a88fb520c7fefd751870bf72fa5fc0f2e0cb9a3958a573610b1d608c6e2a69b8e9b4b40f0bfb8f87a71bce4f180cca1887
+ languageName: node
+ linkType: hard
+
"dset@npm:^3.1.2, dset@npm:^3.1.3":
version: 3.1.3
resolution: "dset@npm:3.1.3"
@@ -1604,7 +1794,7 @@ __metadata:
languageName: node
linkType: hard
-"entities@npm:^4.4.0":
+"entities@npm:^4.2.0, entities@npm:^4.4.0":
version: 4.5.0
resolution: "entities@npm:4.5.0"
checksum: 10c0/5b039739f7621f5d1ad996715e53d964035f75ad3b9a4d38c6b3804bb226e282ffeae2443624d8fdd9c47d8e926ae9ac009c54671243f0c3294c26af7cc85250
@@ -1743,6 +1933,13 @@ __metadata:
languageName: node
linkType: hard
+"estree-walker@npm:^2.0.1":
+ version: 2.0.2
+ resolution: "estree-walker@npm:2.0.2"
+ checksum: 10c0/53a6c54e2019b8c914dc395890153ffdc2322781acf4bd7d1a32d7aedc1710807bdcd866ac133903d5629ec601fbb50abe8c2e5553c7f5a0afdd9b6af6c945af
+ languageName: node
+ linkType: hard
+
"estree-walker@npm:^3.0.3":
version: 3.0.3
resolution: "estree-walker@npm:3.0.3"
@@ -2171,6 +2368,15 @@ __metadata:
languageName: node
linkType: hard
+"he@npm:1.2.0":
+ version: 1.2.0
+ resolution: "he@npm:1.2.0"
+ bin:
+ he: bin/he
+ checksum: 10c0/a27d478befe3c8192f006cdd0639a66798979dfa6e2125c6ac582a19a5ebfec62ad83e8382e6036170d873f46e4536a7e795bf8b95bf7c247f4cc0825ccc8c17
+ languageName: node
+ linkType: hard
+
"html-escaper@npm:^3.0.3":
version: 3.0.3
resolution: "html-escaper@npm:3.0.3"
@@ -2515,6 +2721,13 @@ __metadata:
languageName: node
linkType: hard
+"kolorist@npm:^1.8.0":
+ version: 1.8.0
+ resolution: "kolorist@npm:1.8.0"
+ checksum: 10c0/73075db44a692bf6c34a649f3b4b3aea4993b84f6b754cbf7a8577e7c7db44c0bad87752bd23b0ce533f49de2244ce2ce03b7b1b667a85ae170a94782cc50f9b
+ languageName: node
+ linkType: hard
+
"load-yaml-file@npm:^0.2.0":
version: 0.2.0
resolution: "load-yaml-file@npm:0.2.0"
@@ -2594,6 +2807,15 @@ __metadata:
languageName: node
linkType: hard
+"magic-string@npm:0.30.5":
+ version: 0.30.5
+ resolution: "magic-string@npm:0.30.5"
+ dependencies:
+ "@jridgewell/sourcemap-codec": "npm:^1.4.15"
+ checksum: 10c0/38ac220ca7539e96da7ea2f38d85796bdf5c69b6bcae728c4bc2565084e6dc326b9174ee9770bea345cf6c9b3a24041b767167874fab5beca874d2356a9d1520
+ languageName: node
+ linkType: hard
+
"magic-string@npm:^0.30.3":
version: 0.30.6
resolution: "magic-string@npm:0.30.6"
@@ -3420,6 +3642,16 @@ __metadata:
languageName: node
linkType: hard
+"node-html-parser@npm:^6.1.10":
+ version: 6.1.12
+ resolution: "node-html-parser@npm:6.1.12"
+ dependencies:
+ css-select: "npm:^5.1.0"
+ he: "npm:1.2.0"
+ checksum: 10c0/dfd75756b55642b37f8df91e79c35f38f2e6a48b01a309998e4b017c5cf3c98ab3c1edc54b707dfa32d36aff9b21076cd87bb1a93f97da4d0f0fe5e4e599daa5
+ languageName: node
+ linkType: hard
+
"node-releases@npm:^2.0.14":
version: 2.0.14
resolution: "node-releases@npm:2.0.14"
@@ -3454,6 +3686,15 @@ __metadata:
languageName: node
linkType: hard
+"nth-check@npm:^2.0.1":
+ version: 2.1.1
+ resolution: "nth-check@npm:2.1.1"
+ dependencies:
+ boolbase: "npm:^1.0.0"
+ checksum: 10c0/5fee7ff309727763689cfad844d979aedd2204a817fbaaf0e1603794a7c20db28548d7b024692f953557df6ce4a0ee4ae46cd8ebd9b36cfb300b9226b567c479
+ languageName: node
+ linkType: hard
+
"once@npm:^1.3.1, once@npm:^1.4.0":
version: 1.4.0
resolution: "once@npm:1.4.0"
@@ -3648,7 +3889,7 @@ __metadata:
languageName: node
linkType: hard
-"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1":
+"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.2, picomatch@npm:^2.3.1":
version: 2.3.1
resolution: "picomatch@npm:2.3.1"
checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be
@@ -3682,6 +3923,33 @@ __metadata:
languageName: node
linkType: hard
+"preact-render-to-string@npm:^6.3.1":
+ version: 6.3.1
+ resolution: "preact-render-to-string@npm:6.3.1"
+ dependencies:
+ pretty-format: "npm:^3.8.0"
+ peerDependencies:
+ preact: ">=10"
+ checksum: 10c0/bc2f64de7d5dc16b32ad89e53a2d2c39fb0a0a55d1ebb3966cfdac3d8434f1e73293b543bacf85aef30f58ceb5ff153b606ac6b8a25d96f2462389f7054734d7
+ languageName: node
+ linkType: hard
+
+"preact-ssr-prepass@npm:^1.2.1":
+ version: 1.2.1
+ resolution: "preact-ssr-prepass@npm:1.2.1"
+ peerDependencies:
+ preact: ">=10 || ^10.0.0-beta.0 || ^10.0.0-alpha.0"
+ checksum: 10c0/5c3183512d43e81dba8d24cc42f5387315d9c5d63fa02faeb34025ff2249051e886e41993e6792ae8e1161b2bbd150bca6bb8345edbb0655e6a11bc4522958d4
+ languageName: node
+ linkType: hard
+
+"preact@npm:^10.19.4":
+ version: 10.19.4
+ resolution: "preact@npm:10.19.4"
+ checksum: 10c0/cc8cc6fe8fe9ee0fd97ea68b28c8e277ccc4486bc1d2c59946b6ab7122a902fc518173046bdfc9ed12d1b2b330203888312e3ebe404f582962aa97f0fac6338e
+ languageName: node
+ linkType: hard
+
"prebuild-install@npm:^7.1.1":
version: 7.1.1
resolution: "prebuild-install@npm:7.1.1"
@@ -3716,6 +3984,13 @@ __metadata:
languageName: node
linkType: hard
+"pretty-format@npm:^3.8.0":
+ version: 3.8.0
+ resolution: "pretty-format@npm:3.8.0"
+ checksum: 10c0/69f12937bfb7b2a537a7463b9f875a16322401f1e44d7702d643faa0d21991126c24c093217ef6da403b54c15942a834174fa1c016b72e2cb9edaae6bb3729b6
+ languageName: node
+ linkType: hard
+
"prismjs@npm:^1.29.0":
version: 1.29.0
resolution: "prismjs@npm:1.29.0"
@@ -3932,7 +4207,7 @@ __metadata:
languageName: node
linkType: hard
-"resolve@npm:^1.22.4":
+"resolve@npm:^1.22.4, resolve@npm:^1.22.8":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
dependencies:
@@ -3945,7 +4220,7 @@ __metadata:
languageName: node
linkType: hard
-"resolve@patch:resolve@npm%3A^1.22.4#optional!builtin":
+"resolve@patch:resolve@npm%3A^1.22.4#optional!builtin, resolve@patch:resolve@npm%3A^1.22.8#optional!builtin":
version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d"
dependencies:
@@ -4286,8 +4561,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "space-ahead@workspace:."
dependencies:
+ "@astrojs/preact": "npm:^3.1.0"
"@astrojs/rss": "npm:^4.0.5"
astro: "npm:^4.3.1"
+ preact: "npm:^10.19.4"
languageName: unknown
linkType: soft