diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16d54bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..4dbe6d1 --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,20 @@ +import { defineConfig } from 'astro/config' +import node from "@astrojs/node" + +export default defineConfig({ + output: 'server', + adapter: node({ + mode: "standalone" + }), + devToolbar: { + enabled: false + }, + vite: { + server: { + hmr: false, // Auto Reload + } + }, + experimental: { + serverIslands: true + } +}) diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..3a105f3 Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..e94aa5c --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "minpluto-server-island", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/node": "^8.3.3", + "astro": "^4.14.2" + }, + "devDependencies": { + "sass-embedded": "^1.77.8" + } +} \ No newline at end of file diff --git a/public/default.jpg b/public/default.jpg new file mode 100644 index 0000000..d7854d0 Binary files /dev/null and b/public/default.jpg differ diff --git a/src/components/ChannelCard.astro b/src/components/ChannelCard.astro new file mode 100644 index 0000000..e216ad6 --- /dev/null +++ b/src/components/ChannelCard.astro @@ -0,0 +1,88 @@ +--- +import Video from '@components/Video.astro' +const Channel = await fetch("https://yt.sudovanilla.org/api/v1/channels/UCY1kMZp36IQSyNx_9h4mpCg").then((response) => response.json()) +--- + +
+
+
+ +

{Channel.author}

+
+
+ +
+
+
+ Videos + Playlists + Posts + About +
+
+ {Channel.latestVideos.map((data) => +
+
+ + \ No newline at end of file diff --git a/src/components/ChannelCardSkeleton.astro b/src/components/ChannelCardSkeleton.astro new file mode 100644 index 0000000..742c27e --- /dev/null +++ b/src/components/ChannelCardSkeleton.astro @@ -0,0 +1,150 @@ +--- +import Video from '@components/Video.astro' +const Channel = await fetch("https://yt.sudovanilla.org/api/v1/channels/UCY1kMZp36IQSyNx_9h4mpCg").then((response) => response.json()) +--- + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/components/Video.astro b/src/components/Video.astro new file mode 100644 index 0000000..2813adf --- /dev/null +++ b/src/components/Video.astro @@ -0,0 +1,71 @@ +--- +// Properties +const { + ID, + Title, + Creator, + Views, + UploadDate, + Length +} = Astro.props + +// Format Published Date +const DateFormat = new Date(UploadDate * 1000).toLocaleDateString() + +// Format Views +const ViewsConversion = Intl.NumberFormat('en', { notation: 'compact'}) +const ViewsFormat = ViewsConversion.format(Views) +--- + + +
+ +

{Length}

+
+
+

{Title}

+

By {Creator}

+

{ViewsFormat} Views - {DateFormat}

+
+
+ + \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..e16c13c --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro new file mode 100644 index 0000000..2935979 --- /dev/null +++ b/src/layouts/Default.astro @@ -0,0 +1,21 @@ +--- +const { Title } = Astro.props +--- + + + + {Title} + + +

Without Server Island | Server Island

+ + + + + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro new file mode 100644 index 0000000..0549b3c --- /dev/null +++ b/src/pages/index.astro @@ -0,0 +1,9 @@ +--- +import ChannelCard from '@components/ChannelCard.astro' +import ChannelCardSkeleton from '@components/ChannelCardSkeleton.astro' +import Base from '@layouts/Default.astro' +--- + + + + \ No newline at end of file diff --git a/src/pages/island.astro b/src/pages/island.astro new file mode 100644 index 0000000..ecfdbac --- /dev/null +++ b/src/pages/island.astro @@ -0,0 +1,11 @@ +--- +import ChannelCard from '@components/ChannelCard.astro' +import ChannelCardSkeleton from '@components/ChannelCardSkeleton.astro' +import Base from '@layouts/Default.astro' +--- + + + + + + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e5065e8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@components/*": ["src/components/*"], + "@layouts/*": ["src/layouts/*"] + } + } +} \ No newline at end of file