@@ -3,12 +3,12 @@ import { watch } from 'vue'
33import LabelSwitch from ' ./LabelSwitch.vue'
44import Toggle from ' ./Toggle.vue'
55import state from ' ../model.js'
6- import { MapPinIcon } from ' @heroicons/vue/24/outline'
6+ import { MapPinIcon , BookOpenIcon } from ' @heroicons/vue/24/outline'
77import { useRouter } from ' vue-router'
88import { classrooms } from ' ../utils/locations.js'
99
1010const router = useRouter ()
11- const props = defineProps ([' pieces' , ' whole' ])
11+ const props = defineProps ([' pieces' , ' whole' , ' quarter ' ])
1212const ds = [' Mon' , ' Tue' , ' Wed' , ' Thu' , ' Fri' , ' Sat' , ' Sun' ]
1313const days = [' Monday' , ' Tuesday' , ' Wednesday' , ' Thursday' , ' Friday' , ' Saturday' , ' Sunday' ]
1414const colors = [
@@ -86,6 +86,17 @@ const locate = location => {
8686 if (classrooms[location]) router .push (' /map?q=' + location)
8787}
8888
89+ // Class to courseInfo redirect
90+ const courseInfo = (courseId , quarter ) => {
91+ if (courseId)
92+ router .push ({
93+ path: ' /course' ,
94+ query: {
95+ courseId,
96+ quarter
97+ }})
98+ }
99+
89100setInterval (() => { date = new Date () }, 60e3 )
90101document .onvisibilitychange = () => { date = new Date () }
91102< / script>
@@ -115,14 +126,49 @@ document.onvisibilitychange = () => { date = new Date() }
115126 < div class = " grid grid-cols-7 gap-px relative w-full overflow-y-hidden all-transition" : style= " { width: state.screen.md || !props.whole ? '140%' : '100%', height: showTime ? '976px' : '736px' }" > <!-- body -->
116127 < div v- for = " j in 112" class = " all-transition bg-gray-100 hover:bg-gray-50 rounded" / >
117128 < template v- for = " p in props.pieces" >
118- < div v- if = " !isHide(p)" : style= " pStyle(p)" class = " all-transition absolute p-1 text-xs rounded-r-sm overflow-hidden"
119- @click= " locate(p.location)" : class = " classrooms[p.location] && 'cursor-pointer group'" >
120- < MapPinIcon : class = " colorMap[p.key][1]" class = " w-5 h-5 absolute opacity-0 top-1 right-1 group-hover:opacity-100 transition-opacity" / >
129+ < div v- if = " !isHide(p)" : style= " pStyle(p)"
130+ class = " all-transition absolute p-1 text-xs rounded-r-sm overflow-hidden z-20"
131+ : class = " classrooms[p.location] ? 'group' : 'group'" >
132+
133+ < div
134+ class = "
135+ absolute
136+ right-1
137+ top-auto bottom-1
138+ xl:top-1 xl:bottom-auto
139+ flex flex-col gap-1
140+ xl:flex-row xl:items-center
141+ "
142+ >
143+ < BookOpenIcon
144+ @click .stop = " courseInfo(p.key, props.quarter)"
145+ : class = " colorMap[p.key][1]"
146+ class = "
147+ w-[clamp(14px,4vw,20px)]
148+ h-[clamp(14px,4vw,20px)]
149+ opacity-0 group-hover:opacity-100
150+ hover:opacity-70
151+ z-30 transition-opacity cursor-pointer
152+ "
153+ / >
154+ < MapPinIcon
155+ v- if = " classrooms[p.location]"
156+ @click .stop = " locate(p.location)"
157+ : class = " colorMap[p.key][1]"
158+ class = "
159+ w-[clamp(14px,4vw,20px)]
160+ h-[clamp(14px,4vw,20px)]
161+ opacity-0 group-hover:opacity-100
162+ hover:opacity-70
163+ z-30 transition-opacity cursor-pointer
164+ "
165+ / >
166+ < / div>
121167 < div class = " font-semibold text-shadow text-[0.7rem] sm:text-xs" : class = " colorMap[p.key][1]" > {{ p .title || p .key }}< / div>
122168 < div class = " text-[0.6rem] sm:text-xs opacity-90" : class = " colorMap[p.key][1]" v- if = " showTime" > {{ twelveHour ? twelvify (p .time ) : p .time }}< / div>
123169 < div class = " text-[0.625rem] sm:text-xs opacity-90" : class = " colorMap[p.key][1]" > {{ p .location }}< / div>
124170 < div class = " all-transition absolute bottom-0 top-0 left-0 w-0.5" : class = " colorMap[p.key][0]" / >
125- < div class = " absolute bottom-0 top-0 left-0 right-0" : class = " colorMap[p.key][0]" style= " opacity: 15%;" / >
171+ < div class = " absolute bottom-0 top-0 left-0 right-0 pointer-events-none " : class = " colorMap[p.key][0]" style= " opacity: 15%;" / >
126172 < / div>
127173 < / template>
128174 < div class = " flex items-center absolute" : style= " cStyle" >
0 commit comments