Skip to content

Commit bffb434

Browse files
studyplanner
1 parent 14dcb2c commit bffb434

File tree

6 files changed

+145
-166
lines changed

6 files changed

+145
-166
lines changed

client/src/components/Dashboard.jsx

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,57 @@ const Dashboard = () => {
6161
<div className="w-screen">
6262
<Navbar />
6363
<div className="flex flex-col items-center h-screen w-screen text-center bg-gradient-to-tr from-violet-700 via-green-600 to-green-400 mt-3">
64-
<div className="grid grid-cols-2 gap-16 py-16 h-96">
64+
<div className="grid grid-cols-4 gap-4 py-12 h-12">
65+
<motion.div
66+
className="bg-slate-100 rounded-lg shadow-lg py-6 w-72"
67+
variants={containerVariants}
68+
initial="hidden"
69+
animate="visible"
70+
transition={{ delay: 0.2 }}
71+
>
72+
<h3 className="mb-4">Total hours</h3>
73+
<pre></pre>
74+
</motion.div>
75+
<motion.div
76+
className="bg-slate-100 rounded-lg shadow-lg py-6"
77+
variants={containerVariants}
78+
initial="hidden"
79+
animate="visible"
80+
transition={{ delay: 0.2 }}
81+
>
82+
<h3 className="mb-4">Maximum retention</h3>
83+
<pre></pre>
84+
</motion.div>
85+
<motion.div
86+
className="bg-slate-100 rounded-lg shadow-lg py-6"
87+
variants={containerVariants}
88+
initial="hidden"
89+
animate="visible"
90+
transition={{ delay: 0.2 }}
91+
>
92+
<h3 className="mb-4">Completed hours</h3>
93+
<pre></pre>
94+
</motion.div>
95+
<motion.div
96+
className="bg-slate-100 rounded-lg shadow-lg py-6"
97+
variants={containerVariants}
98+
initial="hidden"
99+
animate="visible"
100+
transition={{ delay: 0.2 }}
101+
>
102+
<h3 className="mb-4">Average retention</h3>
103+
<pre></pre>
104+
</motion.div>
105+
106+
107+
108+
109+
</div>
110+
111+
<div className="grid grid-cols-2 gap-16 py-16">
65112
<div className="grid grid-cols-2 gap-4">
66113
<motion.div
67-
className="bg-slate-100 rounded-lg shadow-lg py-6 h-96 w-60"
114+
className="bg-slate-100 rounded-lg shadow-lg py-6 h-88 w-60"
68115
variants={containerVariants}
69116
initial="hidden"
70117
animate="visible"
@@ -90,7 +137,7 @@ const Dashboard = () => {
90137
</div>
91138

92139
<motion.div
93-
className="bg-slate-50 rounded-lg shadow-lg py-6 w-120"
140+
className="bg-slate-50 rounded-lg shadow-lg py-6 w-120 h-96"
94141
variants={containerVariants}
95142
initial="hidden"
96143
animate="visible"

client/src/components/Hero.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Hero() {
1010
<div className="mr-auto place-self-center lg:col-span-7">
1111
<h1 className="max-w-2xl mb-4 text-4xl font-extrabold tracking-tight leading-none md:text-5xl xl:text-6xl text-white">Unlock Your Academic Potential with LearnMateAI</h1>
1212
<p className="max-w-2xl mb-6 font-light lg:mb-8 md:text-lg lg:text-xl text-white">Personalized Learning for Smarter Results</p>
13-
<Link to='/uploadnote'>
13+
<Link to='/uploadn'>
1414
<a href="#" className="inline-flex items-center justify-center px-5 py-3 mr-3 text-base font-medium text-center text-white rounded-lg bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 ">
1515
Get started
1616
<svg className="w-5 h-5 ml-2 -mr-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fillRule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clipRule="evenodd"></path></svg>
Lines changed: 73 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,76 @@
1-
import React from 'react'
2-
import Navbar from './Navbar'
3-
import Timetable from './Timetable'
4-
function Studyplanner() {
1+
import React from "react";
2+
import Navbar from "./Navbar";
3+
4+
const StudyPlanner = () => {
5+
const studySchedule = [
6+
{
7+
day: 1,
8+
subjects: [
9+
{ time: "10:00 AM", subject: "Math" },
10+
{ time: "11:00 AM", subject: "Physics" },
11+
],
12+
},
13+
{
14+
day: 2,
15+
subjects: [
16+
{ time: "12:00 PM", subject: "English" },
17+
{ time: "1:00 PM", subject: "Chemistry" },
18+
],
19+
},
20+
{
21+
day: 3,
22+
subjects: [
23+
{ time: "3:00 PM", subject: "History" },
24+
{ time: "4:00 PM", subject: "Geography" },
25+
],
26+
},
27+
{
28+
day: 4,
29+
subjects: [
30+
{ time: "5:00 PM", subject: "Biology" },
31+
{ time: "6:00 PM", subject: "Computer Science" },
32+
],
33+
},
34+
{
35+
day: 5,
36+
subjects: [
37+
{ time: "7:00 PM", subject: "Economics" },
38+
{ time: "8:00 PM", subject: "Business Studies" },
39+
],
40+
},
41+
{
42+
day: 6,
43+
subjects: [
44+
{ time: "9:00 PM", subject: "Accountancy" },
45+
{ time: "10:00 PM", subject: "Political Science" },
46+
],
47+
},
48+
];
49+
550
return (
6-
<div>
7-
<Navbar />
8-
<Timetable />
51+
<div className="w-screen">
52+
<Navbar />
53+
<div className="flex flex-col items-center h-screen w-screen text-center bg-gradient-to-tr from-violet-700 via-green-600 to-green-400 mt-3">
54+
<h1 className="text-3xl text-white font-bold mb-4 mt-4">Study Planner</h1>
55+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 px-6">
56+
{studySchedule.map((slot) => (
57+
<div
58+
key={slot.day}
59+
className="bg-white rounded-lg shadow-md p-4 flex flex-col"
60+
>
61+
<p className="text-lg font-semibold mb-2">Day {slot.day}</p>
62+
{slot.subjects.map((subject, index) => (
63+
<div key={index} className="flex items-center justify-between mb-2">
64+
<p className="text-base md:text-lg font-semibold">{subject.time}</p>
65+
<p className="text-gray-500 text-sm md:text-base">{subject.subject}</p>
66+
</div>
67+
))}
68+
</div>
69+
))}
70+
</div>
71+
</div>
972
</div>
10-
)
11-
}
73+
);
74+
};
1275

13-
export default Studyplanner
76+
export default StudyPlanner;

client/src/components/Timetable.jsx

Lines changed: 0 additions & 133 deletions
This file was deleted.

client/src/components/Uploadn.jsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Uploadn({ moduleNumber }) {
1010
const [uploading, setUploading] = useState(false);
1111
const [uploadSuccess, setUploadSuccess] = useState(false);
1212
const [showSuccessMessage, setShowSuccessMessage] = useState(false);
13-
const [fadeOut, setFadeOut] = useState(false);
13+
const [fadeOut, setFadeOut] = useState(false); // New state to control fading out
1414

1515
const handleNumNotesChange = (event) => {
1616
const count = parseInt(event.target.value, 10);
@@ -85,6 +85,21 @@ function Uploadn({ moduleNumber }) {
8585
setUploading(false);
8686
});
8787
};
88+
const handleNextButtonClick = () => {
89+
// Call the API URL: https://3f2ssd7loqowjtj7hnzhni7trq0blutk.lambda-url.us-east-1.on.aws/notestotext
90+
fetch('https://3f2ssd7loqowjtj7hnzhni7trq0blutk.lambda-url.us-east-1.on.aws/notestotext')
91+
.then((response) => {
92+
if (response.ok) {
93+
// Handle the response here
94+
console.log('API call successful');
95+
} else {
96+
throw new Error('Error calling API');
97+
}
98+
})
99+
.catch((error) => {
100+
console.error('Error calling API:', error);
101+
});
102+
};
88103

89104
const saveFileLocally = (filePath, file) => {
90105
return new Promise((resolve, reject) => {
@@ -111,20 +126,6 @@ function Uploadn({ moduleNumber }) {
111126
setFadeOut(false);
112127
};
113128

114-
const handleFinish = () => {
115-
fetch('https://3f2ssd7loqowjtj7hnzhni7trq0blutk.lambda-url.us-east-1.on.aws/notestotext')
116-
.then((response) => {
117-
if (response.ok) {
118-
// Handle successful response
119-
} else {
120-
throw new Error('Error requesting data');
121-
}
122-
})
123-
.catch((error) => {
124-
console.error('Error requesting data:', error);
125-
});
126-
};
127-
128129
const renderUploadInputs = () => {
129130
const inputs = [];
130131

@@ -181,9 +182,11 @@ function Uploadn({ moduleNumber }) {
181182
>
182183
{uploading ? 'Uploaded' : 'Upload'}
183184
</motion.button>
184-
<Link to="/uploadp" className="bg-green-500 text-white py-2 ml-4 px-6 mt-4 rounded-lg">
185+
<Link to="/uploadp" className="bg-green-500 text-white py-2 ml-4 px-6 mt-4 rounded-lg" onClick={handleNextButtonClick}>
185186
Next
186187
</Link>
188+
189+
187190
</>
188191
) : (
189192
<>
@@ -201,9 +204,7 @@ function Uploadn({ moduleNumber }) {
201204
<Link to="/uploadp" className="text-blue-500 mt-8">
202205
Next
203206
</Link>
204-
<button className="text-blue-500 mt-8" onClick={handleFinish}>
205-
Finish
206-
</button>
207+
207208
</>
208209
)}
209210
</motion.div>

client/src/components/Uploadnote.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function Uploadnote({ moduleNumber }) {
170170
<Link to="/uploadp" className="bg-green-500 text-white py-2 ml-4 px-6 mt-4 rounded-lg">
171171
Next
172172
</Link>
173+
173174
</>
174175
) : (
175176
<>

0 commit comments

Comments
 (0)