diff --git a/src/Toolbar.module.css b/src/Toolbar.module.css new file mode 100644 index 000000000..62d965e9c --- /dev/null +++ b/src/Toolbar.module.css @@ -0,0 +1,60 @@ +.toolbarWrapper { + @apply relative; +} + +.toolbar { + @apply flex gap-4 items-center rounded-full; + @apply border border-cool-20/30 bg-cool-10/50; +} + +:global(.dark) .toolbar { + @apply border-cool-100/50 bg-cool-120/50; +} + +:global(.sketch) .toolbar { + @apply border-fern-20/20 bg-fern-10/20; +} + +:global(.dark .sketch) .toolbar { + @apply border-fern-120/50 bg-fern-100/30; +} + +.toolbarCap { + @apply text-sm font-bold; + @apply bg-cool-20/50 text-cool-100; +} + +:global(.dark) .toolbarCap { + @apply bg-cool-90/50 text-cool-30; +} + +:global(.sketch) .toolbarCap { + @apply bg-fern-20/50 text-fern-100; +} + +:global(.dark .sketch) .toolbarCap { + @apply bg-fern-90/50 text-fern-30; +} + +.label { + @apply self-stretch flex items-center px-4 py-1; + @apply rounded-l-full; +} + +.popoverToggle { + @apply self-stretch m-0 flex items-center px-4 py-1; + @apply rounded-r-full border-none; + @apply hover:bg-cool-20; +} + +:global(.dark) .popoverToggle { + @apply hover:bg-cool-90; +} + +:global(.sketch) .popoverToggle { + @apply hover:bg-fern-20; +} + +:global(.dark .sketch) .popoverToggle { + @apply hover:bg-fern-90; +} diff --git a/src/Toolbar.tsx b/src/Toolbar.tsx index 727ebb262..0ee0221ea 100644 --- a/src/Toolbar.tsx +++ b/src/Toolbar.tsx @@ -11,11 +11,12 @@ import { SetAngleLength } from './components/Toolbar/setAngleLength' import { ConvertToVariable } from './components/Toolbar/ConvertVariable' import { SetAbsDistance } from './components/Toolbar/SetAbsDistance' import { SetAngleBetween } from './components/Toolbar/SetAngleBetween' -import { useState } from 'react' +import { useEffect, useState } from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faPen, faSearch } from '@fortawesome/free-solid-svg-icons' import { Popover } from '@headlessui/react' import { ActionButton } from 'components/ActionButton' +import styles from './Toolbar.module.css' export const Toolbar = () => { const { @@ -34,10 +35,14 @@ export const Toolbar = () => { programMemory: s.programMemory, })) + useEffect(() => { + console.log('guiMode', guiMode) + }, [guiMode]) + return ( - -
- + +
+ {guiMode.mode === 'sketch' ? '2D' : '3D'} @@ -55,13 +60,40 @@ export const Toolbar = () => { Start Sketch - +
Open! + { + setGuiMode({ + mode: 'sketch', + sketchMode: 'selectFace', + }) + }} + className="py-0 px-0.5 bg-chalkboard-10 dark:bg-chalkboard-100" + > + Start Sketch + + { + setGuiMode({ + mode: 'default', + }) + }} + className="py-0 px-0.5 bg-chalkboard-10 dark:bg-chalkboard-100" + > + Exit Sketch + Close {/* //