diff --git a/.gitignore b/.gitignore index b9eeb2c..50e7ce7 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,4 @@ package-lock.json /data /Bruno /tsconfig.tsbuildinfo -/src/public/style.css \ No newline at end of file +/src/public/generated.css \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 803d382..551eb79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ RUN apk --no-cache add \ COPY --from=install /temp/prod/node_modules node_modules COPY --from=builder /root/.cargo/bin/resvg /usr/local/bin/resvg -COPY --from=prerelease /app/src/public/style.css /app/src/public/ +COPY --from=prerelease /app/src/public/generated.css /app/src/public/ # COPY --from=prerelease /app/src/index.tsx /app/src/ # COPY --from=prerelease /app/package.json . COPY . . diff --git a/src/components/base.tsx b/src/components/base.tsx index b368b6e..8cebaab 100644 --- a/src/components/base.tsx +++ b/src/components/base.tsx @@ -7,7 +7,7 @@ export const BaseHtml = ({ {title} - + { return postcss([tw(config)]).process(sourceText, { from: "./src/main.css", - to: "./public/style.css", + to: "./public/generated.css", }); }); diff --git a/src/index.tsx b/src/index.tsx index 34b81b3..c582e13 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,12 @@ +import { randomInt, randomUUID } from "node:crypto"; +import { rmSync } from "node:fs"; +import { mkdir, unlink } from "node:fs/promises"; import cookie from "@elysiajs/cookie"; import { html } from "@elysiajs/html"; import { jwt, type JWTPayloadSpec } from "@elysiajs/jwt"; import { staticPlugin } from "@elysiajs/static"; import { Database } from "bun:sqlite"; import { Elysia, t } from "elysia"; -import { randomInt, randomUUID } from "node:crypto"; -import { rmSync } from "node:fs"; -import { mkdir, unlink } from "node:fs/promises"; import { BaseHtml } from "./components/base"; import { Header } from "./components/header"; import { @@ -173,7 +173,8 @@ const app = new Elysia({ Report any issues on{" "} + href="https://github.com/C4illin/ConvertX" + > GitHub . @@ -343,7 +344,11 @@ const app = new Elysia({
{ACCOUNT_REGISTRATION ? ( - + Register an account ) : null} @@ -528,7 +533,8 @@ const app = new Elysia({
+ class="relative flex h-48 w-full items-center justify-center rounded border border-dashed border-gray-700 transition-all hover:border-gray-600 [&.dragover]:border-4 [&.dragover]:border-gray-500" + > Choose a file or drag it here @@ -543,7 +549,8 @@ const app = new Elysia({
+ class="relative mx-auto mb-[35vh] w-full max-w-4xl" + >
(
+ data-converter={converter} + >
{converter}
@@ -573,7 +581,8 @@ const app = new Elysia({ data-target={target} data-converter={converter} type="button" - safe> + safe + > {target} ))} @@ -588,7 +597,8 @@ const app = new Elysia({ name="convert_to" aria-label="Convert to" required - hidden> + hidden + > @@ -624,7 +634,8 @@ const app = new Elysia({ ([converter, targets]) => (
+ data-converter={converter} + >
{converter}
@@ -638,7 +649,8 @@ const app = new Elysia({ data-target={target} data-converter={converter} type="button" - safe> + safe + > {target} ))} @@ -901,7 +913,8 @@ const app = new Elysia({ + href={`/results/${job.id}`} + > View @@ -966,7 +979,8 @@ const app = new Elysia({ onclick="downloadAll()" {...(files.length !== job.num_files ? { disabled: true, "aria-busy": "true" } - : "")}> + : "")} + > {files.length === job.num_files ? "Download All" : "Converting..."} @@ -995,7 +1009,8 @@ const app = new Elysia({ + href={`/download/${outputPath}${file.output_file_name}`} + > View @@ -1003,7 +1018,8 @@ const app = new Elysia({ + download={file.output_file_name} + > Download @@ -1066,7 +1082,8 @@ const app = new Elysia({ onclick="downloadAll()" {...(files.length !== job.num_files ? { disabled: true, "aria-busy": "true" } - : "")}> + : "")} + > {files.length === job.num_files ? "Download All" : "Converting..."} @@ -1095,7 +1112,8 @@ const app = new Elysia({ + href={`/download/${outputPath}${file.output_file_name}`} + > View @@ -1103,7 +1121,8 @@ const app = new Elysia({ + download={file.output_file_name} + > Download @@ -1240,7 +1259,7 @@ if (process.env.NODE_ENV !== "production") { await import("./helpers/tailwind").then(async ({ generateTailwind }) => { const result = await generateTailwind(); - app.get("/style.css", ({ set }) => { + app.get("/generated.css", ({ set }) => { set.headers["content-type"] = "text/css"; return result; });