From 93dfe2be64e8658839bcfe5356adf35f8cde7075 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:04:18 +1100 Subject: initial commit --- src/web/components/app/App.css | 19 ++ src/web/components/app/App.jsx | 29 +++ src/web/components/button/Button.css | 15 ++ src/web/components/button/Button.jsx | 10 + src/web/components/card/Card.css | 5 + src/web/components/card/Card.jsx | 10 + src/web/components/comments/Comments.css | 30 +++ src/web/components/comments/Comments.jsx | 44 ++++ src/web/components/darken/Darken.css | 14 ++ src/web/components/darken/Darken.jsx | 13 ++ src/web/components/forum/Forum.css | 21 ++ src/web/components/forum/Forum.jsx | 14 ++ src/web/components/input/Input.css | 31 +++ src/web/components/input/Input.jsx | 38 ++++ src/web/components/loading/Loading.css | 13 ++ src/web/components/loading/Loading.jsx | 13 ++ src/web/components/login/Login.css | 118 +++++++++++ src/web/components/login/Login.jsx | 218 +++++++++++++++++++ src/web/components/nav_bar/NavBar.css | 304 +++++++++++++++++++++++++++ src/web/components/nav_bar/NavBar.jsx | 174 +++++++++++++++ src/web/components/not_found/NotFound.css | 0 src/web/components/not_found/NotFound.jsx | 10 + src/web/components/post/Post.css | 91 ++++++++ src/web/components/post/Post.jsx | 63 ++++++ src/web/components/posts/Posts.css | 84 ++++++++ src/web/components/posts/Posts.jsx | 163 ++++++++++++++ src/web/components/settings/Settings.css | 0 src/web/components/settings/Settings.jsx | 9 + src/web/components/submission/Submission.css | 146 +++++++++++++ src/web/components/submission/Submission.jsx | 221 +++++++++++++++++++ 30 files changed, 1920 insertions(+) create mode 100644 src/web/components/app/App.css create mode 100644 src/web/components/app/App.jsx create mode 100644 src/web/components/button/Button.css create mode 100644 src/web/components/button/Button.jsx create mode 100644 src/web/components/card/Card.css create mode 100644 src/web/components/card/Card.jsx create mode 100644 src/web/components/comments/Comments.css create mode 100644 src/web/components/comments/Comments.jsx create mode 100644 src/web/components/darken/Darken.css create mode 100644 src/web/components/darken/Darken.jsx create mode 100644 src/web/components/forum/Forum.css create mode 100644 src/web/components/forum/Forum.jsx create mode 100644 src/web/components/input/Input.css create mode 100644 src/web/components/input/Input.jsx create mode 100644 src/web/components/loading/Loading.css create mode 100644 src/web/components/loading/Loading.jsx create mode 100644 src/web/components/login/Login.css create mode 100644 src/web/components/login/Login.jsx create mode 100644 src/web/components/nav_bar/NavBar.css create mode 100644 src/web/components/nav_bar/NavBar.jsx create mode 100644 src/web/components/not_found/NotFound.css create mode 100644 src/web/components/not_found/NotFound.jsx create mode 100644 src/web/components/post/Post.css create mode 100644 src/web/components/post/Post.jsx create mode 100644 src/web/components/posts/Posts.css create mode 100644 src/web/components/posts/Posts.jsx create mode 100644 src/web/components/settings/Settings.css create mode 100644 src/web/components/settings/Settings.jsx create mode 100644 src/web/components/submission/Submission.css create mode 100644 src/web/components/submission/Submission.jsx (limited to 'src/web/components') diff --git a/src/web/components/app/App.css b/src/web/components/app/App.css new file mode 100644 index 0000000..e211974 --- /dev/null +++ b/src/web/components/app/App.css @@ -0,0 +1,19 @@ + +.content { + /* sticky footer */ + flex-grow: 1; + flex-shrink: 0; + + display: flex; + flex-direction: column; + align-items: left; + + padding: 0; + background-color: var(--black-10); +} + +@media (min-width: 40em) { + .content { + padding: 0em 0em 0em var(--menu-width); + } +} \ No newline at end of file diff --git a/src/web/components/app/App.jsx b/src/web/components/app/App.jsx new file mode 100644 index 0000000..ffd2cc7 --- /dev/null +++ b/src/web/components/app/App.jsx @@ -0,0 +1,29 @@ +import React from "react"; +import {Route, Routes} from "react-router-dom"; + +import NavBar from "components/nav_bar/NavBar.jsx"; +import Forum from "components/forum/Forum.jsx"; +import NotFound from "components/not_found/NotFound.jsx"; +import Settings from "components/settings/Settings.jsx"; +import {UserContextProvider} from "contexts/UserContext.jsx"; +import {StateContextProvider} from "contexts/StateContext.jsx"; + +import styles from "./App.css"; + +export default function App() { + return ( + + + +
+ + } /> + } /> + + } /> + +
+
+
+ ); +} diff --git a/src/web/components/button/Button.css b/src/web/components/button/Button.css new file mode 100644 index 0000000..76c5450 --- /dev/null +++ b/src/web/components/button/Button.css @@ -0,0 +1,15 @@ +.button { + padding: 0.75em 1em; + + color: var(--black-98); + background-color: var(--brand-80); + border: 2px solid var(--brand-80); + border-radius: 2em; + font-family: inherit; + letter-spacing: inherit; + cursor: pointer; +} +.button:hover { + color: white; + background-color: var(--brand-90); +} \ No newline at end of file diff --git a/src/web/components/button/Button.jsx b/src/web/components/button/Button.jsx new file mode 100644 index 0000000..8d7de02 --- /dev/null +++ b/src/web/components/button/Button.jsx @@ -0,0 +1,10 @@ +import React from "react"; +import styles from "./Button.css"; + +export default function Button({className, children, ...others}) { + return ( + + ) +} \ No newline at end of file diff --git a/src/web/components/card/Card.css b/src/web/components/card/Card.css new file mode 100644 index 0000000..79d38ac --- /dev/null +++ b/src/web/components/card/Card.css @@ -0,0 +1,5 @@ +.card { + box-shadow: 0 0 0.2em 0.01em var(--black-10); + border-radius: 1.0em; + background-color: var(--black-10); +} \ No newline at end of file diff --git a/src/web/components/card/Card.jsx b/src/web/components/card/Card.jsx new file mode 100644 index 0000000..36c4f1d --- /dev/null +++ b/src/web/components/card/Card.jsx @@ -0,0 +1,10 @@ +import React from "react"; +import styles from "./Card.css"; + +export default function Card({children, className, ...others}) { + return ( +
+ {children} +
+ ); +} \ No newline at end of file diff --git a/src/web/components/comments/Comments.css b/src/web/components/comments/Comments.css new file mode 100644 index 0000000..402e4a2 --- /dev/null +++ b/src/web/components/comments/Comments.css @@ -0,0 +1,30 @@ +.container { + width: 100%; + position: relative; + + /*TODO*/ + display: none; + + justify-content: center; + padding: 1em 1em 0em 0em; + overflow: auto; + + color: var(--black-98); +} + +.card { + padding: 1em; +} + +.originalPost { + +} +.originalPost > h1 { + font-size: 1.8em; +} + +@media (min-width: 80em) { + .container { + display: flex; + } +} \ No newline at end of file diff --git a/src/web/components/comments/Comments.jsx b/src/web/components/comments/Comments.jsx new file mode 100644 index 0000000..66e0f06 --- /dev/null +++ b/src/web/components/comments/Comments.jsx @@ -0,0 +1,44 @@ +import React, {Fragment} from "react"; + +import Card from "components/card/Card.jsx"; + +import styles from "./Comments.css"; + +function OtherComments() { + return ( + + ); +} + +function OriginalComment() { + return ( +
+

Galahs in Australia

+

+ The galah is very common as a companion parrot or avicultural specimen around the world, although generally + absent from Australian aviaries, although permits are available to take a limited number of galahs from + the wild per year for avicultural purposes. When tame, it can be an affectionate and friendly bird that + can learn to talk, as well as mimic other sounds heard in its environment. While it is a noisy bird that may + be unsuitable for apartment living, it is comparatively quieter than other cockatoo species. Like most + parrots, the galah requires plenty of exercise and play time out of its cage as well as several hours of daily + social interaction with humans or other birds in order to thrive in captivity. It may also be prone to obesity + if not provided with a suitable, nutritionally-balanced diet. The World Parrot Trust recommends that captive + galahs should be kept in an aviary with a minimum length of 7 metres. + The breeding requirements include the use upright or tilted logs with a hollow some twenty to thirty + centimetres in diameter. Sand and finer grades of wood material are used to construct their nest, the + availability of eucalypt leaves for the nest lining is also suggested for captive breeding. +

+
+ ); +} + +export default function Comments() { + return ( +
+ + + + +
+ ); +} \ No newline at end of file diff --git a/src/web/components/darken/Darken.css b/src/web/components/darken/Darken.css new file mode 100644 index 0000000..bd3b151 --- /dev/null +++ b/src/web/components/darken/Darken.css @@ -0,0 +1,14 @@ +.darken { + visibility: hidden; + + position: fixed; + inset: 0; + + background-color: rgba(0, 0, 0, 0.0); + cursor: pointer; + transition: background-color var(--transition-time) ease-in-out; +} +.darkenActive { + visibility: initial; + background-color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/src/web/components/darken/Darken.jsx b/src/web/components/darken/Darken.jsx new file mode 100644 index 0000000..7f46365 --- /dev/null +++ b/src/web/components/darken/Darken.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import styles from "./Darken.css"; + +export default function Darken({active, className, ...others}) { + + return ( +
+ ); +} \ No newline at end of file diff --git a/src/web/components/forum/Forum.css b/src/web/components/forum/Forum.css new file mode 100644 index 0000000..4ba6dea --- /dev/null +++ b/src/web/components/forum/Forum.css @@ -0,0 +1,21 @@ +.container { + width: 100%; + + /* + We're using dvh, which is a newish feature that excludes the size of mobile + added menus. If we don't use this and instead use 100vh, we have to scroll + before we see some elements at the bottom of the page. + */ + height: calc(100vh - var(--nav-bar-height)); + height: calc(100dvh - var(--nav-bar-height)); + + display: flex; + + background-color: var(--black-15); +} + +@media(min-width: 40em) { + .container { + border-radius: 1em 0 0 0; + } +} diff --git a/src/web/components/forum/Forum.jsx b/src/web/components/forum/Forum.jsx new file mode 100644 index 0000000..eed0fe9 --- /dev/null +++ b/src/web/components/forum/Forum.jsx @@ -0,0 +1,14 @@ +import React from "react"; + +import Posts from "components/posts/Posts.jsx"; +import Comments from "components/comments/Comments.jsx"; +import styles from "./Forum.css"; + +export default function Forum() { + return ( +
+ + +
+ ); +} \ No newline at end of file diff --git a/src/web/components/input/Input.css b/src/web/components/input/Input.css new file mode 100644 index 0000000..a7da62d --- /dev/null +++ b/src/web/components/input/Input.css @@ -0,0 +1,31 @@ +.container { + display: flex; + flex-direction: column; +} + +.row { + width: 100%; + + display: flex; + justify-content: space-between; + align-items: flex-end; +} + +.input { + padding: 0.2rem 1rem; + margin: 0.5rem 0 1rem; + + background-color: transparent; + border-radius: 2em; + border: 2px solid var(--brand-80); + color: var(--black-98); + font-size: inherit; + font-family: inherit; + letter-spacing: inherit; + resize: none; +} + +.label { + font-size: 1.35em; + font-style: italic; +} diff --git a/src/web/components/input/Input.jsx b/src/web/components/input/Input.jsx new file mode 100644 index 0000000..2c7bc6e --- /dev/null +++ b/src/web/components/input/Input.jsx @@ -0,0 +1,38 @@ +import React from "react"; + +import styles from "./Input.css"; +import animations from "styles/animations.css"; + +function InputField({className, type, id, value, onChange, inputType}) { + // idk how to do this less uglily + switch (inputType) { + case "textarea": + return