Skip to content
Merged
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: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN cd /temp/dev && bun install --frozen-lockfile
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
Expand All @@ -24,11 +23,9 @@ COPY --from=prerelease /usr/src/app/package.json .

RUN mkdir -p ./.astro/sessions && chown -R bun:bun ./.astro

# for external access
ENV HOST=0.0.0.0
ENV PORT=4321

# run the app
USER bun
EXPOSE 4321/tcp
ENTRYPOINT [ "bun", "--init", "./dist/server/entry.mjs" ]
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ services:
app:
build: .
image: ${DOCKER_IMAGE:-traitor-royale:latest}
# use env_file to load sensitive vars at runtime (don't bake them into image)
env_file:
- .env
environment:
- HOST=0.0.0.0
- PORT=4321
# do NOT use substitution for secret vars; allow env_file to set them
# CLASH_ROYALE_API_KEY
# RENDER_API
ports:
- "4321:4321"
restart: unless-stopped
57 changes: 42 additions & 15 deletions src/components/SwipeToRevealCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,49 @@ interface SwipeCardProps {

export function SwipeCard({ isImpostor, image }: SwipeCardProps) {
return (
<div className="relative overflow-hidden w-40 rounded-2xl bg-gray-200 shadow-lg bg-clip-border border-4">
{isImpostor ? (
<div className="relative w-full aspect-152/224 flex items-center justify-center rounded-lg overflow-hidden">
<p className="text-xl font-bold text-red-500">IMPOSTOR</p>
// 1. CONTENEDOR PRINCIPAL: Define el tamaño y la forma externa
// He añadido 'aspect-[3/4]' para asegurar que tenga altura de carta, ya que 'absolute' lo requiere.
<div className="relative w-40 aspect-[3/4] overflow-hidden rounded-2xl shadow-lg group">

{/* 2. CAPA BASE: ORO ESTÁTICO (Color de fondo del borde) */}
<div className="absolute inset-0 bg-gradient-to-br from-[#854d0e] via-[#fcd76b] to-[#854d0e]" />

{/* 3. CAPA ANIMADA: LUZ QUE GIRA (El brillo lento) */}
<div className="absolute -inset-[100%] animate-[spin_4s_linear_infinite] bg-[conic-gradient(from_90deg_at_50%_50%,#0000_0%,#0000_40%,#fff_50%,#0000_60%,#0000_100%)] mix-blend-overlay opacity-100" />

{/* 4. MÁSCARA INTERIOR: Donde va el contenido real */}
{/* 'inset-[6px]' define el grosor del borde dorado */}
<div className="absolute inset-[6px] rounded-xl bg-gray-200 overflow-hidden flex flex-col">

{/* Lógica del contenido (Impostor o Imagen) */}
<div className="relative w-full h-full flex items-center justify-center bg-gray-200">
{isImpostor ? (
<div className="flex flex-col items-center justify-center p-2">
{/* He añadido un icono o estilo extra para que resalte */}
<p className="text-xl font-bold text-red-600 drop-shadow-md">IMPOSTOR</p>
</div>
) : (
<img
src={image} // Corregido de 'newImage' a 'image' (prop)
alt="Carta de Clash Royale"
className="w-full h-full object-cover"
/>
)}
</div>
) : (
<img src={image} alt={`Carta de Clash Royale`} className="w-full h-min" />
)}

<motion.div
className="absolute inset-0 h-full bg-gray-600 text-white cursor-grab active:cursor-grabbing"
role="img"
drag="y"
dragConstraints={{ top: 0, bottom: 0 }}
dragElastic={{ top: 0.8 }}
/>
{/* 5. Overlay Deslizable (Framer Motion) */}
{/* Está dentro de la máscara para no tapar el borde dorado */}
<motion.div
className="absolute inset-0 h-full bg-gray-600 text-white cursor-grab active:cursor-grabbing flex items-center justify-center"
role="img"
drag="y"
dragConstraints={{ top: 0, bottom: 0 }}
dragElastic={{ top: 0.8 }}
>
{/* Opcional: Un pequeño indicador visual para arrastrar */}
<div className="w-10 h-1 bg-white/30 rounded-full mb-auto mt-4" />
</motion.div>
</div>
</div>
);
}
}