Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
614c9f0
Setting up GitHub Classroom Feedback
github-classroom[bot] Nov 22, 2023
51b96c4
Changing hover color to red
JoshMance Nov 22, 2023
c1319d3
Changing image hover color to red
JoshMance Nov 22, 2023
6d975cd
Removing default contents
JoshMance Nov 22, 2023
a0657d5
Adding two columns
JoshMance Nov 22, 2023
e6b4ea2
Moving columns up
JoshMance Nov 22, 2023
ae76f79
Correcting entire-page text scale
JoshMance Nov 22, 2023
cf1d366
Adding taskNames variable
JoshMance Nov 22, 2023
cdac90f
Formatting currentTask and newTask
JoshMance Nov 22, 2023
251506b
Renaming all to Josh's Task Planner
JoshMance Nov 22, 2023
6ea3754
Rendering the list task list
JoshMance Nov 22, 2023
98c0db2
Creating submit form
JoshMance Nov 22, 2023
4e03595
New Task now tracks changes
JoshMance Nov 22, 2023
52a9373
Background change
JoshMance Nov 22, 2023
2da15fb
Fixing image url
JoshMance Nov 22, 2023
4f063ae
Create night-sky.jpg
JoshMance Nov 22, 2023
a246750
Merge branch 'main' of https://github.com/CodersforLearning/react-tod…
JoshMance Nov 22, 2023
e226921
Tidying up formatting
JoshMance Nov 22, 2023
fba14e0
Adding tailwind
JoshMance Nov 23, 2023
8766be6
Creating separate function component for tasks
JoshMance Nov 23, 2023
d1aba62
Tasks is now updating from input box correctly
JoshMance Nov 23, 2023
4007286
Formatting
JoshMance Nov 23, 2023
f888267
Fixing tasklist not reloading issue
JoshMance Nov 24, 2023
ecc340d
Adding checkboxes to current tasks
JoshMance Nov 24, 2023
f960f0b
Delete and create buttons now have shading
JoshMance Nov 24, 2023
e465bc6
Create button now has fixed shading
JoshMance Nov 24, 2023
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
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>Josh's Task Planner</title>

</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^2.2.0",
"tailwindcss": "^3.3.5",
"vite": "^3.2.3"
}
}
}
48 changes: 20 additions & 28 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
#root {
max-width: 1280px;
max-width: 3000px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
.listbox {
float: left;
padding-inline: 20px;
margin-top: 20pt;
color:rgb(255, 255, 255);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
li {
color: black;
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
.currentTasks {
background: rgba(253, 255, 255, 0.6);
padding-inline: 150px;
height: 900px;
}

.card {
padding: 2em;
.newTask {
background: rgba(253, 255, 255, 0.6);

padding-inline: 100px;
height: 100px;
}

.read-the-docs {
color: #888;
}



77 changes: 58 additions & 19 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,71 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import './App.css'
import { render } from 'react-dom';



function App() {
const [count, setCount] = useState(0)
const [task, setTask] = useState("");
const [taskList, setTaskList] = useState(["Task 1", "Task 2"]);

function Tasks() {
const tasks = taskList.map((e) => <li key={e}>{e}
<input type="checkbox"/>
<button className="deleteButton"
onClick = {event => {
var newTaskList = [...taskList];
newTaskList.splice(newTaskList.indexOf(e), 1);
setTaskList(newTaskList);
}}>
Delete
</button>

</li> );
return (
<ul> {tasks} </ul>

);
}

return (

<div className="App">
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" className="logo" alt="Vite logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
<h1 className="title">Josh's Task Planner</h1>
<hr/>

<div className="listbox">
<h4> Current Tasks </h4>
<div className="currentTasks">
<Tasks/>
</div>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
</p>

<div className="listbox">
<h4> New Task </h4>
<div className="newTask">
<form id = "newTaskForm">
<input type='text' value={task}
onChange = {event => {
setTask(event.target.value)
event.preventDefault();

}}
/>
<button className="enterButton"
onClick = {event => {
var newTaskList = [...taskList];
newTaskList.push(task);
setTaskList(newTaskList);
event.preventDefault();
}}>
Create
</button>
</form>

</div>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>

</div>
)
}
Expand Down
96 changes: 69 additions & 27 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
font-size: 25px;
line-height: 30px;
font-weight: 500;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
color: azure;

background-image: url(/src/night-sky.jpg);
background-size: contain;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
Expand All @@ -24,47 +25,88 @@ a:hover {
color: #535bf2;
}

ul {
list-style: none;
text-align: left;
padding: 5pt;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
background-image: url("night-sky.jpg");
}

hr {
color: azure;
width: 1280px;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
.title {
font-size: 2em;
line-height: 1;
margin-top: 20px;
}

button {
h4 {
font-size: 1.5em;
line-height: 0.01;
}

.enterButton {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
padding: 0.1em 1em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
color:white;
background-color:rgb(19, 22, 114);
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
.enterButton:hover {
background-color:rgb(19, 22, 114);
}
button:focus,
button:focus-visible {
.enterButton:focus,
.enterButton:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
input[type = text] {
margin-top: 27px;
height: 35px;
font-size: 21px;
}

input[type = checkbox] {
margin-top: 5px;
margin-left: 50px;
width: 30px;
height: 30px;
accent-color: rgb(29, 165, 29);
}

.deleteButton {
margin-left: 50px;
border-radius: 5px;
border: 1px solid transparent;
padding: 0.1em 1em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
color:white;
background-color:rgba(255, 0, 0, 0.46);
cursor: pointer;
transition: border-color 0.25s;
}
.deleteButton:hover {
background-color:rgba(255, 0, 0, 0.868);
}
.deleteButton:focus,
.deleteButton:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
Binary file added src/night-sky.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.