diff --git a/public/index.css b/public/index.css new file mode 100644 index 0000000..2fa7acb --- /dev/null +++ b/public/index.css @@ -0,0 +1 @@ +/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow:0 0 #0000}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow:0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid #0000;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:#0000;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=checkbox]:indeterminate,[type=radio]:checked:focus,[type=radio]:checked:hover{border-color:#0000;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-size:100% 100%;background-position:50%;background-repeat:no-repeat}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{border-color:#0000;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}td,th{border-width:1px;--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity));padding-left:.25rem;padding-right:.25rem}:is(.dark td),:is(.dark th){--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}td,th{display:table-cell}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.btn-settings{aspect-ratio:1/1;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity));padding:.25rem}.btn-settings:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}:is(.dark .btn-settings){--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}:is(.dark .btn-settings):hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}.marked-cell{--tw-gradient-to:#0000 var(--tw-gradient-to-position);background-image:linear-gradient(var(--tw-stripe-angle),var(--tw-gradient-from) var(--tw-stripe-width),var(--tw-gradient-to) var(--tw-stripe-width) calc(var(--tw-stripe-width)*2),var(--tw-gradient-from) calc(var(--tw-stripe-width)*2) calc(var(--tw-stripe-width)*3),var(--tw-gradient-to) calc(var(--tw-stripe-width)*3) calc(var(--tw-stripe-width)*4),var(--tw-gradient-from) calc(var(--tw-stripe-width)*4) calc(var(--tw-stripe-width)*5),var(--tw-gradient-to) calc(var(--tw-stripe-width)*5));--tw-stripe-width:0.125rem}@media (min-width:864px){.marked-cell{--tw-stripe-width:0.1875rem}}.legend-cell{border-width:1px;--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity));padding-left:.25rem;padding-right:.25rem}:is(.dark .legend-cell){--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}.legend-cell{--tw-gradient-to:#0000 var(--tw-gradient-to-position);background-image:linear-gradient(var(--tw-stripe-angle),var(--tw-gradient-from) var(--tw-stripe-width),var(--tw-gradient-to) var(--tw-stripe-width) calc(var(--tw-stripe-width)*2),var(--tw-gradient-from) calc(var(--tw-stripe-width)*2) calc(var(--tw-stripe-width)*3),var(--tw-gradient-to) calc(var(--tw-stripe-width)*3) calc(var(--tw-stripe-width)*4),var(--tw-gradient-from) calc(var(--tw-stripe-width)*4) calc(var(--tw-stripe-width)*5),var(--tw-gradient-to) calc(var(--tw-stripe-width)*5));--tw-stripe-width:0.125rem}@media (min-width:864px){.legend-cell{--tw-stripe-width:0.1875rem}}.legend-cell{display:table-cell;border-radius:.25rem;padding:.5rem;text-align:center}.mark-odd{background:url(stripe_odd_light.svg) 100% 100% no-repeat}:is(.dark .mark-odd){background:url(stripe_odd_dark.svg) 100% 100% no-repeat}.mark-even{background:url(stripe_even_light.svg) 0 100% no-repeat}:is(.dark .mark-even){background:url(stripe_even_dark.svg) 0 100% no-repeat}.tooltip-parent{position:relative}.tooltip{pointer-events:none;visibility:hidden;position:absolute;top:-.25rem;left:50%;z-index:10;width:100%;min-width:-moz-max-content;min-width:max-content;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-radius:.25rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity));background-color:#fff3;padding-left:.25rem;padding-right:.25rem;text-align:center;--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}:is(.dark .tooltip){--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity));background-color:#1c191733}.tooltip-target:hover .tooltip,.tooltip-target:hover+.tooltip{visibility:visible;display:block;opacity:0;animation:conjure .3s ease,cruciate 1.2s linear .3s,conjure .3s ease-out 1.5s reverse}.absolute{position:absolute}.relative{position:relative}.right-0{right:0}.top-4{top:1rem}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-4{grid-column-start:4}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.row-start-3{grid-row-start:3}.m-2{margin:.5rem}.m-auto{margin:auto}.my-auto{margin-top:auto}.mb-auto,.my-auto{margin-bottom:auto}.mt-auto{margin-top:auto}.table{display:table}.grid{display:grid}.hidden{display:none}.h-screen{height:100vh}.w-0{width:0}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-max{min-width:-moz-max-content;min-width:max-content}.table-fixed{table-layout:fixed}.border-separate{border-collapse:initial}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.auto-rows-auto{grid-auto-rows:auto}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-rows-\[6rem_1fr_6rem\]{grid-template-rows:6rem 1fr 6rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-none{border-style:none}.border-stone-300{--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity))}.p-2{padding:.5rem}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-4{padding-top:1rem}.pb-4,.py-4{padding-bottom:1rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-right{text-align:right}.font-serif{font-family:Source Serif Pro,serif}.text-\[0\.625rem\]{font-size:.625rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-light{font-weight:300}.text-sky-500{--tw-text-opacity:1;color:rgb(14 165 233/var(--tw-text-opacity))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}@keyframes cruciate{0%,to{opacity:1}}@keyframes conjure{0%{opacity:0}to{opacity:1}}.hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}:is(.dark .dark\:border-stone-600){--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}:is(.dark .dark\:bg-stone-900){--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity))}:is(.dark .dark\:text-sky-400){--tw-text-opacity:1;color:rgb(56 189 248/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .hover\:dark\:border-blue-600):hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}@media print{.print\:hidden{display:none}.print\:px-24{padding-left:6rem;padding-right:6rem}}@media (min-width:720px){.sm\:table{display:table}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width:864px){.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-lg{font-size:1.125rem;line-height:1.75rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:1024px){.lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}.lg\:text-4xl{font-size:2.25rem;line-height:2.5rem}.lg\:text-base{font-size:1rem;line-height:1.5rem}.lg\:text-lg{font-size:1.125rem;line-height:1.75rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:1280px){.xl\:-right-20{right:-5rem}.xl\:px-24{padding-left:6rem;padding-right:6rem}}@media (orientation:portrait){.portrait\:hidden{display:none}}@media (orientation:landscape){.landscape\:hidden{display:none}} \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..399e7a2 --- /dev/null +++ b/public/index.html @@ -0,0 +1,254 @@ + + + + Semester 4-2 Class Routine + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/index.js b/public/index.js new file mode 100644 index 0000000..fec1846 --- /dev/null +++ b/public/index.js @@ -0,0 +1,484 @@ +"use strict"; +/* + * All rights reserved (C) 2023 Muhammad Ragib Hasin + */ +var Elective3; +(function (Elective3) { + Elective3["eee4241"] = "eee4241"; + Elective3["eee4261"] = "eee4261"; +})(Elective3 || (Elective3 = {})); +var Elective4; +(function (Elective4) { + Elective4["eee4283"] = "eee4283"; +})(Elective4 || (Elective4 = {})); +var Elective5; +(function (Elective5) { + Elective5["eee4247"] = "eee4247"; + Elective5["eee4269"] = "eee4269"; +})(Elective5 || (Elective5 = {})); +function isValidStudentInfo(student) { + return (student.roll.length === 7 && + student.roll.slice(0, 4) === "1801" && + (() => { + const roll = Number.parseInt(student.roll.slice(-3)); + return roll > 0 && roll <= 180; + })() && + Object.values(Elective3).includes(student.elective3) && + Object.values(Elective4).includes(student.elective4)); +} +function submitStudentInfo() { + const studentInfo = { + roll: document.getElementById("roll").value, + elective3: document.querySelector('input[name="elective3"]:checked').value, + elective4: document.querySelector('input[name="elective4"]:checked').value, + elective5: document.querySelector('input[name="elective5"]:checked').value, + }; + if (!isValidStudentInfo(studentInfo)) { + document.getElementById("roll").focus(); + return; + } + const cookie = `studentInfo=${JSON.stringify(studentInfo)}; expires=1 Apr 2024 00:00:00 UTC+6`; + console.log(cookie); + document.cookie = cookie; + window.location.reload(); +} +const EMPTY_COOKIE = "studentInfo=;expires=1 Apr 2024 00:00:00 UTC+6"; +function resetStudentInfo() { + document.cookie = EMPTY_COOKIE; + window.location.reload(); +} +function getCookie(cname) { + let name = cname + "="; + let decodedCookie = decodeURIComponent(document.cookie); + let ca = decodedCookie.split(";"); + for (let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) == " ") { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ""; +} +function getStudentInfo() { + const cookie = getCookie("studentInfo"); + const student = cookie != "" ? JSON.parse(cookie) : undefined; + if (student === undefined || !isValidStudentInfo(student)) { + document.cookie = EMPTY_COOKIE; + return undefined; + } + const rollInSeries = Number.parseInt(student.roll.slice(-3)); + const section = rollInSeries <= 60 ? "A" : rollInSeries <= 120 ? "B" : "C"; + const thirty = (rollInSeries + 1) % 60 <= 31 ? 1 : 2; + return { rollInSeries, section, thirty, ...student }; +} +function isClassApplicable(klass, student) { + return klass.for === undefined + ? true + : klass.for[0] <= student.rollInSeries && + klass.for[1] >= student.rollInSeries; +} +function isSessional(klass) { + return klass.room.length !== 3; +} +function classDuration(klass) { + return klass.duration ?? (isSessional(klass) ? 3 : 1); +} +const mandatoryClasses = { + A: [ + [ + // Sat + { + course: "EEE 4209", + instructor: "MRC", + room: "402", + period: 6, + }, + ], + [ + // Sun + { + course: "EEE 4217", + instructor: "JEG", + room: "301", + period: 4, + }, + { + course: "EEE 4209", + instructor: "MRC", + room: "301", + period: 6, + }, + ], + [ + // Mon + { + course: "EEE 4209", + instructor: "MRC", + room: "301", + period: 5, + }, + { + course: "EEE 4200", + instructor: "MSR", + room: "301", + period: 8, + duration: 2, + }, + ], + [ + // Tue + { course: "EEE 4217", instructor: "JEG", room: "302", period: 3 }, + { + course: "EEE 4210", + instructor: "MRC", + room: "Computer Lab 2", + period: 4, + }, + ], + [ + // Wed + { course: "EEE 4217", instructor: "JEG", room: "302", period: 1 }, + ], + ], + B: [ + [ + // Sat + ], + [ + // Sun + { course: "EEE 4217", instructor: "MZI", room: "302", period: 1 }, + { course: "EEE 4209", instructor: "MMI", room: "302", period: 2 }, + ], + [ + // Mon + { course: "EEE 4217", instructor: "MZI / JEG", room: "302", period: 4 }, + { course: "EEE 4209", instructor: "MMI", room: "302", period: 5 }, + { + course: "EEE 4200", + instructor: "AM", + room: "302", + period: 8, + duration: 2, + }, + ], + [ + // Tue + { course: "EEE 4209", instructor: "MMI", room: "302", period: 4 }, + { course: "EEE 4217", instructor: "JEG", room: "302", period: 5 }, + ], + [ + // Wed + { + course: "EEE 4210", + instructor: "MMI", + room: "Computer Lab 2", + period: 4, + }, + ], + ], + C: [ + [ + // Sat + ], + [ + // Sun + { course: "EEE 4209", instructor: "MRC", room: "302", period: 4 }, + ], + [ + // Mon + { + course: "EEE 4217", + instructor: "MZI", + room: "402", + period: 8, + duration: 2, + }, + ], + [ + // Tue + { + course: "EEE 4210", + instructor: "MRC", + room: "Computer Lab 2", + period: 1, + }, + { course: "EEE 4217", instructor: "MZI", room: "302", period: 4 }, + { course: "EEE 4209", instructor: "MMI", room: "302", period: 6 }, + { + course: "EEE 4200", + instructor: "AM", + room: "302", + period: 8, + duration: 2, + }, + ], + [ + // Wed + { course: "EEE 4209", instructor: "MRC / MMI", room: "402", period: 1 }, + ], + ], +}; +const electiveClasses = { + eee4241: [ + // Sat + [{ instructor: "MRI", room: "Machine Lab", period: 7, for: [61, 120] }], + // Sun + [ + { instructor: "RAR", room: "301", period: 7, for: [1, 90] }, + { instructor: "RIS", room: "302", period: 7, for: [91, 180] }, + ], + // Mon + [], + // Tue + [ + { instructor: "RAR", room: "301", period: 7, for: [1, 90] }, + { instructor: "RIS", room: "302", period: 7, for: [91, 180] }, + ], + // Wed + [ + { instructor: "RAR", room: "301", period: 2, for: [1, 90] }, + { instructor: "RIS", room: "302", period: 2, for: [91, 180] }, + { instructor: "RAR", room: "Machine Lab", period: 4, for: [1, 60] }, + { instructor: "AKP", room: "Machine Lab", period: 4, for: [121, 180] }, + ], + ], + eee4247: [ + // Sat + [{ instructor: "MMH", room: "302", period: 4 }], + // Sun + [], + // Mon + [{ instructor: "MMH", room: "302", period: 7 }], + // Tue + [], + // Wed + [{ instructor: "MMH", room: "302", period: 3 }], + ], + eee4261: [ + // Sat + [{ instructor: "KT", room: "402", period: 5 }], + // Sun + [{ instructor: "KT", room: "402", period: 7 }], + // Mon + [{ instructor: "KT", room: "Electronics Lab", period: 1 }], + // Tue + [{ instructor: "KT", room: "402", period: 7 }], + // Wed + [], + ], + eee4269: [ + // Sat + [ + { instructor: "MFH", room: "402", period: 3, for: [91, 180] }, + { instructor: "MFH", room: "402", period: 4, for: [1, 90] }, + ], + // Sun + [ + { instructor: "MFH", room: "402", period: 8, for: [1, 90] }, + { instructor: "MFH", room: "402", period: 9, for: [91, 180] }, + ], + // Mon + [{ instructor: "MFH", room: "402", period: 7, for: [1, 90] }], + // Tue + [], + // Wed + [{ instructor: "MFH", room: "402", period: 3, for: [91, 180] }], + ], + eee4283: [ + // Sat + [ + { instructor: "MSH", room: "403", period: 6, for: [61, 120] }, + { instructor: "MR", room: "302", period: 6, for: [121, 180] }, + ], + // Sun + [ + { instructor: "MSH", room: "302", period: 3, for: [61, 120] }, + { instructor: "MSH", room: "301", period: 5, for: [1, 60] }, + { instructor: "MR", room: "302", period: 5, for: [121, 180] }, + ], + // Mon + [{ instructor: "MSH", room: "301", period: 6, for: [1, 60] }], + // Tue + [ + { instructor: "MSH", room: "302", period: 2, for: [1, 60] }, + { instructor: "MR", room: "302", period: 5, for: [121, 180] }, + ], + // Wed + [{ instructor: "MSH", room: "302", period: 1, for: [61, 120] }], + ], +}; +const courses = { + "EEE 4209": "Embedded System Design", + "EEE 4217": "Mobile Cellular Communication", + "EEE 4241": "Power System Protection", + "EEE 4247": "Renewable Energy", + "EEE 4261": "Biomedical Engineering", + "EEE 4269": "Photovoltaic System", + "EEE 4283": "Radar and Sattelite Communication", + "EEE 4200": "Seminar", + "EEE 4210": "Embedded System Design Sessional", + "EEE 4242": "Power System Protection Sessional", + "EEE 4262": "Biomedical Engineering Sessional", +}; +const instructors = { + EEE: { + AGK: "Prof. Dr. Muhammad Abdul Goffar Khan", + RIS: "Prof. Dr. Md. Rafiqul Islam Sheikh", + SMR: "Prof. Dr. S. M. Abdur Razzak", + MZI: "Prof. Dr. Md. Zahurul Islam Sarkar", + AKS: "Prof. Dr. Ajay Krishno Sarkar", + MFH: "Prof. Dr. Md. Faruk Hossain", + MSA: "Prof. Dr. Md. Shamim Anower", + MSI: "Prof. Dr. Md. Shahidul Islam", + MSH: "Prof. Dr. Md. Selim Hossain", + MR: "Prof. Dr. Md. Masud Rana", + MSR: "Prof. Dr. Md. Sohel Rana", + AK: "Prof. Dr. Abdul Khaleque", + SH: "Prof. Dr. Md. Samiul Habib", + TA: "Prof. Dr. Tanvir Ahmed", + GKM: "Dr. G.K.M. Hasanuzzaman
Associate Professor", + ASMS: "Abu Sadat Md. Sayem
Assistant Professor", + JEG: "Dr. Jishan-E-Giti
Assistant Professor", + MMR: "Md. Mamunur Rashid
Assistant Professor", + SKG: "Subrato Kumar Ghosh
Assistant Professor", + SCM: "Shadhon Chandra Mohonta
Assistant Professor", + MRI: "Md. Rashidul Islam
Assistant Professor", + SK: "Dr. Sumaiya Kabir
Assistant Professor", + KT: "Kusum Tara
Assistant Professor", + AKP: "Alok Kumar Paul
Assistant Professor", + MTH: "Md. Tarek Hossein
Assistant Professor", + MIR: "Md. Ilias Rahman
Assistant Professor", + AM: "Dr. Mohammod Abdul Motin
Assistant Professor", + MRC: "Md. Razon Chowdhury
Assistant Professor", + RAR: "Ruhul Amin Ratul
Assistant Professor", + BH: "Belal Hossain
Assistant Professor", + ABM: "Md. Abdul Malek
Assistant Professor", + MFM: "Md. Firoz Mahmud
Assistant Professor", + SHS: "Md. Sarwar Hosen
Lecturer", + MAR: "Md. Arafat Rahman
Lecturer", + SMH: "Sohani Munteha Hiam
Lecturer", + SHR: "Sunjidah Hossain
Lecturer", + MMH: "Md. Mahmudul Hasan
Lecturer", + SS: "Sarjana Shabab
Lecturer", + MMI: "Md. Mayenul Islam
Lecturer", + TSJ: "Tasneem Sarkar Joyeeta
Lecturer", + MNA: "Md. Nuhi-Alamin
Lecturer", + }, +}; +const studentInfo = getStudentInfo(); +if (studentInfo === undefined) { + for (const id of ["studentInfo", "headerGeneric"]) + document.getElementById(id).classList.remove("hidden"); +} +else { + const studentName = getCookie("studentName"); + document.getElementById("studentName").innerText = + studentName !== "" ? studentName : studentInfo.roll; + document.getElementById("electiveNames").innerText = + `EEE ${studentInfo.elective3.slice(-4)}, ` + + `EEE ${studentInfo.elective4.slice(-4)} and ` + + `EEE ${studentInfo.elective5.slice(-4)}`; + function toMandatory(code) { + const className = `EEE ${code.slice(-4)}`; + const classNameSess = `EEE ${Number.parseInt(code.slice(-4)) + 1}`; + return (elective) => ({ + course: isSessional(elective) ? classNameSess : className, + ...elective, + }); + } + const routine = mandatoryClasses[studentInfo.section] + .map((mandatoryClasses, weekday) => mandatoryClasses + .concat(electiveClasses[studentInfo.elective3][weekday].map(toMandatory(studentInfo.elective3))) + .concat(electiveClasses[studentInfo.elective4][weekday].map(toMandatory(studentInfo.elective4))) + .concat(electiveClasses[studentInfo.elective5][weekday].map(toMandatory(studentInfo.elective5)))) + .map((day) => day + .filter((klass) => isClassApplicable(klass, studentInfo)) + .sort((a, b) => a.period - b.period)); + console.log(routine); + const routineBody = document.getElementById("routineBody"); + function insertFreePeriod(dayRow, free) { + const cell = dayRow.insertCell(); + cell.colSpan = free; + } + let lastPeriod = 9; + for (const [weekday, day] of routine.entries()) { + if (lastPeriod !== 9) + insertFreePeriod(routineBody.rows[weekday - 1], 9 - lastPeriod); + lastPeriod = 0; + const dayRow = routineBody.rows[weekday]; + for (const klass of day) { + const { course, instructor, room, period, cycle } = klass; + const courseTitle = courses[course] ?? ""; + const advance = period - lastPeriod; + if (advance !== 1) + insertFreePeriod(dayRow, advance - 1); + const contactHours = classDuration(klass); + const cell = dayRow.insertCell(); + if (contactHours !== 1) + cell.colSpan = contactHours; + if (cycle !== undefined) + cell.classList.add(...["marked-cell", cycle === "odd" ? "mark-odd" : "mark-even"]); + const instructorHtml = instructor + .split(" / ") + .map((instructor) => { + const instructorName = instructors[course.slice(0, 3)][instructor]; + return instructorName === undefined + ? instructor + : ` +${instructor} +${instructorName} +`; + }) + .join(" / "); + cell.innerHTML = ` + + ${course} + ${courseTitle} + +
+ + ${instructorHtml} + +
+${room}`; + lastPeriod = period + contactHours - 1; + } + } + for (const id of [ + "pdfButton", + "resetButton", + "orientationNotice", + "screenSizeNotice", + "headerPersonal", + ]) + document.getElementById(id).classList.remove("hidden"); + for (const [id, classes] of Object.entries({ + routine: ["sm:table"], + legends: ["sm:grid"], + })) + document.getElementById(id).classList.add(...classes); +} +function toggleTheme() { + localStorage.darkTheme = + !(localStorage.darkTheme ?? + window.matchMedia("(prefers-color-scheme: dark)").matches) || localStorage.darkTheme !== "true"; + updateTheme(); +} +function resetTheme() { + localStorage.removeItem("darkTheme"); + updateTheme(); +} +let printThemeBackup; +window.onbeforeprint = (e) => { + printThemeBackup = localStorage.darkTheme; + localStorage.darkTheme = "false"; + updateTheme(); +}; +window.onafterprint = (e) => { + localStorage.darkTheme = printThemeBackup; + printThemeBackup = undefined; + updateTheme(); +}; diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..3eede67 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,7 @@ +{ + "name": "Routine", + "description": "Semester 4-1 Routine Visualizer for students of 18 series of RUET EEE", + "start_url": "/", + "lang": "en-US", + "display": "standalone" +} \ No newline at end of file diff --git a/public/stripe_even_dark.svg b/public/stripe_even_dark.svg new file mode 100644 index 0000000..6d10ed0 --- /dev/null +++ b/public/stripe_even_dark.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/public/stripe_even_light.svg b/public/stripe_even_light.svg new file mode 100644 index 0000000..0e4b3ff --- /dev/null +++ b/public/stripe_even_light.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/public/stripe_odd_dark.svg b/public/stripe_odd_dark.svg new file mode 100644 index 0000000..a5fa016 --- /dev/null +++ b/public/stripe_odd_dark.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/public/stripe_odd_light.svg b/public/stripe_odd_light.svg new file mode 100644 index 0000000..a0588ec --- /dev/null +++ b/public/stripe_odd_light.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file