Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
afb0d69
Add files via upload
kg-git-hub May 16, 2024
c972545
Delete forgot_password.html
uhmull May 16, 2024
0468293
Delete forgot_password.css
uhmull May 16, 2024
658fbe7
Delete forgot_password.js
uhmull May 16, 2024
9cbda2c
Update index.html
uhmull May 16, 2024
eb342f3
Update SchedulePage.html
kg-git-hub May 17, 2024
103134d
Update index.html
uhmull May 19, 2024
1c399c3
Update index.html
uhmull May 19, 2024
d108703
Update index.html
uhmull May 19, 2024
5f6ac48
Update index.html
uhmull May 19, 2024
61c39a4
Update index.html
uhmull May 19, 2024
10597b5
Update index.html
uhmull May 19, 2024
dfb8e2d
Update index.html
uhmull May 19, 2024
44942ea
Update index.html
uhmull May 19, 2024
09676e7
Update home.html
kg-git-hub May 22, 2024
d4c387d
Update home.js
kg-git-hub May 22, 2024
2c2377c
Update home.js
kg-git-hub May 22, 2024
b0339e8
Update home.js
kg-git-hub May 24, 2024
08ca658
Update SchedulePage.html
kg-git-hub May 24, 2024
8a29b37
Update SchedulePage.html
kg-git-hub May 24, 2024
3be564b
Update home.js
kg-git-hub May 24, 2024
7e90ded
Update home.js
kg-git-hub May 24, 2024
803c21b
Update home.js
kg-git-hub May 24, 2024
fe42c0f
Update home.js
kg-git-hub May 24, 2024
8a148be
Update home.js
kg-git-hub May 24, 2024
87b3e6a
Update home.js
kg-git-hub May 24, 2024
c8ed731
Update home.js
kg-git-hub May 24, 2024
1b75866
Update home.js
kg-git-hub May 24, 2024
89c81d2
Update home.js
kg-git-hub May 24, 2024
406a283
Update home.js
kg-git-hub May 24, 2024
bcd4376
Update style.css
kg-git-hub May 24, 2024
92bd006
Update main.css
kg-git-hub May 24, 2024
796c837
Update yapity_yappers.css
kg-git-hub May 24, 2024
1f6bdeb
Update index.html
kg-git-hub May 24, 2024
3a847bb
Update main.css
kg-git-hub May 24, 2024
62750fe
Update main.css
kg-git-hub May 24, 2024
90bb969
Update style.css
kg-git-hub May 24, 2024
6764c97
Update yapity_yappers.css
kg-git-hub May 24, 2024
0217aca
Update index.html
kg-git-hub May 24, 2024
8a756b3
Update style.css
kg-git-hub May 24, 2024
a6cbeea
Update index.html
kg-git-hub May 24, 2024
e186a24
Update home.html
kg-git-hub May 24, 2024
edc0906
Update yapity_yappers.css
kg-git-hub May 24, 2024
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
54 changes: 50 additions & 4 deletions SchedulePage.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,49 @@
<html lang="en">
<link rel="stylesheet" href="yapity_yappers.css">
<head>
<script src="https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.6.0/firebase-database.js"></script>
<script>
// Initialize Firebase
var firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
databaseURL: "YOUR_DATABASE_URL",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
firebase.initializeApp(firebaseConfig);

function scheduleInit() {
// Your existing code...

// Convert the scheduleHTML to a string
var scheduleString = scheduleHTML;

// Get the current user ID
var userId = firebase.auth().currentUser.uid;

// Reference to the Firebase Realtime Database
var database = firebase.database();

// Save the schedule to Firebase
firebase.database().ref('users/' + userId).set({
schedule: scheduleString
}).then(function() {
// Redirect to the SchedulePage.html after saving
window.location.href = "SchedulePage.html";
}).catch(function(error) {
// Handle errors
console.error("Error saving schedule to Firebase: ", error);
});
}
</script>

<style>
:left {
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
.left {
display: flex;
justify-content: center;
align-items: center;
Expand All @@ -12,22 +53,27 @@
.button {
border: none;
background-color: green;
padding: 4px 36px;
padding: 14px 56px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-size: 26px;
margin: 6px 1px;
transition-duration: 0.4s;
cursor: pointer;
}
.subject {
font-family: 'Poppins', sans-serif;
font-size: 40 px;
}
</style>
</head>
<body>
<div class="container">
<img src="SmatStudy_logo (2).png" alt="Girl in a jacket" height="300">
<div class = "left">
<button onclick="show()"><b>Generate your Study Schedule</b><button>
<div id="schedule"></div>
<div id="schedule" class="left"></div>
</div>
</div>
<script src="home.js"></script>
Expand Down
80 changes: 0 additions & 80 deletions forgot_password.css

This file was deleted.

25 changes: 0 additions & 25 deletions forgot_password.html

This file was deleted.

53 changes: 9 additions & 44 deletions home.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!DOCTYPE html>



<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down Expand Up @@ -30,7 +33,7 @@
display: flex;
justify-content: center;
align-items: center;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif
font-family: 'Poppins', calibri;
}
</style>
</head>
Expand Down Expand Up @@ -58,58 +61,20 @@ <h3> Time you Have for studying: </h3>
<div class="wrapper">
<form>
<div class="center">
<h3> Subject 1 </h3>
</div>
<input placeholder="Name:" type="text" id="subject1Name" minlength="1"><br>
<input placeholder="Percent grade:" type="number" oninput="javascript:if (this.value > 100) this.value = 100;"
id="subject1Grade"><br>
<input placeholder="Days until next test:" type="number"
oninput="javascript:if (this.value > 100) this.value = 100;" id="subject1Time"><br>
</form>
</div>

<div class="center">
<form>
<div class="center">
<h3> Subject 2 </h3>
</div>
<input placeholder="Name:" type="text" id="subject2Name" minlength="1"><br>
<input placeholder="Percent grade:" type="number" oninput="javascript:if (this.value > 100) this.value = 100;"
id="subject2Grade"><br>
<input placeholder="Days until next test:" type="number"
oninput="javascript:if (this.value > 100) this.value = 100;" id="subject2Time"><br>
</form>
</div>

<div class="center">
<form>
<div class="center">
<h3> Subject 3 </h3>
<h3> Add Subject </h3>
</div>
<input placeholder="Name:" type="text" id="subject3Name" minlength="1"><br>
<input placeholder="Name:" type="text" id="subjectName" minlength="1"><br>
<input placeholder="Percent grade:" type="number" oninput="javascript:if (this.value > 100) this.value = 100;"
id="subject3Grade"><br>
id="subjectGrade"><br>
<input placeholder="Days until next test:" type="number"
oninput="javascript:if (this.value > 100) this.value = 100;" id="subject3Time"><br>
oninput="javascript:if (this.value > 100) this.value = 100;" id="subjectTime"><br>
</form>
</div>

<div class="center">
<form>
<div class="center">
<h3> Subject 4 </h3>
</div>
<input placeholder="Name:" type="text" id="subject4Name" minlength="1"><br>
<input placeholder="Percent grade:" type="number" oninput="javascript:if (this.value > 100) this.value = 100;"
id="subject4Grade"><br>
<input placeholder="Days until next test:" type="number"
oninput="javascript:if (this.value > 100) this.value = 100;" id="subject4Time"><br>
</form>
<button class="button button1" onclick="addSubject()"> <b>Add Subject </b> </button>
</div>

<div class="center">
<button class="button button1" onclick="scheduleInit()"> <b>Create Schedule </b> </button>
</div>
</body>

</html>
54 changes: 31 additions & 23 deletions home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,47 @@ let subjectGrades = [];
let subjectDays = [];
let studyTime = 0;
let scheduleHTML = "";
let j = 0;
let tempTotal = 0;

function createStudySchedule(subject, time) {
let tempTotal = subject[0] + subject[1] + subject[2] + subject[3];
for(let k = 0; k<subjectGrades.length; k++){
tempTotal = tempTotal + subject[k];
}
scheduleHTML = "";
for (let i = 0; i < 4; i++) {
for (let i = 0; i < subjectNames.length; i++) {
let tempval = time * (subject[i] / tempTotal);
if (tempval < 1) {
tempval = 1;
}
else{
tempval = Math.round(tempval);
let tempval2 = tempval - Math.trunc(tempval);
if (Math.round(tempval) == 0 && tempval2 < 0.25) {
studyFinalHours[i] = 0;
scheduleHTML += '<div class = "subject"> You dont need to study ' + subjectNames[i] + '</div>';
}
studyFinalHours[i] = tempval;
scheduleHTML += '<div class = "subject"> Study ' + subjectNames[i] + ' for ' + studyFinalHours[i] + ' hours </div>';
else if (tempval2 > 0.25 && tempval2 < 0.75) {
studyFinalHours[i] = Math.floor(tempval) + 0.5;
scheduleHTML += '<div class = "subject"> Study ' + subjectNames[i] + ' for ' + studyFinalHours[i] + ' hours </div>';
}
else {
studyFinalHours[i] = Math.round(tempval);
scheduleHTML += '<div class = "subject"> Study ' + subjectNames[i] + ' for ' + studyFinalHours[i] + ' hours </div>';
}
}
return scheduleHTML;
}

function addSubject(){
subjectNames.push(document.getElementById("subjectName").value);
subjectGrades.push(document.getElementById("subjectGrade").value);
subjectDays.push(document.getElementById("subjectTime").value);
studyFinalValues[j] = (1 / (subjectGrades[j] * 1 * 1 * subjectDays[j]));
document.getElementById("subjectName").value = '';
document.getElementById("subjectGrade").value = '';
document.getElementById("subjectTime").value = '';
j++;
}


function scheduleInit() {
studyFinalValues = [];
studyFinalHours = [];
subjectNames = [];
subjectGrades = [];
subjectDays = [];
studyTime = 0;
scheduleHTML = "";
studyTime = 1 * document.getElementById("hrs").value;
for (let i = 0; i < 4; i++) { subjectNames[i] = document.getElementById("subject" + (i + 1) + "Name").value; }
for (let i = 0; i < 4; i++) { subjectGrades[i] = Math.abs(document.getElementById("subject" + (i + 1) + "Grade").value) + 1; }
for (let i = 0; i < 4; i++) { subjectDays[i] = Math.abs(document.getElementById("subject" + (i + 1) + "Time").value) + 1; }
for (let i = 0; i < 4; i++) {
studyFinalValues[i] = 1 / (subjectGrades[i] * subjectDays[i]);
}
studyTime = Math.round(1 * document.getElementById("hrs").value);
document.cookie = createStudySchedule(studyFinalValues, studyTime);
window.location.href = "SchedulePage.html";
document.getElementById("schedule").innerHTML = document.cookie;
Expand Down
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<img src="SmatStudy_logo (2).png" alt="Girl in a jacket" height="80">
<style>
.center {
display: flex;
justify-content: center;
font-family: 'Poppins', calibri;
</style>
<title>Login</title>
<link rel = "stylesheet" href = "main.css">
</head>
Expand All @@ -24,7 +31,7 @@ <h1>Sign Up</h1>
<button id = "create-acct-btn">Create Account</button>
<button id = "return-btn">Return to Login</button>
</div>
<a href="forgot_password.html" id="resetLink">Forgot password?</a>

</div>
<script type = "module" src = "script.js"></script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body {
h1 {
margin-bottom: 8%;
text-align: center;
font-family: "Fredoka One", cursive;
font-family: 'Calibri, 'Trebuchet MS', sans-serif
color: #000000;
letter-spacing: 0.1em;
letter-spacing: 0.01em;
}

p {
Expand Down
1 change: 1 addition & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ returnBtn.addEventListener("click", function() {
main.style.display = "block";
createacct.style.display = "none";
});

6 changes: 5 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
font-family: 'Poppins', callibri;
}

html,body{
Expand All @@ -13,3 +13,7 @@ html,body{
place-items: center;
background: -webkit-linear-gradient(left, #9fd0a7, #98d0e1);
}

.subject{
font-size: 40 px;
}
Loading