-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from zjf19002/tylerBranch
Tyler branch
- Loading branch information
Showing
4 changed files
with
236 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 174 additions & 6 deletions
180
class_registration_app/src/components/EnrolledCourseList.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,180 @@ | ||
<script setup lang="ts"> | ||
</script> | ||
|
||
<template> | ||
<div class="container"> | ||
<h1>My Classes</h1> | ||
<div id="head">Uconn</div> | ||
<RouterLink to="/dashboard">Back</RouterLink> | ||
<h1 class=myclasses>My Classes</h1> | ||
<div id="container"> | ||
<div id="poo">Will have more class information</div> | ||
</div> | ||
|
||
</template> | ||
|
||
<script setup lang="js"> | ||
const class_slots = [ | ||
[[0,2,4],2], //1 | ||
[[10,12,14],2,"MWF"], | ||
[[20,22,24],2,"MWF"], | ||
[[30,32,34],2,"MWF"], | ||
[[40,42,44],2,"MWF"], | ||
[[50,52,54],2,"MWF"], //6 | ||
[[60,62,64],2,"MWF"], | ||
[[70,72,74],2,"MWF"], | ||
[[80,82,84],2,"MWF"], | ||
[[1,3],3,"TTh"], | ||
[[16,18],3,"TTh"], //11 | ||
[[31,33],3,"TTh"], | ||
[[46,48],3,"TTh"], | ||
[[61,63],3,"TTh"], | ||
[[76,78],3,"TTh"], | ||
[[0],4,"M"], //16 | ||
[[20],4,"M"], | ||
[[40],4,"M"], | ||
[[60],4,"M"], | ||
[[2],4,"W"], | ||
[[22],4,"W"], //21 | ||
[[42],4,"W"], | ||
[[62],4,"W"], | ||
[[4],4,"F"], | ||
[[24],4,"F"], | ||
[[44],4,"F"], //26 | ||
[[64],4,"F"] | ||
] | ||
const classes = [ | ||
{ | ||
"period": "2", | ||
"class_name": "CSE1010", | ||
"prof": "John", | ||
"description": "Intro CS", | ||
"room": "McHugh 101", | ||
"credits": "3" | ||
}, | ||
{ | ||
"period": "4", | ||
"class_name": "MATH1131" , | ||
"prof": "Bob", | ||
"description": "Calc 1", | ||
"room": "McHugh 101", | ||
"credits": "3" | ||
}, | ||
{ | ||
"period": "12", | ||
"class_name": "ANTH1000" , | ||
"prof": "Joey", | ||
"description": "Intro Anth", | ||
"room": "McHugh 101", | ||
"credits": "3" | ||
}, | ||
{ | ||
"period": "13", | ||
"class_name": "CHEM1127", | ||
"prof": "Joe", | ||
"description": "Intro Chem", | ||
"room": "McHugh 101", | ||
"credits": "3" | ||
}, | ||
{ | ||
"period": "23", | ||
"class_name": "MATH1071", | ||
"prof": "Billy", | ||
"description": "Business Calc", | ||
"room": "McHugh 101", | ||
"credits": "2" | ||
} | ||
] | ||
function do_all(){ | ||
let toggle = 0 | ||
let popup = document.getElementById("poo") | ||
document.addEventListener("click", ()=>{ | ||
console.log("dasd") | ||
if(toggle==0){ | ||
popup.style.visibility="visible"; | ||
toggle=1; | ||
} | ||
else{ | ||
popup.style.visibility="hidden"; | ||
toggle=0; | ||
} | ||
}) | ||
for(let i=0;i<classes.length;i++){ | ||
let con = document.getElementById('container') | ||
let c = classes[i] | ||
let d = document.createElement("div") | ||
d.className = "enrolled-class-item"; | ||
let period = classes[i].period; | ||
let start = class_slots[period-1][0][0] | ||
let starttime = 8+.5*Math.floor(start/5) | ||
let end = class_slots[period-1][0][0] + 5*class_slots[period-1][1] | ||
let endtime = 8+.5*Math.floor(end/5)-.25 | ||
let timestring = toTime(starttime) + "-" + toTime(endtime) + " " + class_slots[period-1][2]; | ||
d.innerHTML += `<h1 style="color:#d18c0a">${classes[i].class_name}</h1> | ||
<h3>${timestring}</h3> | ||
<h4>${classes[i].credits}.00 Credits</h4> | ||
<h4>Instructor: ${classes[i].prof}</h4> | ||
` | ||
/* <h4>Description: ${classes[i].description}</h4>*/ | ||
con.appendChild(d); | ||
} | ||
} | ||
setTimeout(do_all,0); | ||
function toTime(time){ | ||
let timestring = "" | ||
if(time%1==0){ | ||
timestring = (time-1)%12+1 + ":00" | ||
} | ||
else{ | ||
timestring = Math.floor((time-1)%12 + 1).toString() + ":" + 60*(time%1) | ||
} | ||
if (time<12){ | ||
timestring += "am" | ||
} | ||
else{ | ||
timestring += "pm" | ||
} | ||
return timestring | ||
} | ||
</script> | ||
|
||
|
||
<style scoped> | ||
.myclasses{ | ||
text-align: center; | ||
} | ||
#head{ | ||
margin: 0 auto 10px; | ||
width: 90%; | ||
height: auto; | ||
font-size: 50px; | ||
text-align: center; | ||
background-color: #0f1938; | ||
color: #ffffff; | ||
} | ||
#container{ | ||
padding: 0 50px; | ||
} | ||
#poo{ | ||
position: fixed; | ||
background-color:grey; | ||
height: 60vh; | ||
width: 60vw; | ||
margin: 0 auto; | ||
z-index: 100; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
border: 5px black; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters