Skip to content

Commit

Permalink
some touch support
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Oct 20, 2024
1 parent 4951cff commit bc7095d
Show file tree
Hide file tree
Showing 12 changed files with 1,690 additions and 1,646 deletions.
374 changes: 187 additions & 187 deletions apps/web/src/app/playground/Editor.tsx

Large diffs are not rendered by default.

73 changes: 40 additions & 33 deletions apps/web/src/app/playground/index.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,63 @@
import { clientOnly } from "@solidjs/start";
import "./playground.css";

const Editor = clientOnly(() => import("./Editor"));

export default function () {
return (
<div class="w-screen h-screen bg-neutral-900 text-white flex flex-col">
<Header />
<main class="flex-1 w-full bg-neutral-800 overflow-hidden">
<Editor />
</main>
</div>
);
return (
<div class="w-screen h-screen bg-neutral-900 text-white flex flex-col">
<Meta name="apple-mobile-web-app-capable" content="yes" />
<Meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<Header />
<main class="flex-1 w-full bg-neutral-800 overflow-hidden">
<Editor />
</main>
</div>
);
}

const MenuItems = clientOnly(() =>
import("./Editor").then((i) => ({ default: i.ConnectionsDialogButton })),
import("./Editor").then((i) => ({ default: i.ConnectionsDialogButton })),
);
const ProjectName = clientOnly(() =>
import("./Editor").then((i) => ({ default: i.ProjectName })),
import("./Editor").then((i) => ({ default: i.ProjectName })),
);
const ExportButton = clientOnly(() =>
import("./Editor").then((i) => ({ default: i.ExportButton })),
import("./Editor").then((i) => ({ default: i.ExportButton })),
);
const ShareButton = clientOnly(() =>
import("./Editor").then((i) => ({ default: i.ShareButton })),
import("./Editor").then((i) => ({ default: i.ShareButton })),
);
import { HeaderAuthFallback } from "../HeaderAuthSection";
import { Logo } from "../Logo";
import { Meta } from "@solidjs/meta";

const AuthSection = clientOnly(() =>
import("../HeaderAuthSection").then((i) => ({
default: i.HeaderAuthSection,
})),
import("../HeaderAuthSection").then((i) => ({
default: i.HeaderAuthSection,
})),
);

function Header() {
return (
<header class="w-full flex flex-row p-2 justify-between items-center h-12">
<div class="flex-1 flex flex-row gap-2 items-center">
<Logo />
<MenuItems />
</div>
<div class="text-sm font-medium">
<ProjectName />
</div>
<div class="flex-1 flex flex-row justify-end items-center gap-1">
<div class="flex-1 pl-2">
<ExportButton />
<ShareButton />
</div>
<AuthSection fallback={<HeaderAuthFallback />} />
</div>
</header>
);
return (
<header class="w-full flex flex-row p-2 justify-between items-center h-12">
<div class="flex-1 flex flex-row gap-2 items-center">
<Logo />
<MenuItems />
</div>
<div class="text-sm font-medium">
<ProjectName />
</div>
<div class="flex-1 flex flex-row justify-end items-center gap-1">
<div class="flex-1 pl-2">
<ExportButton />
<ShareButton />
</div>
<AuthSection fallback={<HeaderAuthFallback />} />
</div>
</header>
);
}
3 changes: 3 additions & 0 deletions apps/web/src/app/playground/playground.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
overscroll-behavior-y: none;
}
40 changes: 18 additions & 22 deletions apps/web/src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import { StartServer, createHandler } from "@solidjs/start/server";

export default createHandler(
() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<link rel="icon" href="/favicon.png" />
{assets}
</head>
<body class="bg-neutral-900" id="app">
{children}
{scripts}
</body>
</html>
)}
/>
),
{ mode: "async" },
() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
{assets}
</head>
<body class="bg-neutral-900" id="app">
{children}
{scripts}
</body>
</html>
)}
/>
),
{ mode: "async" },
);
1 change: 1 addition & 0 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@solid-primitives/marker": "^0.0.3",
"@solid-primitives/memo": "^1.3.8",
"@solid-primitives/mouse": "^2.0.19",
"@solid-primitives/platform": "^0.1.2",
"@solid-primitives/refs": "^1.0.8",
"@solid-primitives/resize-observer": "^2.0.25",
"@solid-primitives/scheduled": "^1.4.3",
Expand Down
Loading

0 comments on commit bc7095d

Please sign in to comment.