Compare commits
No commits in common. "2836369b3bdcaeb770d0880e3db12dafe693f766" and "1c54e0832b754afac6e4a62b5d3e8ff92356b080" have entirely different histories.
2836369b3b
...
1c54e0832b
|
@ -1,9 +1,10 @@
|
||||||
import './Dashboard.css';
|
import './Dashboard.css';
|
||||||
|
import Card from './components/Card/Card';
|
||||||
|
import Launcher from './components/Launcher/Launcher';
|
||||||
import Launchpad from './components/Launchpad/Launchpad';
|
import Launchpad from './components/Launchpad/Launchpad';
|
||||||
|
|
||||||
const LightThemes = () =>
|
const LightThemes = () => <Card name="Light Themes">
|
||||||
<Launchpad
|
<Launchpad
|
||||||
title="Lights"
|
|
||||||
exclusive={true}
|
exclusive={true}
|
||||||
options={[
|
options={[
|
||||||
{ title: "Dark reds" },
|
{ title: "Dark reds" },
|
||||||
|
@ -12,10 +13,18 @@ const LightThemes = () =>
|
||||||
{ title: "Darkness" },
|
{ title: "Darkness" },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
</Card>
|
||||||
|
|
||||||
const Tracks = () =>
|
const LightSetup = () => <div> </div>
|
||||||
|
|
||||||
|
interface LightProps {
|
||||||
|
name: string,
|
||||||
|
}
|
||||||
|
|
||||||
|
const Light = ({ name }: LightProps) => <div> <p> {name} </p> </div>
|
||||||
|
|
||||||
|
const Tracks = () => <Card name="Tracks">
|
||||||
<Launchpad
|
<Launchpad
|
||||||
title="Tracks"
|
|
||||||
exclusive={false}
|
exclusive={false}
|
||||||
options={[
|
options={[
|
||||||
{ title: "City BGM" },
|
{ title: "City BGM" },
|
||||||
|
@ -24,10 +33,15 @@ const Tracks = () =>
|
||||||
{ title: "Water dripping" },
|
{ title: "Water dripping" },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
</Card>
|
||||||
|
|
||||||
const Presets = () =>
|
interface TrackProps {
|
||||||
|
name: string,
|
||||||
|
}
|
||||||
|
const Track = ({ name }: TrackProps) => <Launcher title={name} />
|
||||||
|
|
||||||
|
const Presets = () => <Card name="Presets">
|
||||||
<Launchpad
|
<Launchpad
|
||||||
title="Presets"
|
|
||||||
exclusive={true}
|
exclusive={true}
|
||||||
options={[
|
options={[
|
||||||
{ title: "Gilcrest Falls day" },
|
{ title: "Gilcrest Falls day" },
|
||||||
|
@ -36,6 +50,15 @@ const Presets = () =>
|
||||||
{ title: "Surk colony" },
|
{ title: "Surk colony" },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
interface PresetProps {
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// const Scene = ({ name }: PresetProps) => <Launcher title={name} activated={false} />
|
||||||
|
|
||||||
|
const SceneEditor = () => <div> </div>
|
||||||
|
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -2,12 +2,12 @@ import { PropsWithChildren } from 'react';
|
||||||
import './Card.css';
|
import './Card.css';
|
||||||
|
|
||||||
interface CardProps {
|
interface CardProps {
|
||||||
title: string,
|
name: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Card = ({ title, children }: PropsWithChildren<CardProps>) => (
|
const Card = ({ name, children }: PropsWithChildren<CardProps>) => (
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<h1 className="card__title"> {title} </h1>
|
<h1 className="card__title"> {name} </h1>
|
||||||
<div className="card__body">
|
<div className="card__body">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
.activator {
|
||||||
|
border: 1px solid black;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: var(--spacer-m);
|
||||||
|
padding: var(--spacer-s);
|
||||||
|
box-shadow: var(--shadow-deep);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activator_enabled {
|
||||||
|
box-shadow: var(--activator-ring);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
import './Launcher.css';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export interface LauncherProps {
|
||||||
|
title: string,
|
||||||
|
icon?: string,
|
||||||
|
activated?: boolean,
|
||||||
|
onSelected?: (key: string) => void,
|
||||||
|
}
|
||||||
|
|
||||||
|
const Launcher = ({ title, activated = false, onSelected = (key) => {} }: LauncherProps) => {
|
||||||
|
const classnames = activated ? "activator activator_enabled" : "activator";
|
||||||
|
console.log("classnames ", activated, classnames);
|
||||||
|
return (
|
||||||
|
<div className={classnames} onClick={() => onSelected(title)}>
|
||||||
|
<p> {title} </p>
|
||||||
|
</div>)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Launcher;
|
|
@ -1,14 +1,11 @@
|
||||||
.launchpad {
|
.launchpad {
|
||||||
|
display: flex;
|
||||||
border: var(--border);
|
border: var(--border);
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
box-shadow: var(--shadow-depression);
|
box-shadow: var(--shadow-depression);
|
||||||
margin: var(--spacer-l);
|
margin: var(--spacer-l);
|
||||||
}
|
}
|
||||||
|
|
||||||
.launchpad__title {
|
|
||||||
color: var(--title-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.launchpad_horizontal-flow {
|
.launchpad_horizontal-flow {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import './Launchpad.css';
|
import './Launchpad.css';
|
||||||
import { LaunchpadButton, LaunchpadButtonProps, EditPadButton } from '../LaunchpadButton/types';
|
import Launcher, { LauncherProps } from '../Launcher/Launcher';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
export interface Selectable {
|
export interface Selectable {
|
||||||
onSelected?: (key: string) => void;
|
onSelected?: (key: string) => void;
|
||||||
|
@ -9,10 +10,9 @@ export interface Selectable {
|
||||||
export type Flow = "horizontal" | "vertical";
|
export type Flow = "horizontal" | "vertical";
|
||||||
|
|
||||||
interface LaunchpadProps {
|
interface LaunchpadProps {
|
||||||
title?: string;
|
|
||||||
exclusive: boolean;
|
exclusive: boolean;
|
||||||
flow?: Flow;
|
flow?: Flow;
|
||||||
options: Array<LaunchpadButtonProps>;
|
options: Array<LauncherProps>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const exclusiveSelect = (state: { [key: string]: boolean }, targetId: string) => {
|
const exclusiveSelect = (state: { [key: string]: boolean }, targetId: string) => {
|
||||||
|
@ -28,20 +28,22 @@ const multiSelect = (state: { [key: string]: boolean }, targetId: string) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Launchpad = ({ title, flow = "horizontal", options, exclusive }: LaunchpadProps) => {
|
const Launchpad = ({ flow = "horizontal", options, exclusive }: LaunchpadProps) => {
|
||||||
const [selected, dispatch] = React.useReducer(exclusive ? exclusiveSelect : multiSelect, {});
|
const [selected, dispatch] = React.useReducer(exclusive ? exclusiveSelect : multiSelect, {});
|
||||||
|
|
||||||
|
let classOptions = [ "launchpad" ];
|
||||||
|
|
||||||
|
if (flow === "horizontal") {
|
||||||
|
classOptions.push("launchpad_horizontal-flow");
|
||||||
|
} else {
|
||||||
|
classOptions.push("launchpad_vertical-flow");
|
||||||
|
}
|
||||||
|
|
||||||
let tiedOptions = options.map(option =>
|
let tiedOptions = options.map(option =>
|
||||||
<LaunchpadButton key={option.title} title={option.title} onSelected={(key: string) => dispatch(key)} activated={selected[option.title]} />
|
<Launcher key={option.title} title={option.title} onSelected={(key: string) => dispatch(key)} activated={selected[option.title]} />
|
||||||
);
|
);
|
||||||
|
|
||||||
return (<div className="launchpad">
|
return (<div className={classnames(classOptions)}> {tiedOptions} </div>)
|
||||||
{title && <h1 className="launchpad__title"> {title} </h1>}
|
|
||||||
<div className={flow === "horizontal" ? "launchpad_horizontal-flow" : "launchpad_vertical-flow"}>
|
|
||||||
{tiedOptions}
|
|
||||||
<EditPadButton text="Add" />
|
|
||||||
</div>
|
|
||||||
</div>)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Launchpad;
|
export default Launchpad;
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
.launchpad-button {
|
|
||||||
border: 1px solid black;
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
margin: var(--spacer-m);
|
|
||||||
padding: var(--spacer-s);
|
|
||||||
box-shadow: var(--shadow-deep);
|
|
||||||
}
|
|
||||||
|
|
||||||
.launchpad-button_enabled {
|
|
||||||
box-shadow: var(--activator-ring);
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-pad-button {
|
|
||||||
border: var(--border-faint);
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
margin: var(--spacer-m);
|
|
||||||
padding: var(--spacer-s);
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
import './styles.css';
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
export interface LaunchpadButtonProps {
|
|
||||||
title: string,
|
|
||||||
icon?: string,
|
|
||||||
activated?: boolean,
|
|
||||||
onSelected?: (key: string) => void,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const LaunchpadButton = ({ title, activated = false, onSelected = (key) => { } }: LaunchpadButtonProps) => {
|
|
||||||
const classnames = activated ? "launchpad-button launchpad-button_enabled" : "launchpad-button";
|
|
||||||
return (
|
|
||||||
<div className={classnames} onClick={() => onSelected(title)}>
|
|
||||||
<p> {title} </p>
|
|
||||||
</div>)
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EditPadButtonProps {
|
|
||||||
text: string,
|
|
||||||
onSelected?: () => void,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const EditPadButton = ({ text, onSelected = () => { } }: EditPadButtonProps) => (
|
|
||||||
<div className="edit-pad-button" onClick={() => onSelected()}>
|
|
||||||
<p> {text} </p>
|
|
||||||
</div>)
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
--title-color: var(--grey-1);
|
--title-color: var(--grey-1);
|
||||||
|
|
||||||
--border: 1px solid var(--purple-1);
|
--border: 1px solid var(--purple-1);
|
||||||
--border-faint: 1px solid var(--grey-4);
|
|
||||||
--activator-ring: 0px 0px 8px 4px var(--blue-4);
|
--activator-ring: 0px 0px 8px 4px var(--blue-4);
|
||||||
--shadow-depression: inset 1px 1px 2px 0px var(--purple-1);
|
--shadow-depression: inset 1px 1px 2px 0px var(--purple-1);
|
||||||
--shadow-shallow: 1px 1px 2px 0px var(--purple-1);
|
--shadow-shallow: 1px 1px 2px 0px var(--purple-1);
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import './index.css';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
|
import './index.css';
|
||||||
import Dashboard from './Dashboard';
|
import Dashboard from './Dashboard';
|
||||||
import Setup from './pages/Setup';
|
|
||||||
import Design from './Design';
|
import Design from './Design';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
||||||
|
@ -15,10 +14,6 @@ const router = createBrowserRouter([
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <Dashboard />,
|
element: <Dashboard />,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/setup",
|
|
||||||
element: <Setup />,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/design",
|
path: "/design",
|
||||||
element: <Design />,
|
element: <Design />,
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
import './Setup.css'
|
|
||||||
import Card from '../components/Card/Card';
|
|
||||||
|
|
||||||
const Setup = () => (<div>
|
|
||||||
<h1> Setup </h1>
|
|
||||||
|
|
||||||
<Card title="Scenes" />
|
|
||||||
<Card title="Lights">
|
|
||||||
<p> Connect to nearby light systems </p>
|
|
||||||
</Card>
|
|
||||||
<Card title="Sounds">
|
|
||||||
</Card>
|
|
||||||
</div>)
|
|
||||||
|
|
||||||
export default Setup;
|
|
Loading…
Reference in New Issue