diff --git a/docs/README.md b/docs/README.md index 07c672a..2c9a76c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -68,9 +68,10 @@ Type | Case | Example Folders | kebab-case | `virtual-drive` `.ts` files | camelCase | `virtualRoot.ts` `.tsx` files | PascalCase | `Desktop.tsx` -`.css` files & files in `public` dir | kebab-case | `global.css` +`.css` files & static assets | kebab-case | `global.css` Local `.module.css` files | PascalCase | `Desktop.module.css` Global `.module.css` files | kebab-case | `utils.module.css` +CSS class names | PascalCase | ```.WindowsView``` Variables | camelCase | ```const fooBar = true;``` Global constant variables | MACRO_CASE | ```export const NAME = "ProzillaOS";``` Classes | PascalCase | ```class WindowsManager { }``` diff --git a/index.html b/index.html index b988fde..5723649 100644 --- a/index.html +++ b/index.html @@ -9,13 +9,13 @@ - + - + diff --git a/package.json b/package.json index dd7d1f6..ed881e1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "repository": "https://github.com/Prozilla/ProzillaOS", "type": "module", "scripts": { - "start": "vite --port 3000", + "start": "vite --port 3000 --host", "build": "tsc && vite build", "serve": "vite preview", "predeploy": "npm run build", diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..a25a24f Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/src/components/_utils/button/Button.module.css b/src/components/_utils/button/Button.module.css index d633b6f..0dc34d2 100644 --- a/src/components/_utils/button/Button.module.css +++ b/src/components/_utils/button/Button.module.css @@ -16,10 +16,10 @@ background-color: var(--hover-color); } -.Button-link { +.ButtonLink { text-decoration: none; } -.Button-link > svg { +.ButtonLink > svg { margin-left: 0.5rem; } \ No newline at end of file diff --git a/src/components/_utils/button/Button.tsx b/src/components/_utils/button/Button.tsx index 789c044..bc91c50 100644 --- a/src/components/_utils/button/Button.tsx +++ b/src/components/_utils/button/Button.tsx @@ -17,7 +17,7 @@ export function Button(props: ButtonProps) { className = `${styles.Button} ${className}`; if (href != null) { - className = `${styles["Button-link"]} ${className}`; + className = `${styles.ButtonLink} ${className}`; return (} props.options - * @param {Object} props.shortcuts - */ -export function DropdownButton({ label, options, shortcuts }) { +export function DropdownButton({ label, options, shortcuts }: { label: string; options: { [s: string]: Function; }; shortcuts: { [s: string]: string[]; }; }) { const [open, setOpen] = useState(false); const [tabIndex, setTabIndex] = useState(-1); @@ -19,7 +13,7 @@ export function DropdownButton({ label, options, shortcuts }) { return ( { setOpen(false); }}> -
+
diff --git a/src/components/_utils/progress-bar/ProgressBar.module.css b/src/components/_utils/progress-bar/ProgressBar.module.css index e0c949b..6a555fc 100644 --- a/src/components/_utils/progress-bar/ProgressBar.module.css +++ b/src/components/_utils/progress-bar/ProgressBar.module.css @@ -1,10 +1,10 @@ -.Container { +.ProgressBar { position: relative; width: 15rem; max-width: 100%; min-height: 2rem; max-height: 100%; - background-color: var(--background-color-3); + background-color: var(--background-color-4); } .Fill { diff --git a/src/components/_utils/progress-bar/ProgressBar.tsx b/src/components/_utils/progress-bar/ProgressBar.tsx index 62db103..84cd993 100644 --- a/src/components/_utils/progress-bar/ProgressBar.tsx +++ b/src/components/_utils/progress-bar/ProgressBar.tsx @@ -21,7 +21,7 @@ interface ProgressBarProps { export function ProgressBar({ fillPercentage, fillColor, backgroundColor, align = "left", className = "" }: ProgressBarProps) { return ( -
+
svg { +.ContextMenu .Icon > svg { width: 100%; height: 100%; object-fit: contain; } -.Context-menu .Image-icon { +.ContextMenu .ImageIcon { position: absolute; width: 1rem; height: auto; aspect-ratio: 1; } -.Context-menu .Image-icon div { +.ContextMenu .ImageIcon div { display: flex; width: 100%; height: 100%; } -.Context-menu .Image-icon div > svg { +.ContextMenu .ImageIcon div > svg { width: 100%; height: 100%; object-fit: contain; } -.Context-menu .Shortcut { +.ContextMenu .Shortcut { color: var(--foreground-color-1); } -.Context-menu .Dropdown { +.ContextMenu .Dropdown { position: relative; } -.Context-menu .Dropdown .Dropdown-content { +.ContextMenu .Dropdown .DropdownContent { opacity: 1; position: absolute; top: calc(var(--padding) * -1); @@ -132,12 +132,12 @@ cursor: auto; } -.Context-menu .Dropdown:not(.Active) .Dropdown-content { +.ContextMenu .Dropdown:not(.Active) .DropdownContent { opacity: 0; pointer-events: none; } -.Context-menu .Divider { +.ContextMenu .Divider { width: calc(100% - 0.5rem); height: 2px; border-radius: var(--border-radius-99); @@ -174,11 +174,11 @@ height: 100%; } -.Header-menu .Dropdown-arrow { +.Header-menu .DropdownArrow { display: none; } -.Header-menu .Dropdown-content { +.Header-menu .DropdownContent { display: flex; flex-direction: column; position: absolute; @@ -190,7 +190,7 @@ border-bottom-right-radius: 0.5rem; } -.Header-menu .Dropdown:not(.Active) .Dropdown-content { +.Header-menu .Dropdown:not(.Active) .DropdownContent { opacity: 0; pointer-events: none; } diff --git a/src/components/actions/Actions.tsx b/src/components/actions/Actions.tsx index d0fe1d5..7d49428 100644 --- a/src/components/actions/Actions.tsx +++ b/src/components/actions/Actions.tsx @@ -2,12 +2,7 @@ import { Children, cloneElement, isValidElement, ReactElement, ReactNode, Ref } import { useShortcuts } from "../../hooks/_utils/keyboard"; import styles from "./Actions.module.css"; import { useScreenBounds } from "../../hooks/_utils/screen"; - -export const STYLES = { - CONTEXT_MENU: styles["Context-menu"], - SHORTCUTS_LISTENER: styles["Shortcuts-listener"], - HEADER_MENU: styles["Header-menu"] -}; +import { STYLES } from "../../config/actions.config"; export interface ActionProps { actionId?: string; @@ -84,13 +79,13 @@ export function Actions({ children, className, onAnyTrigger, triggerParams, avoi if (isListener) return iterateOverChildren(children) as ReactElement; - const classNames = [styles.Container]; + const classNames = [styles.Actions]; if (className != null) classNames.push(className); if (alignLeft) - classNames.push(styles["Align-left"]); + classNames.push(styles.AlignLeft); if (alignTop) - classNames.push(styles["Align-top"]); + classNames.push(styles.AlignTop); if (!initiated) classNames.push(styles.Uninitiated); diff --git a/src/components/actions/actions/ClickAction.tsx b/src/components/actions/actions/ClickAction.tsx index b5d4db7..67f9f94 100644 --- a/src/components/actions/actions/ClickAction.tsx +++ b/src/components/actions/actions/ClickAction.tsx @@ -15,7 +15,7 @@ export const ClickAction = memo(({ actionId, label, shortcut, onTrigger, icon }: {icon &&
{typeof icon == "string" - ? + ? : }
} diff --git a/src/components/actions/actions/DropdownAction.tsx b/src/components/actions/actions/DropdownAction.tsx index 730094b..1e08a79 100644 --- a/src/components/actions/actions/DropdownAction.tsx +++ b/src/components/actions/actions/DropdownAction.tsx @@ -32,8 +32,8 @@ export function DropdownAction({ label, icon, children, showOnHover = true }: Dr {icon &&
}

{label}

-
-
+
+
{children}
diff --git a/src/components/apps/_utils/header-menu/HeaderMenu.module.css b/src/components/apps/_utils/header-menu/HeaderMenu.module.css index 40dc069..6dced08 100644 --- a/src/components/apps/_utils/header-menu/HeaderMenu.module.css +++ b/src/components/apps/_utils/header-menu/HeaderMenu.module.css @@ -1,4 +1,4 @@ -.Container { +.HeaderMenu { display: flex; width: 100%; height: 1.5rem; diff --git a/src/components/apps/_utils/header-menu/HeaderMenu.tsx b/src/components/apps/_utils/header-menu/HeaderMenu.tsx index 549c18c..71917c4 100644 --- a/src/components/apps/_utils/header-menu/HeaderMenu.tsx +++ b/src/components/apps/_utils/header-menu/HeaderMenu.tsx @@ -1,9 +1,10 @@ import styles from "./HeaderMenu.module.css"; -import { ActionsProps, Actions, STYLES } from "../../../actions/Actions"; +import { ActionsProps, Actions } from "../../../actions/Actions"; +import { STYLES } from "../../../../config/actions.config"; export function HeaderMenu({ children, ...props }: ActionsProps) { - return
+ return
{children} diff --git a/src/components/apps/_utils/web-view/WebView.module.css b/src/components/apps/_utils/web-view/WebView.module.css index 7f82bf1..e1a43c8 100644 --- a/src/components/apps/_utils/web-view/WebView.module.css +++ b/src/components/apps/_utils/web-view/WebView.module.css @@ -1,4 +1,4 @@ -.Container { +.WebView { display: flex; justify-content: center; align-items: center; @@ -6,7 +6,7 @@ height: 100%; } -.Web-view { +.WebView > iframe { width: 100%; height: 100%; border: none; diff --git a/src/components/apps/_utils/web-view/WebView.tsx b/src/components/apps/_utils/web-view/WebView.tsx index 899c356..c50f613 100644 --- a/src/components/apps/_utils/web-view/WebView.tsx +++ b/src/components/apps/_utils/web-view/WebView.tsx @@ -35,12 +35,11 @@ export const WebView: FC = forwardRef(({ source setHovered(false); }; - return
+ return