Compare commits

...

9 commits

Author SHA1 Message Date
Lio
31cc7defe0 chore: misc 2025-08-20 12:27:13 +02:00
Lio
65d065c489 fix: layouting issues 2025-08-20 12:26:53 +02:00
Lio
acc9df2e16 chore: darken lightbox 2025-08-20 12:26:19 +02:00
Lio
1d88c03bc7 chore: center and blur index div 2025-08-20 12:26:07 +02:00
Lio
029d8b9ce5 chore: adjust cards and images to look better 2025-08-20 12:25:31 +02:00
Lio
fafd6cfe27 fix: gitignore fuckup 2025-08-20 12:24:35 +02:00
Lio
c96dd186e2 fix: typos and more docker file stuff 2025-08-20 12:23:58 +02:00
Lio
a9b83d658d chore: updated ignore files 2025-08-20 12:23:35 +02:00
Lio
70b7daeac0 updated docker files 2025-08-20 12:23:24 +02:00
15 changed files with 1162 additions and 630 deletions

View file

@ -1,3 +1,4 @@
.DS_Store .DS_Store
node_modules node_modules
dist dist
./pocketbase

1
.gitignore vendored
View file

@ -22,3 +22,4 @@ pnpm-debug.log*
# jetbrains setting folder # jetbrains setting folder
.idea/ .idea/
pocketbase/

View file

@ -13,18 +13,11 @@ FROM build-deps AS build
COPY . . COPY . .
ARG POCKETBASE_URL
ENV POCKETBASE_URL=${POCKETBASE_URL}
RUN npm run build RUN npm run build
FROM base AS runtime FROM base AS runtime
COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist COPY --from=build /app/dist ./dist
ARG PORT=4321 EXPOSE 4321
ENV HOST=0.0.0.0 CMD ["node", "./dist/server/entry.mjs"]
ENV PORT=${PORT}
ENV POCKETBASE_URL=${POCKETBASE_URL}
EXPOSE ${PORT}
CMD node ./dist/server/entry.mjs

View file

@ -3,51 +3,15 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args:
PUBLIC_POCKETBASE_URL: ${PUBLIC_POCKETBASE_URL}
PUBLIC_TITLE: ${PUBLIC_TITLE}
PUBLIC_DESCRIPTION: ${PUBLIC_DESCRIPTION}
PUBLIC_USEICONS: ${PUBLIC_USEICONS}
env_file: .env env_file: .env
networks: ports:
- caddy - 4321:4321
labels:
caddy: lion.gay
caddy.reverse_proxy: "{{upstreams 4321}}"
pocketbase: pocketbase:
image: ghcr.io/muchobien/pocketbase:latest image: ghcr.io/muchobien/pocketbase:latest
container_name: pocketbase-gallery container_name: pocketbase-gallery
restart: unless-stopped restart: unless-stopped
networks:
- caddy
volumes:
- /opt/pocketbase/pb_data:/pb_data
- /opt/pocketbase/pb_public:/pb_public
labels:
caddy: pocket.fangs.app
caddy.reverse_proxy: "{{upstreams 8090}}"
caddy:
container_name: "caddy-gallery"
image: videah/caddy-proxy:latest
ports: ports:
- "80:80" - "8090:8090"
- "443:443"
- "443:443/udp"
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- caddy
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - ./pocketbase/pb_data:/pb_data
- caddy_data:/data - ./pocketbase/pb_public:/pb_public
restart: unless-stopped
labels:
caddy.email: "caddy@lion.gay"
caddy.encode: zstd gzip
networks:
caddy:
external: true
volumes:
caddy_data: {}

1576
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,5 @@
--- ---
import pb from "../lib/pb"; import pb from "../lib/pb";
const { href, title, body, image } = Astro.props; const { href, title, body, image } = Astro.props;
let imageURL; let imageURL;
@ -10,11 +9,12 @@ if (image) {
--- ---
<div class="relative max-w-xl mx-auto mt-20 h-32 w-55"> <div class="relative max-w-xl mx-auto mt-20 h-32 w-55">
<a href={href} class="block"> <a href={href} class="block backdrop-blur-md rounded-md h-32 w-64">
{ {
image && ( image && (
<img <img
class="h-32 w-64 object-cover rounded-md" class="h-32 w-64 object-cover rounded-md"
// @ts-ignore
src={imageURL} src={imageURL}
alt={`Cover for ${title}`} alt={`Cover for ${title}`}
/> />

View file

@ -31,9 +31,9 @@ const showNsfw = Astro.url.searchParams.has('nsfw') || false;
<div <div
data-lightbox="true" data-lightbox="true"
id="parent" id="parent"
class=`relative overflow-hidden rounded mb-4 border border-transparent hover:border-gray-300 transition-all duration-300 ease-in-out hover:shadow-lg w-52` class='rounded-lg relative overflow-hidden mb-4 border border-transparent hover:border-gray-300 transition-all duration-300 ease-in-out hover:shadow-lg w-52'
> >
<img src={src} alt={`${alt !== '' ? `${alt}<br>` : ""} ${artist ? `by ${artist}` : ""}`} loading="lazy" /> <img class="rounded-lg" src={src} alt={`${alt !== '' ? `${alt}<br>` : ""} ${artist ? `by ${artist}` : ""}`} loading="lazy" />
{ {
alt && ( alt && (
<div <div

View file

@ -21,11 +21,11 @@ const config = {
--- ---
<aside> <aside>
<div class="p-4"> <div class="p-4 backdrop-blur-md backdrop-brightness-50 rounded-lg ">
<a href="/"> <a href="/" >
{ {
icon && ( icon && (
<Image class={"icon"} src={icon} width={10} height={10} alt={""} /> <Image class={"w-40 h-40 mx-auto object-cover object-center rounded-full"} src={icon} width={10} height={10} alt={""} />
) )
} }
<h1 class="font-bold text-2xl pt-4">{config.title}</h1></a <h1 class="font-bold text-2xl pt-4">{config.title}</h1></a
@ -68,15 +68,4 @@ const config = {
</div> </div>
</div> </div>
</div> </div>
<style>
img.icon {
width: 10rem;
height: 10rem;
margin: 0 auto;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
</style>
</aside> </aside>

View file

@ -1,6 +1,6 @@
<figure class="place-content-center app-lightbox backdrop-blur-md"> <figure class="place-content-center app-lightbox backdrop-blur-md">
<img class="portal" /> <img class="portal" />
<figcaption class="desc rounded font-bold backdrop-blur-sm"></figcaption> <figcaption class="desc rounded font-bold backdrop-blur-sm bg-black/50"></figcaption>
</figure> </figure>
<script> <script>
@ -61,7 +61,7 @@
cursor: zoom-out; cursor: zoom-out;
background-color: var(--bg-color, hsla(0, 0%, 0%, 0.623)); background-color: var(--bg-color, hsla(0, 0%, 0%, 0.623));
opacity: 0; opacity: 0;
transition: opacity 0.35s; transition: opacity ease-in-out 0.35s;
&.is-active { &.is-active {
pointer-events: initial; pointer-events: initial;
@ -83,7 +83,7 @@
transition: transition:
opacity 0.35s, opacity 0.35s,
transform 0.35s; transform 0.35s;
transform: scale(0.2); transform: scale(0.5);
:global(img) { :global(img) {
width: 100%; width: 100%;

1
src/env.d.ts vendored
View file

@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />

View file

@ -4,17 +4,21 @@ import Sidebar from "../components/Sidebar.astro";
import pb from "../lib/pb"; import pb from "../lib/pb";
import c from "../lib/config"; import c from "../lib/config";
const avatarRec = await pb const avatarRec = await pb
.collection("images") .collection("images")
.getFirstListItem("useAsAvatar=true").catch(() => null); .getFirstListItem("useAsAvatar=true", { requestKey: null })
.catch(() => null);
const backgroundRec = await pb const backgroundRec = await pb
.collection("images") .collection("images")
.getFirstListItem("useAsBackground=true").catch(() => null); .getFirstListItem("useAsBackground=true", { requestKey: null })
.catch(() => null);
const icon = avatarRec
const icon = avatarRec ? await pb.files.getUrl(avatarRec, avatarRec.file) : null; ? await pb.files.getUrl(avatarRec, avatarRec.file)
const background = backgroundRec ? await pb.files.getUrl(backgroundRec, backgroundRec.file) : null; : null;
const background = backgroundRec
? await pb.files.getUrl(backgroundRec, backgroundRec.file)
: null;
const socials = await pb.collection("socials").getFullList(); const socials = await pb.collection("socials").getFullList();
const config = { const config = {
@ -39,19 +43,24 @@ export const prerender = false;
<title>{config.title}</title> <title>{config.title}</title>
</head> </head>
<body> <body>
<div class="xl:flex">
<div <div
class="xl:fixed xl:left-0 xl:top-0 w-full xl:w-96 bg-[#11111156] backdrop-blur-md h-full pt-4 box-border text-center" class="static xl:h-screen xl:relative w-full xl:w-96 bg-[#11111156] backdrop-blur-md backdrop-brightness-50 h-full pt-4 box-border text-center"
> >
<Sidebar /> <Sidebar />
</div> </div>
<div
class="max-w-fit ml-auto mr-auto transition-all"
>
<slot /> <slot />
</div>
</div>
</body> </body>
</html> </html>
<style define:vars={{ background: `url(${config.background})` }}> <style define:vars={{ background: `url(${config.background})` }}>
.container {
width: calc(100% - 25rem);
} body {
body {
font-family: system-ui, sans-serif; font-family: system-ui, sans-serif;
background: var(--background); background: var(--background);
background-size: cover; background-size: cover;

View file

@ -39,25 +39,23 @@ const config = {
</head> </head>
<body> <body>
<Lightbox /> <Lightbox />
<div class="xl:flex">
<div <div
class="xl:fixed xl:left-0 xl:top-0 w-full xl:w-96 bg-[#11111156] backdrop-blur-md h-full pt-4 box-border text-center" class="tatic xl:h-screen xl:relative w-full xl:w-96 bg-[#11111156] backdrop-blur-md h-full pt-4 box-border text-center"
> >
<Sidebar /> <Sidebar />
</div> </div>
<div <div
class="container float-none xl:float-right xl:box-border transition-all" class="max-w-fit ml-auto mr-auto transition-all"
> >
<slot /> <slot />
</div> </div>
</div>
</body> </body>
</html> </html>
<style define:vars={{ background: `url(${config.background})` }}> <style define:vars={{ background: `url(${config.background})` }}>
@media screen(xl) {
.container {
width: calc(100% - 25rem);
}
}
body { body {
font-family: system-ui, sans-serif; font-family: system-ui, sans-serif;

View file

@ -20,15 +20,15 @@ const background = backgroundRec ? await pb.files.getUrl(backgroundRec, backgrou
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<title>{config.TITLE}</title> <title>{config.TITLE}</title>
</head> </head>
<body> <body class="flex h-screen">
<div class="m-auto">
<slot /> <slot />
</div>
</body> </body>
</html> </html>
<style define:vars={{ background: `url(${background})` }}> <style define:vars={{ background: `url(${background})` }}>
.container {
width: calc(100% - 25rem);
}
body { body {
font-family: system-ui, sans-serif; font-family: system-ui, sans-serif;
background: var(--background); background: var(--background);

View file

@ -6,7 +6,7 @@ import Card from "../../components/Card.astro";
const characters = await pb const characters = await pb
.collection("characters") .collection("characters")
// @ts-ignore // @ts-ignore
.getFullList({ expand: ["icon"], filter: `(hidden = false)` }); .getFullList({ expand: ["icon"], filter: `(hidden = false)`, requestKey: null });
export const prerender = false; export const prerender = false;
--- ---
@ -14,9 +14,24 @@ export const prerender = false;
<CharacterList> <CharacterList>
<div class="flex flex-col"> <div class="flex flex-col">
<h1 class="text-3xl text-center pt-8">Characters</h1> <h1 class="text-3xl text-center pt-8">Characters</h1>
<div <!-- class="grid grid-cols-2 xl:grid-cols-4 gap-4 columns-2 md:columns-4 self-center p-4" -->
class="grid grid-cols-2 xl:grid-cols-4 gap-4 columns-2 md:columns-4 self-center p-4" <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 2xl:grid-cols-4 gap-4 self-center p-4">
> {
// @ts-ignore
characters.length === 0 && (
<div class="text-center col-span-full">
<p class="text-lg">No characters found.</p>
</div>
)
}
{
// @ts-ignore
characters.length === 0 && (
<div class="text-center col-span-full">
<p class="text-lg">No characters found.</p>
</div>
)
}
{ {
[...characters].map((c) => ( [...characters].map((c) => (
// @ts-ignore // @ts-ignore
@ -30,4 +45,13 @@ export const prerender = false;
} }
</div> </div>
</div> </div>
</CharacterList> </CharacterList>
<style>
@media screen(md) {
.container {
width: calc(100% - 25rem);
}
}
</style>

View file

@ -5,8 +5,8 @@ import IndexLayout from "../layouts/Index.astro";
--- ---
<IndexLayout> <IndexLayout>
<div class="flex flex-col "> <div class="flex flex-col items-center justify-centerß">
<div class=" flex gap-4 columns-2 md:columns-4 self-center"> <div class="mx-auto my-auto">
<Sidebar /> <Sidebar />
</div> </div>
</div> </div>