Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"pause": "^0.1.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-icons": "^5.5.0",
"react-router-dom": "^7.9.5",
"tailwind-merge": "^3.3.1",
"tailwindcss": "^4.1.14"
Expand Down
23 changes: 4 additions & 19 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ import NavBar from "./components/NavBar"; //
import Home from "./components/Home";
import Timer from "./components/Timer";
import ToDoList from "./ToDoList";
import GooberMenu from "./components/GooberMenu";
import RenderGooberMenu from "./RenderGooberMenu";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";

function App() {
// had to add because bootstrap defaults to light mode
document.documentElement.setAttribute("data-bs-theme", "dark");

// Current Players data
const [currentXP, setXP] = useState(50);
const [level, setLevel] = useState(9);
const [money, setMoney] = useState(0);
const [currentHealth, setHealth] = useState(50);

return (
<Router>
<div
Expand All @@ -30,22 +24,13 @@ function App() {
<div>
<NavBar />
</div>
<GooberMenu
setXP={setXP}
setLevel={setLevel}
setMoney={setMoney}
setHealth={setHealth}
currentXP={currentXP}
level={level}
money={money}
currentHealth={currentHealth}
/>

<Routes>
<Route path="/" element={<Home />} />
<Route path="/" element={<><RenderGooberMenu /><Home /></>} />
<Route path="/settings" element={<SettingsMenu />} />
<Route path="/timer" element={<Timer />} />
<Route path="/todo" element={<ToDoList />} />
<Route path="*" element={<Home />} />

</Routes>
</div>
</Router>
Expand Down
27 changes: 27 additions & 0 deletions frontend/src/RenderGooberMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

import React, { useState } from "react";
import GooberMenu from "./components/GooberMenu";
import "./index.css";

export default function RenderGooberMenu() {

// Current Players data
const [currentXP, setXP] = useState(50);
const [level, setLevel] = useState(9);
const [money, setMoney] = useState(0);
const [currentHealth, setHealth] = useState(50);

return(
<GooberMenu
setXP={setXP}
setLevel={setLevel}
setMoney={setMoney}
setHealth={setHealth}
currentXP={currentXP}
level={level}
money={money}
currentHealth={currentHealth}
/>

)
}
23 changes: 23 additions & 0 deletions frontend/src/ToDoList.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.todolist-logo{

}

.todolist-addItem{
margin: 30px 10px;
}

.todolist-item{

}

.todolist-item button{
opacity:0;
}

.todolist-item:hover button{
opacity:1;
}

.todolist-checkbox{
margin:0px 20px;
}
35 changes: 20 additions & 15 deletions frontend/src/ToDoList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useState } from "react";
import { FaTrash } from 'react-icons/fa';
import "./App.css";
import "./ToDoList.css";

export default function ToDoList() {
const [items, setItems] = useState([
Expand Down Expand Up @@ -61,26 +63,29 @@ export default function ToDoList() {
margin: "0 auto",
listStyleType: "none",
padding: 0,
maxHeight: "auto",
}}
>
{items.map((item) => (
<li key={item} className="todolist-item">
<div className="wrapper">
<input
type="checkbox"
id={`checkbox-${item}`}
name={item}
checked={checkedItems[item]}
onChange={() => checkItem(item)}
/>
<label htmlFor={`checkbox-${item}`}>{item}</label>
<label htmlFor={`checkbox-${item}`}>
<input
type="checkbox"
id={`checkbox-${item}`}
name={item}
checked={checkedItems[item]}
onChange={() => checkItem(item)}
className="todolist-checkbox"
/>
{item}</label>
<div>
<button
className="todolist-trashbutton"
onClick={() => removeItem(item)}
>
<FaTrash />
</button>
</div>
<button
className="todolist-trashbutton"
onClick={() => removeItem(item)}
>
Del
</button>
</li>
))}
</ul>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/NavBar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.navbar{
margin:20px;
gap: 10px;
}
3 changes: 2 additions & 1 deletion frontend/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useNavigate } from "react-router-dom";
//import { useState } from 'react';
import "bootstrap/dist/css/bootstrap.min.css";
import "./NavBar.css";

const NavBar = () => {
const navigate = useNavigate();
Expand All @@ -17,7 +18,7 @@ const NavBar = () => {
navigate('/todo');
}
return (
<div>
<div className="navbar">
<button onClick={handleHomeClick}>Home</button>
<button onClick={handleSettingsClick}>Settings</button>
<button onClick={handleTimerClick}>Timer</button>
Expand Down