Add new styles for home and landing pages
- Created home.css with comprehensive styles for the home page layout, including typography, buttons, and responsive design adjustments. - Created landing.css to style the landing page, focusing on typography, layout, and responsive behavior for various screen sizes.
This commit is contained in:
57
scripts/dashboard-preview.ts
Normal file
57
scripts/dashboard-preview.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
// Isolated browser QA server. Never opens or changes the user's database.
|
||||
import { fixture } from "../src/habits/test-fixture";
|
||||
import { createApi } from "../src/api";
|
||||
import index from "../src/index.html";
|
||||
|
||||
const f = fixture();
|
||||
const origin = "http://127.0.0.1:3107";
|
||||
const previewCookie = "minabot_dashboard_preview_session";
|
||||
const app = createApi(
|
||||
f.db,
|
||||
{
|
||||
origin,
|
||||
clientId: "",
|
||||
clientSecret: "",
|
||||
cookieSecret: "preview-only-secret-at-least-32-characters",
|
||||
},
|
||||
undefined,
|
||||
() => Date.parse("2026-09-04T12:00:00Z"),
|
||||
);
|
||||
const server = Bun.serve({
|
||||
hostname: "127.0.0.1",
|
||||
port: 3107,
|
||||
routes: {
|
||||
"/__preview/login": () =>
|
||||
new Response(null, {
|
||||
status: 302,
|
||||
headers: {
|
||||
Location: "/",
|
||||
"Set-Cookie": `${previewCookie}=${"a".repeat(43)}; Path=/; HttpOnly; SameSite=Lax`,
|
||||
},
|
||||
}),
|
||||
"/api/*": async (request) => {
|
||||
// Translate only the preview cookie; never use or overwrite a real session.
|
||||
const cookie = request.headers
|
||||
.get("cookie")
|
||||
?.split(";")
|
||||
.map((value) => value.trim())
|
||||
.find((value) => value.startsWith(`${previewCookie}=`));
|
||||
const headers = new Headers(request.headers);
|
||||
headers.set(
|
||||
"cookie",
|
||||
cookie ? cookie.replace(previewCookie, "minabot_session") : "",
|
||||
);
|
||||
const response = await app.fetch(new Request(request, { headers }));
|
||||
const setCookie = response.headers.get("set-cookie");
|
||||
if (setCookie)
|
||||
response.headers.set(
|
||||
"set-cookie",
|
||||
setCookie.replace("minabot_session", previewCookie),
|
||||
);
|
||||
return response;
|
||||
},
|
||||
"/*": index,
|
||||
},
|
||||
development: true,
|
||||
});
|
||||
console.log(`Disposable dashboard preview: ${server.url}__preview/login`);
|
||||
Reference in New Issue
Block a user