-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathHome.jsx
More file actions
164 lines (146 loc) · 5.08 KB
/
Home.jsx
File metadata and controls
164 lines (146 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import React from 'react';
import '../App.css';
import './Home.css';
import { useState } from 'react';
function Home({ onBegin }) {
const [showPopup, setShowPopup] = useState(false);
const [workoutInput, setWorkoutInput] = useState("");
const [newWorkouts, setWorkouts] = useState([]);
const addWorkout = () => {
if (workoutInput.trim() === "") return;
setWorkouts([...newWorkouts, workoutInput.trim()]);
setWorkoutInput("");
}
return (
<div className="home-root">
<header className="home-header">
<h1 className="neon-title text">OSC's Epic Workout App</h1>
<p className="neon-subtitle text">Lock in. Gain aura. Save money.</p>
</header>
<main className="home-main">
{/* Begin Workout - Prominent at the top */}
<div className="begin-container">
<div className="link-card button begin-card">
<div className="card-title text ">Begin Workout</div>
<div className="card-sub text">Primary action</div>
<button
className="begin-button neon-blue text"
onClick={() => {
if (typeof onBegin === 'function') onBegin();
}}
>
Begin Workout
</button>
</div>
</div>
{/* Choices panel */}
<section className="links-panel">
<h2 className="panel-title text">Choices</h2>
<div className="choices-column">
<button className="link-card neon-red small-link" onClick={() => {/* TODO: Implement previous workout functionality */}}>
<div className="card-title text">Previous Workout</div>
<div className="card-sub text">View stats</div>
</button>
<button className="link-card neon-green small-link" onClick={() => {/* TODO: Implement aura board functionality */}}>
<div className="card-title text">Aura Board</div>
<div className="card-sub text">See your aura</div>
</button>
<button className="link-card neon-red small-link" onClick={() => {/* TODO: Implement settings functionality */}}>
<div className="card-title text">Settings</div>
<div className="card-sub text">Adjust app</div>
</button>
<button className="link-card neon-red small-link" onClick={() => setShowPopup(true)}>
<div className="card-title text">Create a workout</div>
<div className="card-sub text">Customize your workout</div>
</button>
{/*popup window itself*/}
{showPopup && (
<div
style={{
position: "fixed",
top: 0,
left: 0,
width: "100vw",
height: "100vh",
background: "rgba(0,0,0,0.5)",
display: "flex",
justifyContent: "center",
alignItems: "center",
zIndex: 1000
}}
>
{/*contents of popup window styling*/}
<div
style={{
background: "black",
padding: "20px",
borderRadius: "12px",
borderColor: "white",
borderWidth: "7px",
borderStyle: "solid",
width: "450px",
height: "300px",
textAlign: "center"
}}
>
<h2>Add a Workout</h2>
<input
type="text"
value={workoutInput}
onChange={(e) => setWorkoutInput(e.target.value)}
placeholder="Enter workout name"
style={{
padding: "10px",
width: "80%",
marginBottom: "10px",
borderRadius: "8px",
border: "1px solid #ccc"
}}
/>
<button
onClick={addWorkout}
style={{
padding: "10px",
background: "#ff4d4d",
color: "black",
borderRadius: "8px",
border: "none",
width: "100%",
cursor: "pointer"
}}
>
Add Workout
</button>
<div style={{ marginTop: "20px", textAlign: "left" }}>
{newWorkouts.map((w, i) => (
<div key={i} style={{ padding: "5px 0" }}>
• {w}
</div>
))}
</div>
<button
onClick={() => setShowPopup(false)}
style={{
marginTop: "80px",
padding: "10px",
background: "#ff4d4d",
color: "black",
borderRadius: "8px",
border: "none",
width: "100%",
cursor: "pointer"
}}
>
Close
</button>
</div>
</div>
)}
</div>
</section>
</main>
<footer className="home-footer text">© OSC Workout App</footer>
</div>
);
}
export default Home;