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: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ node_modules/

secretshare*

vendor/
vendor/
node_modules/
4 changes: 3 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"lint": { "rules": { "tags": ["fresh", "recommended"] } },
"exclude": ["**/_fresh/*"],
"nodeModulesDir": "auto",
"imports": {
"@/": "./",
"@bjesuiter/deno-tailwindcss-iso": "jsr:@bjesuiter/[email protected]",
Expand All @@ -29,7 +30,8 @@
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"tailwind-merge": "npm:tailwind-merge@^3.3.1"
"tailwind-merge": "npm:tailwind-merge@^3.3.1",
"tailwindcss": "npm:tailwindcss@^3.4.1"
},
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }
}
9 changes: 6 additions & 3 deletions fresh.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { defineConfig } from "$fresh/server.ts";

export default defineConfig({});
import { defineConfig } from "$fresh/server.ts";
import tailwind from "$fresh/plugins/tailwind.ts";

export default defineConfig({
plugins: [tailwind()],
});
2 changes: 0 additions & 2 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as $_404 from "./routes/_404.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $_layout from "./routes/_layout.tsx";
import * as $api_create from "./routes/api/create.ts";
import * as $api_res_tailwind_css from "./routes/api/res/tailwind.css.ts";
import * as $api_secret_uuid_ from "./routes/api/secret/[uuid].ts";
import * as $create from "./routes/create.tsx";
import * as $index from "./routes/index.tsx";
Expand All @@ -25,7 +24,6 @@ const manifest = {
"./routes/_app.tsx": $_app,
"./routes/_layout.tsx": $_layout,
"./routes/api/create.ts": $api_create,
"./routes/api/res/tailwind.css.ts": $api_res_tailwind_css,
"./routes/api/secret/[uuid].ts": $api_secret_uuid_,
"./routes/create.tsx": $create,
"./routes/index.tsx": $index,
Expand Down
6 changes: 3 additions & 3 deletions islands/CreateSecret.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import onSubmit from "@/src/formHandler/create.ts";
import CustomExpireInForm from "../components/CreateSecret/CustomExpireInForm.tsx";
import CustomExpireInForm from "@/components/CreateSecret/CustomExpireInForm.tsx";
import PassphraseInput from "@/components/CreateSecret/PassphraseInput.tsx";
import ViewCountLimitInput from "../components/CreateSecret/ViewCountLimitInput.tsx";
import ViewCountLimitInput from "@/components/CreateSecret/ViewCountLimitInput.tsx";

export default function CreateSecret() {
return (
Expand Down Expand Up @@ -34,7 +34,7 @@ export default function CreateSecret() {
<ViewCountLimitInput />
</div>

<button class="p-2" type="submit">
<button class="p-2 rounded-lg bg-primary" type="submit">
Anlegen
</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion islands/FetchSecret.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function FetchSecret(
name="fetchSecretButton"
type="submit"
disabled={fetched.value}
class="p-2"
class={"p-2 rounded-lg" + (fetched.value ? " bg-slate-400 cursor-not-allowed" : " bg-primary")}
>
Abrufen
</button>
Expand Down
2 changes: 1 addition & 1 deletion islands/Log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function renderMessage(message: RichMessage | undefined) {
case "secretFetch":
return (
<CardMsg header="Secret Data" extraInfo={message.extraInfo}>
<pre class="monospace whitespace-pre-wrap wrap-anywhere bg-gray-100 p-2 rounded-md overflow-auto max-w-[90dvw] w-full">
<pre class="monospace whitespace-pre-wrap break-words bg-gray-100 p-2 rounded-md overflow-auto w-full">
{message.secret}
</pre>
</CardMsg>
Expand Down
8 changes: 0 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@ import "@std/dotenv/load";
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
import config from "./fresh.config.ts";
import { computeTailwindStyles } from "./src/utils/cssCache.ts";

// custom things to do before starting the server
try {
await computeTailwindStyles();
} catch (e) {
console.error(`ON STARTUP: Error while computing tailwind styles: `, e);
}

await start(manifest, config);
2 changes: 1 addition & 1 deletion routes/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function App({ Component }: PageProps) {
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SecretShare</title>
<link rel="stylesheet" href="/styles.css" />
<link rel="stylesheet" href="/api/res/tailwind.css" />
{/* <link rel="stylesheet" href="/api/res/tailwind.css" /> */}
</head>
<body class="min-w-[220px] mb-8">
<Component />
Expand Down
32 changes: 0 additions & 32 deletions routes/api/res/tailwind.css.ts

This file was deleted.

64 changes: 0 additions & 64 deletions src/utils/cssCache.ts

This file was deleted.

62 changes: 3 additions & 59 deletions static/styles.css
Original file line number Diff line number Diff line change
@@ -1,59 +1,3 @@

*,
*::before,
*::after {
box-sizing: border-box;
}

button, [role="button"] {
cursor: pointer;
}

button {
background-color: transparent;
padding: 0.5rem;
border: 1px solid black;
border-radius: 4px;
font-size: 1em;
}

textarea {
resize: both;
}

button:disabled {
cursor: not-allowed;
opacity: 0.5;
}

code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
img,
svg {
display: block;
}
img,
video {
max-width: 100%;
height: auto;
}

html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.transition-colors {
transition-property: background-color, border-color, color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}

.tabular-nums {
font-variant-numeric: tabular-nums;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
15 changes: 15 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { type Config } from "tailwindcss";

export default {
content: [
"{routes,islands,components}/**/*.{ts,tsx,js,jsx}",
],
theme: {
extend: {
colors: {
"primary": "oklch(0.7751 0.127965 240.0314)",
"primary-dark": "oklch(0.5327 0.1152 242.02)",
},
},
},
} satisfies Config;