diff --git a/README.md b/README.md index 92c9efa..ca8f3a1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ProzillaOS -ProzillaOS is a web operating system inspired by Ubuntu Linux and Windows made in React by Prozilla. It aims to function much like a real operating system, with the exception of running entirely on the web. +ProzillaOS is a web operating system inspired by Ubuntu Linux and Windows made with React by Prozilla. It aims to function much like a real operating system, with the exception of running entirely on the web. > Please note that ProzillaOS is far from complete and many additional features will be added in the future. diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000..de19b61 Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000..e564b55 Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..7b90fe6 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/browserconfig.xml b/public/browserconfig.xml new file mode 100644 index 0000000..eac1c4e --- /dev/null +++ b/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #222f3e + + + diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000..dece282 Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000..31b5c9c Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index a11777c..89d8e14 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index 40afe1c..37b45fb 100644 --- a/public/index.html +++ b/public/index.html @@ -1,43 +1,30 @@ - - - - - - - - - ProzillaOS + + + + + + + + + + + + + + + + + + + + - +
- diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index f4c44ad..107e81c 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -2,22 +2,17 @@ "short_name": "ProzillaOS", "name": "ProzillaOS", "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], "start_url": ".", "display": "standalone", "theme_color": "#000000", diff --git a/public/media/fonts/Poppins/OFL.txt b/public/media/fonts/Poppins/OFL.txt new file mode 100644 index 0000000..76df3b5 --- /dev/null +++ b/public/media/fonts/Poppins/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/public/media/fonts/Poppins/Poppins-Black.ttf b/public/media/fonts/Poppins/Poppins-Black.ttf new file mode 100644 index 0000000..71c0f99 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Black.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-BlackItalic.ttf b/public/media/fonts/Poppins/Poppins-BlackItalic.ttf new file mode 100644 index 0000000..7aeb58b Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-BlackItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Bold.ttf b/public/media/fonts/Poppins/Poppins-Bold.ttf new file mode 100644 index 0000000..00559ee Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Bold.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-BoldItalic.ttf b/public/media/fonts/Poppins/Poppins-BoldItalic.ttf new file mode 100644 index 0000000..e61e8e8 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-BoldItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-ExtraBold.ttf b/public/media/fonts/Poppins/Poppins-ExtraBold.ttf new file mode 100644 index 0000000..df70936 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-ExtraBold.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-ExtraBoldItalic.ttf b/public/media/fonts/Poppins/Poppins-ExtraBoldItalic.ttf new file mode 100644 index 0000000..14d2b37 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-ExtraBoldItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-ExtraLight.ttf b/public/media/fonts/Poppins/Poppins-ExtraLight.ttf new file mode 100644 index 0000000..e76ec69 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-ExtraLight.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-ExtraLightItalic.ttf b/public/media/fonts/Poppins/Poppins-ExtraLightItalic.ttf new file mode 100644 index 0000000..89513d9 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-ExtraLightItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Italic.ttf b/public/media/fonts/Poppins/Poppins-Italic.ttf new file mode 100644 index 0000000..12b7b3c Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Italic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Light.ttf b/public/media/fonts/Poppins/Poppins-Light.ttf new file mode 100644 index 0000000..bc36bcc Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Light.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-LightItalic.ttf b/public/media/fonts/Poppins/Poppins-LightItalic.ttf new file mode 100644 index 0000000..9e70be6 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-LightItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Medium.ttf b/public/media/fonts/Poppins/Poppins-Medium.ttf new file mode 100644 index 0000000..6bcdcc2 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Medium.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-MediumItalic.ttf b/public/media/fonts/Poppins/Poppins-MediumItalic.ttf new file mode 100644 index 0000000..be67410 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-MediumItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Regular.ttf b/public/media/fonts/Poppins/Poppins-Regular.ttf new file mode 100644 index 0000000..9f0c71b Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Regular.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-SemiBold.ttf b/public/media/fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 0000000..74c726e Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-SemiBold.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-SemiBoldItalic.ttf b/public/media/fonts/Poppins/Poppins-SemiBoldItalic.ttf new file mode 100644 index 0000000..3e6c942 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-SemiBoldItalic.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-Thin.ttf b/public/media/fonts/Poppins/Poppins-Thin.ttf new file mode 100644 index 0000000..03e7366 Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-Thin.ttf differ diff --git a/public/media/fonts/Poppins/Poppins-ThinItalic.ttf b/public/media/fonts/Poppins/Poppins-ThinItalic.ttf new file mode 100644 index 0000000..e26db5d Binary files /dev/null and b/public/media/fonts/Poppins/Poppins-ThinItalic.ttf differ diff --git a/public/media/logo.svg b/public/media/logo.svg new file mode 100644 index 0000000..5a0c6c5 --- /dev/null +++ b/public/media/logo.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/mstile-144x144.png b/public/mstile-144x144.png new file mode 100644 index 0000000..bd4937f Binary files /dev/null and b/public/mstile-144x144.png differ diff --git a/public/mstile-150x150.png b/public/mstile-150x150.png new file mode 100644 index 0000000..128f878 Binary files /dev/null and b/public/mstile-150x150.png differ diff --git a/public/mstile-310x150.png b/public/mstile-310x150.png new file mode 100644 index 0000000..e79217d Binary files /dev/null and b/public/mstile-310x150.png differ diff --git a/public/mstile-310x310.png b/public/mstile-310x310.png new file mode 100644 index 0000000..cd5aec7 Binary files /dev/null and b/public/mstile-310x310.png differ diff --git a/public/mstile-70x70.png b/public/mstile-70x70.png new file mode 100644 index 0000000..79a891b Binary files /dev/null and b/public/mstile-70x70.png differ diff --git a/public/safari-pinned-tab.svg b/public/safari-pinned-tab.svg new file mode 100644 index 0000000..88dc337 --- /dev/null +++ b/public/safari-pinned-tab.svg @@ -0,0 +1,345 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/App.js b/src/App.js index 8f7dae8..493fd24 100644 --- a/src/App.js +++ b/src/App.js @@ -1,18 +1,21 @@ +import { useEffect, useState } from "react"; import "./App.css"; import { TaskBar } from "./components/TaskBar.js"; -import { Window } from "./components/Window.js"; -import Application from "./modules/applications/application.js"; -import Vector2 from "./modules/math/vector2.js"; +import WindowsManager from "./modules/windows/windows.js"; + +export const windowsManager = new WindowsManager(); function App() { + const [windows, setWindows] = useState([]); + + useEffect(() => { + setWindows(Object.values(windowsManager.windows)); + }, []); + return (
- + {windows}
); } diff --git a/src/components/TaskBar.css b/src/components/TaskBar.css index cfc1adb..3133f72 100644 --- a/src/components/TaskBar.css +++ b/src/components/TaskBar.css @@ -16,6 +16,8 @@ } .Task-bar button { + display: flex; + align-items: center; color: var(--foreground-color-a); background: none; cursor: pointer; diff --git a/src/components/TaskBar.js b/src/components/TaskBar.js index 783e4c2..cd99278 100644 --- a/src/components/TaskBar.js +++ b/src/components/TaskBar.js @@ -3,6 +3,8 @@ import "./TaskBar.css"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faBatteryFull, faSearch, faVolumeHigh, faWifi } from "@fortawesome/free-solid-svg-icons"; import { ReactSVG } from "react-svg"; +import ApplicationsManager from "../modules/applications/applications.js"; +import { windowsManager } from "../App.js"; export function TaskBar() { const [date, setDate] = useState(new Date()); @@ -19,21 +21,11 @@ export function TaskBar() { - - - - - + {ApplicationsManager.APPLICATIONS.forEach((app) => + + )}
- +
); diff --git a/src/components/Window.css b/src/components/Window.css index 04a2a4b..aeb91fd 100644 --- a/src/components/Window.css +++ b/src/components/Window.css @@ -38,6 +38,9 @@ .Header > button { margin: 0; padding: 0.5rem; + height: var(--header-height); + display: flex; + align-items: center; } .Header button { diff --git a/src/components/Window.js b/src/components/Window.js index d4955a4..840d10f 100644 --- a/src/components/Window.js +++ b/src/components/Window.js @@ -3,8 +3,9 @@ import "./Window.css"; import { faMinus, faXmark } from "@fortawesome/free-solid-svg-icons"; import { faSquare } from "@fortawesome/free-regular-svg-icons"; import { ReactSVG } from "react-svg"; +import { windowsManager } from "../App.js"; -export function Window({ app, size, position, focused = false, minimized = false, maximized = false }) { +export function Window({ id, app, size, position, focused = false, minimized = false, maximized = false }) { return (
-
diff --git a/src/index.css b/src/index.css index 522db7a..2219224 100644 --- a/src/index.css +++ b/src/index.css @@ -26,13 +26,63 @@ --background-color-a: var(--dark-grey-b); --background-color-b: var(--dark-grey-c); --background-color-c: var(--dark-grey-d); + + --body-font-family: "Poppins", -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-Thin.ttf"); + font-weight: 100; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-ExtraLight.ttf"); + font-weight: 200; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-Light.ttf"); + font-weight: 300; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-Regular.ttf"); + font-weight: 400; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-SemiBold.ttf"); + font-weight: 500; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-Bold.ttf"); + font-weight: 600; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-ExtraBold.ttf"); + font-weight: 700; +} + +@font-face { + font-family: "Poppins"; + src: url("/public/media/fonts/Poppins/Poppins-Black.ttf"); + font-weight: 800; } body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + font-family: var(--body-font-family); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @@ -54,4 +104,9 @@ html, body, #root { * { color: var(--foreground-color-a); box-sizing: border-box; +} + +p, a, button, input, h1, h2, h3, h4, h5, h6 { + font-family: var(--body-font-family); + letter-spacing: 0.01rem; } \ No newline at end of file diff --git a/src/modules/applications/applications.js b/src/modules/applications/applications.js new file mode 100644 index 0000000..0843719 --- /dev/null +++ b/src/modules/applications/applications.js @@ -0,0 +1,20 @@ +import Application from "./application.js"; + +export default class ApplicationsManager { + static APPLICATIONS = [ + new Application("Terminal", "terminal"), + ] + + static getApplication(id) { + let application = null; + + this.APPLICATIONS.forEach((app) => { + if (app.id === id) { + application = app; + return; + } + }); + + return application; + } +} \ No newline at end of file diff --git a/src/modules/windows/windows.js b/src/modules/windows/windows.js index 1992dfe..0c1de6f 100644 --- a/src/modules/windows/windows.js +++ b/src/modules/windows/windows.js @@ -1,5 +1,40 @@ +import { Window } from "../../components/Window.js"; +import ApplicationsManager from "../applications/applications.js"; +import Vector2 from "../math/vector2.js"; + export default class WindowsManager { - constructor() { - this.windows = []; + windows = {}; + + open(appId) { + const appData = ApplicationsManager.getApplication(appId); + const size = new Vector2(800, 400); + const position = new Vector2(300, 200); + + let id = 0; + while (Object.keys(this.windows).includes(id)) { + id++; + } + + console.log(`Opening window ${id}:${appData.id}`); + + this.windows[id] = ; + } + + close(windowId) { + if (!Object.keys(this.windows).includes(windowId)) + return; + + console.log(`Closing window ${windowId}`); + delete this.windows[windowId]; + } + + get windowsCount() { + return Object.keys(this.windows).length; } } \ No newline at end of file