From d262be82dd193cb776868be673e3690dd3860e27 Mon Sep 17 00:00:00 2001 From: Grant Date: Thu, 11 Apr 2024 15:22:27 -0600 Subject: [PATCH] =?UTF-8?q?add=20settings=20sidebar=20&=20initial=20templa?= =?UTF-8?q?ting=20support=20=F0=9F=8E=89=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/components/App.tsx | 12 +- .../client/src/components/CanvasWrapper.tsx | 4 +- packages/client/src/components/Header.tsx | 5 + .../components/Settings/SettingsSidebar.tsx | 26 + .../components/Settings/TemplateSettings.tsx | 70 +++ packages/client/src/components/Template.scss | 15 + packages/client/src/components/Template.tsx | 89 +++ packages/client/src/contexts/AppContext.tsx | 5 + .../client/src/contexts/TemplateContext.tsx | 65 ++ packages/client/src/lib/routes.ts | 36 +- packages/client/src/lib/template.ts | 570 ++++++++++++++++++ packages/client/src/lib/webgl.ts | 99 +++ packages/client/src/style.scss | 55 +- packages/lib/src/net.ts | 2 + 14 files changed, 1043 insertions(+), 10 deletions(-) create mode 100644 packages/client/src/components/Settings/SettingsSidebar.tsx create mode 100644 packages/client/src/components/Settings/TemplateSettings.tsx create mode 100644 packages/client/src/components/Template.scss create mode 100644 packages/client/src/components/Template.tsx create mode 100644 packages/client/src/contexts/TemplateContext.tsx create mode 100644 packages/client/src/lib/template.ts create mode 100644 packages/client/src/lib/webgl.ts diff --git a/packages/client/src/components/App.tsx b/packages/client/src/components/App.tsx index 3b55af3..63eb065 100644 --- a/packages/client/src/components/App.tsx +++ b/packages/client/src/components/App.tsx @@ -2,13 +2,19 @@ import { Header } from "./Header"; import { AppContext } from "../contexts/AppContext"; import { CanvasWrapper } from "./CanvasWrapper"; import { Pallete } from "./Pallete"; +import { TemplateContext } from "../contexts/TemplateContext"; +import { SettingsSidebar } from "./Settings/SettingsSidebar"; const App = () => { return ( -
- - + +
+ + + + + ); }; diff --git a/packages/client/src/components/CanvasWrapper.tsx b/packages/client/src/components/CanvasWrapper.tsx index b339d13..c1b26e4 100644 --- a/packages/client/src/components/CanvasWrapper.tsx +++ b/packages/client/src/components/CanvasWrapper.tsx @@ -7,12 +7,14 @@ import { ViewportMoveEvent } from "@sc07-canvas/lib/src/renderer/PanZoom"; import throttle from "lodash.throttle"; import { Routes } from "../lib/routes"; import { ICanvasPosition, IPosition } from "@sc07-canvas/lib/src/net"; +import { Template } from "./Template"; export const CanvasWrapper = () => { // to prevent safari from blurring things, use the zoom css property return (
+