mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
fix: Colors
This commit is contained in:
@@ -14,6 +14,7 @@ import { AuthProvider, useAuth } from './providers/auth';
|
|||||||
import { Navigate, Route, Router } from "@solidjs/router";
|
import { Navigate, Route, Router } from "@solidjs/router";
|
||||||
import { globalStyle, macaron$ } from "@macaron-css/core";
|
import { globalStyle, macaron$ } from "@macaron-css/core";
|
||||||
import { Component, createSignal, Match, onCleanup, Switch } from 'solid-js';
|
import { Component, createSignal, Match, onCleanup, Switch } from 'solid-js';
|
||||||
|
import TestComponent from './pages/test';
|
||||||
|
|
||||||
const Root = styled("div", {
|
const Root = styled("div", {
|
||||||
base: {
|
base: {
|
||||||
@@ -87,12 +88,14 @@ export const App: Component = () => {
|
|||||||
<Route
|
<Route
|
||||||
path="*"
|
path="*"
|
||||||
component={(props) => (
|
component={(props) => (
|
||||||
<AuthProvider>
|
// <AuthProvider>
|
||||||
{props.children}
|
// {props.children}
|
||||||
</AuthProvider>
|
props.children
|
||||||
|
// </AuthProvider>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Route path="play/:id" component={PlayComponent} />
|
<Route path="play/:id" component={PlayComponent} />
|
||||||
|
<Route path="test" component={TestComponent} />
|
||||||
<Route
|
<Route
|
||||||
path="/"
|
path="/"
|
||||||
component={() => {
|
component={() => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { render } from "solid-js/web";
|
|||||||
import "modern-normalize/modern-normalize.css";
|
import "modern-normalize/modern-normalize.css";
|
||||||
import { App } from "./App";
|
import { App } from "./App";
|
||||||
import { StorageProvider } from "./providers/account";
|
import { StorageProvider } from "./providers/account";
|
||||||
import { ToastProvider, Toaster } from "solid-notifications";
|
// import { ToastProvider, Toaster } from "solid-notifications";
|
||||||
|
|
||||||
const root = document.getElementById("root");
|
const root = document.getElementById("root");
|
||||||
|
|
||||||
@@ -20,12 +20,12 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
|
|||||||
|
|
||||||
render(
|
render(
|
||||||
() => (
|
() => (
|
||||||
<ToastProvider>
|
// <ToastProvider>
|
||||||
<Toaster />
|
// <Toaster />
|
||||||
<StorageProvider>
|
<StorageProvider>
|
||||||
<App />
|
<App />
|
||||||
</StorageProvider>
|
</StorageProvider>
|
||||||
</ToastProvider>
|
// </ToastProvider>
|
||||||
),
|
),
|
||||||
root!
|
root!
|
||||||
);
|
);
|
||||||
@@ -5,7 +5,7 @@ import { useParams } from "@solidjs/router";
|
|||||||
import { Keyboard, Mouse, WebRTCStream } from "@nestri/input";
|
import { Keyboard, Mouse, WebRTCStream } from "@nestri/input";
|
||||||
import { Container, FullScreen } from "@nestri/www/ui/layout";
|
import { Container, FullScreen } from "@nestri/www/ui/layout";
|
||||||
import { styled } from "@macaron-css/solid";
|
import { styled } from "@macaron-css/solid";
|
||||||
import { theme } from "../ui/theme";
|
import { lightClass, theme, darkClass } from "@nestri/www/ui/theme";
|
||||||
|
|
||||||
const Canvas = styled("canvas", {
|
const Canvas = styled("canvas", {
|
||||||
base: {
|
base: {
|
||||||
@@ -14,23 +14,27 @@ const Canvas = styled("canvas", {
|
|||||||
height: "100%",
|
height: "100%",
|
||||||
objectFit: "contain",
|
objectFit: "contain",
|
||||||
maxHeight: "100vh",
|
maxHeight: "100vh",
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const ModalContainer = styled("div", {
|
const ModalContainer = styled("div", {
|
||||||
base: {
|
base: {
|
||||||
width: "100%",
|
width: "100%",
|
||||||
maxWidth: 370,
|
maxWidth: 370,
|
||||||
maxHeight: "75vh",
|
maxHeight: "75vh",
|
||||||
borderRadius: 12,
|
height: "auto",
|
||||||
borderWidth: 1,
|
// borderRadius: 12,
|
||||||
borderStyle: "solid",
|
// borderWidth: 1,
|
||||||
borderColor: theme.color.gray.d400,
|
// borderStyle: "solid",
|
||||||
backgroundColor: theme.color.pink.d400,
|
// borderColor: theme.color.gray.d400,
|
||||||
boxShadow: theme.color.boxShadow,
|
// backgroundColor: theme.color.pink.d400,
|
||||||
backdropFilter: "blur(20px)",
|
backgroundColor: theme.color.red.d300,
|
||||||
|
// boxShadow: theme.color.boxShadow,
|
||||||
|
// backdropFilter: "blur(20px)",
|
||||||
padding: "20px 25px"
|
padding: "20px 25px"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export function PlayComponent() {
|
export function PlayComponent() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const id = params.id;
|
const id = params.id;
|
||||||
@@ -240,6 +244,21 @@ export function PlayComponent() {
|
|||||||
|
|
||||||
function createModal() {
|
function createModal() {
|
||||||
const [open, setOpen] = createSignal(false);
|
const [open, setOpen] = createSignal(false);
|
||||||
|
const [theme, setTheme] = createSignal<string>(
|
||||||
|
window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||||
|
? "dark"
|
||||||
|
: "light",
|
||||||
|
);
|
||||||
|
|
||||||
|
const darkMode = window.matchMedia("(prefers-color-scheme: dark)");
|
||||||
|
const setColorScheme = (e: MediaQueryListEvent) => {
|
||||||
|
setTheme(e.matches ? "dark" : "light");
|
||||||
|
};
|
||||||
|
darkMode.addEventListener("change", setColorScheme);
|
||||||
|
onCleanup(() => {
|
||||||
|
darkMode.removeEventListener("change", setColorScheme);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openModal() {
|
openModal() {
|
||||||
@@ -250,6 +269,7 @@ export function PlayComponent() {
|
|||||||
<Portal>
|
<Portal>
|
||||||
<Show when={open()}>
|
<Show when={open()}>
|
||||||
<div
|
<div
|
||||||
|
class={theme() === "light" ? lightClass : darkClass} id="styled"
|
||||||
style={`
|
style={`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
|
|||||||
18
packages/www/src/pages/test.tsx
Normal file
18
packages/www/src/pages/test.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { styled } from "@macaron-css/solid";
|
||||||
|
import { theme } from "../ui/theme";
|
||||||
|
|
||||||
|
|
||||||
|
const Testing = styled("div", {
|
||||||
|
base: {
|
||||||
|
height: "100%",
|
||||||
|
width: "100%",
|
||||||
|
position: "fixed",
|
||||||
|
backgroundColor: theme.color.blue.d600
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default function TestComponent() {
|
||||||
|
return (
|
||||||
|
<Testing />
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user