commit 71dc0040835c2dfb6ac7e31acc04054b2fd09271 Author: Quatalog Updater Date: Wed May 15 20:10:37 2024 +0000 Remove link to transfer guides diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 000000000..de957af94 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,33 @@ +name: Merge main into static-generated +on: + push: + branches: + - main + +jobs: + merge-branches: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout static-generated + uses: actions/checkout@v4 + with: + ref: static-generated + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Merge branches manually + run: | + git config --global user.name "Quatalog Updater" + git config --global user.email "github_actions@quatalog.com" + + git checkout main + git checkout --orphan new-static-generated + git commit -m '${{ github.event.head_commit.message }}' + git merge static-generated --strategy-option ours --allow-unrelated-histories + + git push -u -f origin HEAD:static-generated diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..4ad30d7c2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 quatalog + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 000000000..44f4b6383 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# quatalog +A tool to show when an RPI course has been offered in the past, using quacs-data. diff --git a/coursedisplay.html b/coursedisplay.html new file mode 100644 index 000000000..971ed33db --- /dev/null +++ b/coursedisplay.html @@ -0,0 +1,22 @@ + + + + + diff --git a/css/common.css b/css/common.css new file mode 100644 index 000000000..7d769b6a6 --- /dev/null +++ b/css/common.css @@ -0,0 +1,194 @@ +/* common variables */ +:root{ + --quacs-yellow: #f5b53f; + --quacs-midtone: #f5cc81; + --quacs-white: #f5e3c2; + --quacs-whiter: #fAf1e0; + --quacs-whitest: #fdf8f0; + + --deepest-purple: #12121a; + --deeper-purple: #191823; + --deep-purple: #201f2c; + --mid-dark-purple: #2c2b3d; + --mid-purple: #37364d; + --mid-light-purple: #494766; + --light-purple: #5c5980; + + --white: #ffffff; + --pink: #f53faa; + --red: #f53f6a; + --green: #3ff57f; + --blue: #3f6ef5; + + font-size: calc(1vmin + 12px); +} + +* { + font-family: "proxima-nova"; + /* font-family: "IBM Plex Sans"; */ +} + +body { + background-color: var(--background-color); + overflow-x:hidden; + margin: 0; + font-size: 0.9rem; /* default font-size. works well for small-ish thing */ +} + +::selection{ + background: var(--selection-color); +} + +.hidden{ + visibility: hidden; + margin: 0; + height: 0vw; +} + +svg { + overflow: visible; +} + +/* TEXT */ +h1, h1 a { + color: var(--h-text-color); + font-family: "proxima-nova"; + font-weight: 900; + margin-top: 0vmin; + margin-bottom: 0vmin; + padding-bottom: 0; + display: block; + position: relative; + font-size: 2.25rem; +} + +h2 { + font-size: 1.4rem; + margin-top: 1vmin; + margin-bottom: 0; +} + +p { + color: var(--p-text-color); + font-family: "proxima-nova"; + font-size: 1.2rem; + margin-bottom: 0; + margin-top: 0; +} + +p a, p svg { + color: var(--link-text-color); + fill: var(--link-text-color); + max-height: 4vmin; + width: 4vmin; + vertical-align: bottom; +} + +p svg { + display: inline-block; +} + +p a:hover, p a:hover svg { + color: var(--link-hover-color); + fill: var(--link-hover-color); +} + +/* HEADER */ +#qlog-header { + border-bottom: 0.2vmin solid var(--header-color); + width: 100%; + min-height: 5.25vmin; + left: 0; + top: 0; + position: relative; + display: inline-flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} + +#qlog-wordmark svg { + height: 4.5vmin; + aspect-ratio: 454/100; + left: 0; + top: 0; + position: relative; + margin: 1vmin; + margin-bottom: 0.75vmin; + margin-left: 2vmin; +} + +.header-search { + position: relative; + right: 1vmin; + width: 12rem; + height: 1.8rem; + font-size: 1.1rem; + padding-left: 0.9rem; + padding-right: 0.9rem; +} + +input[type="text"] { + background: var(--input-background-color); + border-radius: 100vw; + border: none; + outline:none; + font-family: "proxima-nova"; + color: var(--input-text-color); + caret-color: var(--input-text-color); +} + +input[type="text"]::selection{ + background: var(--input-selection-color); +} + +/* fonts */ + +@font-face{ + font-family: "rivalsans"; + src: url("../fonts/rivalsans-regular.otf"); +} +@font-face{ + font-family: "rivalsans"; + src: url("../fonts/rivalsans-bold.otf"); + font-weight: 700; +} +@font-face{ + font-family: "rivalsans"; + src: url("../fonts/rivalsans-extrabold.otf"); + font-weight: 800; +} +@font-face{ + font-family: "rivalsans"; + src: url("../fonts/rivalsans-black.otf"); + font-weight: 900; +} + +@font-face { + font-family: "proxima-nova"; + src: url("../fonts/Proxima-Nova-Black.otf"); + font-weight: 900; +} + +@font-face { + font-family: "proxima-nova"; + src: url("../fonts/Proxima-Nova-Bold.otf"); + font-weight: 700; +} + +@font-face { + font-family: "proxima-nova"; + src: url("../fonts/Proxima-Nova-Extrabold.otf"); + font-weight: 800; +} + +@font-face { + font-family: "proxima-nova"; + src: url("../fonts/Proxima-Nova-Thin.otf"); + font-weight: 200; +} + +@font-face { + font-family: "proxima-nova"; + src: url("../fonts/Proxima-Nova-Regular.otf"); +} diff --git a/css/coursedisplay.css b/css/coursedisplay.css new file mode 100644 index 000000000..7289cd9ee --- /dev/null +++ b/css/coursedisplay.css @@ -0,0 +1,471 @@ +.term ::selection{ + background: var(--table-selection-color); +} + +#cd-flex{ + display: flex; + position: relative; + flex-direction: row; + margin-right: 1vw; + margin-top: 1vmin; + justify-content: space-between; +} + +#course-info-container{ + position:relative; + width: 47vw; + left: 2vmin; + height: 90vmin; + margin-bottom: 7vmin; +} + + +#name { + font-size: 3.75rem; + left: 0vw; +} + +#code { + color: var(--course-code-color); + font-size: 1.8rem; + font-weight: 900; + position: relative; + left: 0vw; + margin-bottom: 1vmin; +} + +#cattrs-container{ + position: relative; + left: 0vw; + margin-bottom: 1vmin; + margin-top: 2vmin; +} + +.attr-pill{ + color: var(--pill-text-color); + position: relative; + left: 0vw; + background: var(--pill-default-color); + border-radius: 2vmin; + padding: 0.5vmin 1.5vmin; + margin-right: 0.5vmin; + font-weight: 700; + display: inline-block; + margin-bottom: 0.5vmin; +} + +.rel-info-container{ + margin-bottom: 1.25vmin; +} + +.rel-info-title{ + font-size: 1.25rem; + font-weight: 700; + color: var(--info-title-color); + margin-right: 0.5vmin; +} + +.rel-info-courses{ + margin-top: 0.7vmin; + position: relative; + font-size: 1rem; +} + +.course-pill{ + color: var(--pill-text-color); + + position: relative; + left: 0vw; + background: var(--course-pill-color); + border-radius: 2vmin; + padding: 0.5vmin 1.5vmin; + font-weight: 700; + display: inline-block; + margin-right: 0.5vmin; + margin-bottom: 0.5vmin; + text-decoration: none; + transition-property: background; + transition-duration: 100ms; + width: fit-content; +} + +.course-pill:hover{ + background: var(--course-pill-hover-color); +} + +#prereq-classes{ + display: flex; + align-items: center; + width: fit-content; + flex-wrap: wrap; + flex-basis: content; +} + +.pr-or-con{ + background: var(--or-block-color); + display:grid; + grid-auto-flow: row; + height: fit-content; + width: fit-content; + padding: 0.5vmin; + display: inline-block; + border-radius: 2vmin; + margin-bottom: 0.75vw; +} + +.pr-or-title{ + color: var(--or-text-color); + font-size: 1.3rem; + font-weight: 700; + margin-bottom: 0.5vmin; + text-align: center; +} + +.pr-or{ + background: var(--or-block-bg-color); + padding: 1vmin; + border-radius: 1.5vmin; + display: flex; + flex-direction: row; + align-items: center; + flex-wrap: wrap; + justify-content: space-evenly; + height: max-content; + width: fit-content; +} + +.pr-or .course-pill{ + margin-right: 0.25vmin; + margin-left: 0.25vmin; + margin-bottom: 0.25vmin; + margin-top: 0.25vmin +} + +.pr-and{ + display: inline; + margin-left: 0.75vmin; + margin-right: 0.75vmin; + color: var(--and-text-color); + background: var(--and-block-color); + padding: 1vmin; + font-size: 1.2rem; + font-weight: 700; + width: min-content; + height: min-content; + border-radius: 0.75vmin; + margin-bottom: 0.75vw; +} + +.none-rect{ + background: var(--none-block-color); + color: var(--none-text-color); + font-size: 2vmin; + position: relative; + left: 0vw; + border-radius: 0.5vmin; + padding: 0.5vmin 1.5vmin; + margin-right: 0.5vmin; + font-weight: 700; + display: inline-block; + margin-bottom: 0.5vmin; +} + +.unknown-rect{ + background: var(--unknown-block-color); + color: var(--unknown-text-color); + font-size: 2vmin; + position: relative; + left: 0vw; + border-radius: 0.5vmin; + padding: 0.5vmin 1.5vmin; + margin-right: 0.5vmin; + font-weight: 700; + display: inline-block; + margin-bottom: 0.5vmin; +} + +#past-container{ + position: relative; + width: 47.5vw; + justify-content: right; +} + +#past-title{ + right: 0vmin; + text-align: right; + width: 100%; + white-space: nowrap; +} + +#opt-container{ + left: 6.875vmin; + /* right: 0; */ + width: calc(47.5vw - 6.9vmin); + height: fit-content; + position: relative; + display: grid; + grid-template-columns: 50% 48%; + justify-content: space-between; + margin-bottom: 1vmin; +} + +#key-panel{ + /* background: var(--blue); */ + width: 100%; + display:flex; + /* left: 6vmin; */ + left: 0; + position: relative; + flex-direction: column; + justify-content: space-between; + align-content: center; + /* text-align: right; */ +} + +.key-code{ + color: var(--key-text-color); +} + +.code-icon svg { + width: 0.9rem; + max-height: 0.9rem; + text-align: justify!important; + vertical-align: bottom; + display: inline-block; + padding-bottom: 0.5vmin; + padding-right: 0vmin; + overflow: visible; +} + +#yes-code-icon svg { + fill: var(--yes-color); +} +#no-code-icon svg { + fill: var(--no-color); +} +#diff-code-icon svg { + fill: var(--diff-code-color); +} +#nil-code-icon svg { + fill: var(--nil-color); +} + +#control-panel{ + /* background: var(--red); */ + width: 100%; + display:flex; + flex-direction: column; +} + +.view-icon svg{ + width: 0.9rem; + max-height: 0.9rem; + text-align: justify!important; + vertical-align: bottom; + display: inline-block; + padding-bottom: 0.5vmin; + padding-right: 0vmin; + overflow: visible; + fill: var(--view-select-color); + transition: fill .1s; +} + +#years-table{ + /* margin-top: 1vmin; */ + position: relative; + left: 0vw; + width: 100%; + border-spacing: 0.25vmin; + /* padding-left: 0.25vmin; + padding-right: 0.25vmin; */ + border-width: 0; +} + +.term{ + color: var(--term-text-color); + font-size: 1.5vmin; + width: min-content; + /* word-break: break-all; */ +} + +/* +handle our hidings here +*/ + +.term { + background-size: 5vmin 5vmin; + height: 5vmin; + background-origin: content-box; + background-position: center; + background-repeat: no-repeat; + padding: 1vmin; +} + +input[type="radio"] { + display: none; +} + +.view-icon-selected, .view-icon-unselected { + display: none; +} + +input[value="simple"]:checked ~ div #simple-view-icon .view-icon-selected, +input[value="simple"]:not(:checked) ~ div #simple-view-icon .view-icon-unselected, +input[value="detailed"]:checked ~ div #detail-view-icon .view-icon-selected, +input[value="detailed"]:not(:checked) ~ div #detail-view-icon .view-icon-unselected { + display: inline-block; +} + +input[value="simple"]:checked ~ div #simple-view-label, +input[value="detailed"]:checked ~ div #detail-view-label { + color: var(--view-select-color-selected); +} + +.view-option-label { + cursor: pointer; + transition: color .1s; + color: var(--view-select-color); +} + +.view-icon-selected svg { + fill: var(--view-select-color-selected); +} + +input[value="simple"]:checked ~ table .not-offered { + background-image: url(../icons.svg#circle-no-view); +} + +input[value="simple"]:checked ~ table .offered { + background-image: url(../icons.svg#circle-check-view); +} + +input[value="simple"]:checked ~ table .offered-diff-code { + background-image: url(../icons.svg#circle-question-view); +} + +input[value="simple"]:checked ~ table .unscheduled { + background-image: url(../icons.svg#circle-empty-view); +} + +input[value="detailed"]:checked ~ table .detail-view-container { + display: flex; +} + +.detail-view-container{ + display: none; + flex-direction: column; + justify-content: space-between; + align-items: center; + padding-bottom: 1vmin; + padding-top: 1vmin; + font-size: 1rem; +} + +.term-course-info { + font-weight: bold; +} + +.course-capacity { + font-style: italic; +} + +.term-course-info{ + text-align: center; + margin-left: 0.1rem; + margin-right: 0.1rem; + height: 100%; +} + +.term-course-info a:link { + color: var(--table-link-color); +} + +.term-course-info a:visited { + color: var(--table-link-color); +} + +.term-course-info a:hover { + color: var(--table-link-hover-color); +} + +.term-course-info a:active { + color: var(--table-link-selected-color); +} + +.term li{ + width: fit-content; + list-style-position: inside; + padding-left: 0.5vmin; + padding-right: 0.5vmin; + margin-bottom: 0.2vmin; + font-weight: 500; +} + +.term ul{ + padding-left: 0.5vmin; + padding-right: 1vmin; + width: fit-content; + margin-top: 0.15rem; + margin-bottom: 0.15rem; +} + +.season-label{ + color: var(--season-label-color); + font-size: 1.4rem; +} + +.midsum-label{ + color: var(--mid-summer-label-color); + white-space: break-spaces; +} + +.year{ + color: var(--year-label-color); + text-align: left; + width: 6vmin; +} + +.offered { + background-color: var(--yes-color); +} +.offered-diff-code { + background-color: var(--diff-code-color); +} +.not-offered { + background-color: var(--no-color); + height: 2rem; +} +.unscheduled { + background-color: var(--nil-color); +} + +@media (max-aspect-ratio: 5/4), (orientation: portrait){ + #cd-flex{ + flex-direction: column; + align-items: center; + margin-right: 1vw; + margin-left: 1vw; + padding-bottom: 3vmin; + } + + #course-info-container{ + position:relative; + width: 90vw; + margin-bottom: 1vmin; + height: max-content; + } + + #past-container{ + position: relative; + width: 95vw; + justify-content: center; + } + + #past-title{ + text-align: center; + } + + #opt-container{ + width: calc(90vw - 6.9vmin); + } +} diff --git a/css/home.css b/css/home.css new file mode 100644 index 000000000..b57f3187e --- /dev/null +++ b/css/home.css @@ -0,0 +1,45 @@ +#home-title { + left: 30vw; + aspect-ratio: 337/181; + position: relative; + margin-top: 10vmin; + width: 40vw; +} + +.home-search { + /* min-height: 3vmin; */ + top: 0vmin; + position: relative; + font-size: 2rem; + margin: 10vmin auto; + margin-top: 5vmin; + width: 50vmin; + display: block; + padding: 1.6vmin; + padding-left: 1.8rem; + padding-right: 1.8rem; +} + +#home-footer { + text-align: center; +} + +#home-footer a { + text-decoration: none; + border-bottom: solid; + border-width: 0.05rem; + vertical-align: center; +} + +#github-icon { + height: 1.2rem; + margin-bottom: 0.1rem; +} + + +@media (max-aspect-ratio: 5/4), (orientation: portrait) { + #home-title { + left: 12.5vw; + width: 75vw; + } +} diff --git a/css/search.css b/css/search.css new file mode 100644 index 000000000..9939fccb4 --- /dev/null +++ b/css/search.css @@ -0,0 +1,161 @@ +:root { + --entry-width: 70vw; + --hover-expand-width: 0.5vw; + --transition-time: 0.1s; +} + +#searchTitle { + font-size: 2rem; + position: relative; + display: block; + width: 100vw; + height: fit-content; + left: 0vw; + text-align: center; + margin-top: 2.5vmin; + color: var(--search-title-color); + font-weight: 500; +} + +#searchTerm { + color: var(--search-term-color); +} + +#searchResultsContainer { + width: 100%; + display: flex; + flex-direction: column; + position: relative; + justify-content: center; + align-items: center; + margin-top: 2vmin; +} + +#searchResultsContainer tr { + width: var(--entry-width); + background: var(--search-entry-bg-color); + margin-bottom: 2vmin; + margin-left: var(--hover-expand-width); + margin-right: var(--hover-expand-width); + color: var(--search-entry-text-color); + border-radius: 0.5rem; + position: relative; + display: flex; + flex-direction: column; + transition-property: all; + transition-duration: var(--transition-time); +} + +#searchResultsContainer a { + text-decoration: none; +} + +#searchResultsContainer tr:hover { + background: var(--search-entry-bg-hover-color); + margin-left: 0; + margin-right: 0; + width: calc(var(--entry-width) + 2*var(--hover-expand-width)); + border-radius: calc(2vmin + 0.5vw); +} + +#searchResultsContainer tr:hover p, +#searchResultsContainer tr:hover div { + margin-left: var(--hover-expand-width); + margin-right: var(--hover-expand-width); +} + +#searchResultsContainer tr p, +#searchResultsContainer tr div { + transition-property: all; + transition-duration: var(--transition-time); +} + +#searchResultsContainer tr h3 { + margin: 0; + padding: 1vmin; + padding-left: 1.5vmin; + font-size: 1.25rem; + color: var(--search-entry-title-color); + border-bottom: solid; + border-bottom-width: 0.2vmin; +} + +#searchResultsContainer tr h3 div { + display: flex; + flex-wrap: wrap; + flex-direction: row; + align-items: baseline; +} + +.pill { + background: var(--pill-default-color); + color: var(--pill-text-color); + display: flex; + font-size: 1rem; + font-weight: 400; + padding-left: 1.5vmin; + padding-right: 1.5vmin; + border-radius: 3vmin; + margin-bottom: 0.25vmin; + margin-top: 0.25vmin; + margin-right: 1vmin; +} + +.pill svg { + display: inline-block; + align-self: center; + width: 1rem; + max-height: 1rem; + padding-left: 0.5vmin; + fill: var(--pill-svg-color); +} + +.CI-pill { + background: var(--ci-pill-color); +} + +.WI-pill { + background: var(--wi-pill-color); +} + +.PDII-pill { + background: var(--pdii-pill-color); +} + +.HInq-pill { + background: var(--hinq-pill-color); +} + +.courseName { + color: var(--course-name-color); + font-size: 1.45rem; +} + +.courseCode { + color: var(--course-code-color); + font-weight: 400; + font-size: 1rem; +} + +#searchResultsContainer p { + padding: 1.5vmin; + font-size: 1rem; +} + +#searchResultsContainer h3 span { + margin-right: 0.5vw; +} + +#searchResultsContainer h3:hover p { + padding-left: calc(1.5vmin + var(--hover-expand-width)); + padding-right: calc(1.5vmin + var(--hover-expand-width)); +} + +@media (orientation: portrait) { + #searchResultsContainer tr { + width: 90vw; + } + #searchResultsContainer tr:hover { + width: 91vw; + } +} diff --git a/css/themes.css b/css/themes.css new file mode 100644 index 000000000..6138316d7 --- /dev/null +++ b/css/themes.css @@ -0,0 +1,80 @@ +:root { + --background-color: var(--deep-purple); + --selection-color: var(--mid-light-purple); + --h-text-color: var(--quacs-yellow); + --p-text-color: var(--quacs-white); + --link-text-color: var(--quacs-midtone); + --link-hover-color: var(--quacs-yellow); + --header-color: var(--quacs-yellow); + --input-background-color: var(--quacs-white); + --input-text-color: var(--mid-dark-purple); + --input-selection-color: var(--quacs-yellow); + --search-title-color: var(--quacs-yellow); + --search-term-color: var(--quacs-midtone); + --search-entry-title-color: var(--quacs-midtone); + --search-entry-text-color: var(--quacs-white); + --search-entry-bg-color: var(--mid-dark-purple); + --search-entry-bg-hover-color: var(--mid-purple); + --pill-default-color: var(--quacs-yellow); + --pill-text-color: var(--deep-purple); + --pill-svg-color: var(--deep-purple); + --ci-pill-color: var(--green); + --wi-pill-color: var(--pill-default-color); + --course-pill-color: var(--pill-default-color); + --course-pill-hover-color: var(--quacs-midtone); + --pdii-pill-color: var(--red); + --hinq-pill-color: var(--pink); + --table-selection-color: var(--quacs-yellow); + --info-title-color: var(--quacs-white); + --course-name-color: var(--h-text-color); + --course-code-color: var(--quacs-midtone); + --or-block-color: var(--blue); + --or-block-bg-color: var(--background-color); + --or-text-color: var(--quacs-white); + --and-block-color: var(--red); + --and-text-color: var(--or-text-color); + --none-block-color: var(--red); + --none-text-color: var(--or-text-color); + --unknown-block-color: var(--pink); + --unknown-text-color: var(--or-text-color); + --key-text-color: var(--quacs-midtone); + --yes-color: var(--green); + --no-color: var(--red); + --diff-code-color: var(--quacs-yellow); + --nil-color: var(--mid-light-purple); + --view-select-color: var(--key-text-color); + --term-text-color: var(--deep-purple); + --view-select-color-selected: var(--quacs-yellow); + --season-label-color: var(--quacs-midtone); + --year-label-color: var(--quacs-midtone); + --mid-summer-label-color: var(--quacs-white); + --table-link-color: var(--mid-light-purple); + --table-link-hover-color: var(--light-purple); + --table-link-selected-color: var(--light-purple); +} + +@media (prefers-color-scheme: light) { + :root { + --background-color: var(--white); + --selection-color: var(--quacs-yellow); + --h-text-color: var(--mid-purple); + --p-text-color: var(--deep-purple); + --search-title-color: var(--mid-light-purple); + --search-term-color: var(--light-purple); + --search-entry-text-color: var(--deep-purple); + --search-entry-title-color: var(--mid-purple); + --search-entry-bg-color: var(--quacs-whitest); + --search-entry-bg-hover-color: var(--quacs-whiter); + --course-code-color: var(--mid-light-purple); + --or-text-color: var(--white); + --key-text-color: var(--mid-light-purple); + --view-select-color-selected: var(--deep-purple); + --season-label-color: var(--deep-purple); + --year-label-color: var(--mid-purple); + --mid-summer-label-color: var(--mid-purple); + --info-title-color: var(--deep-purple); + } + /*#qlog-wordmark { + display: none; + }*/ +} diff --git a/favicon/android-chrome-192x192.png b/favicon/android-chrome-192x192.png new file mode 100644 index 000000000..3eb4db3aa Binary files /dev/null and b/favicon/android-chrome-192x192.png differ diff --git a/favicon/android-chrome-512x512.png b/favicon/android-chrome-512x512.png new file mode 100644 index 000000000..8e54b261a Binary files /dev/null and b/favicon/android-chrome-512x512.png differ diff --git a/favicon/apple-touch-icon.png b/favicon/apple-touch-icon.png new file mode 100644 index 000000000..6d40e13d8 Binary files /dev/null and b/favicon/apple-touch-icon.png differ diff --git a/favicon/favicon-16x16.png b/favicon/favicon-16x16.png new file mode 100644 index 000000000..2795bae8e Binary files /dev/null and b/favicon/favicon-16x16.png differ diff --git a/favicon/favicon-32x32.png b/favicon/favicon-32x32.png new file mode 100644 index 000000000..b08e959e6 Binary files /dev/null and b/favicon/favicon-32x32.png differ diff --git a/favicon/favicon.ico b/favicon/favicon.ico new file mode 100644 index 000000000..9a92fa6e6 Binary files /dev/null and b/favicon/favicon.ico differ diff --git a/favicon/quatalogIcon.png b/favicon/quatalogIcon.png new file mode 100644 index 000000000..9c313e64e Binary files /dev/null and b/favicon/quatalogIcon.png differ diff --git a/favicon/site.webmanifest b/favicon/site.webmanifest new file mode 100644 index 000000000..901bd0c6f --- /dev/null +++ b/favicon/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/fonts/Proxima-Nova-Black.otf b/fonts/Proxima-Nova-Black.otf new file mode 100644 index 000000000..2dca49412 Binary files /dev/null and b/fonts/Proxima-Nova-Black.otf differ diff --git a/fonts/Proxima-Nova-Bold.otf b/fonts/Proxima-Nova-Bold.otf new file mode 100644 index 000000000..1ea77534a Binary files /dev/null and b/fonts/Proxima-Nova-Bold.otf differ diff --git a/fonts/Proxima-Nova-Extrabold.otf b/fonts/Proxima-Nova-Extrabold.otf new file mode 100644 index 000000000..9f6755f41 Binary files /dev/null and b/fonts/Proxima-Nova-Extrabold.otf differ diff --git a/fonts/Proxima-Nova-Regular.otf b/fonts/Proxima-Nova-Regular.otf new file mode 100644 index 000000000..018b6f831 Binary files /dev/null and b/fonts/Proxima-Nova-Regular.otf differ diff --git a/fonts/Proxima-Nova-Thin.otf b/fonts/Proxima-Nova-Thin.otf new file mode 100644 index 000000000..87218e518 Binary files /dev/null and b/fonts/Proxima-Nova-Thin.otf differ diff --git a/fonts/rivalsans-black.otf b/fonts/rivalsans-black.otf new file mode 100644 index 000000000..02827b1fe Binary files /dev/null and b/fonts/rivalsans-black.otf differ diff --git a/fonts/rivalsans-bold.otf b/fonts/rivalsans-bold.otf new file mode 100644 index 000000000..a3fdfe8b1 Binary files /dev/null and b/fonts/rivalsans-bold.otf differ diff --git a/fonts/rivalsans-extrabold.otf b/fonts/rivalsans-extrabold.otf new file mode 100644 index 000000000..3808530f8 Binary files /dev/null and b/fonts/rivalsans-extrabold.otf differ diff --git a/fonts/rivalsans-regular.otf b/fonts/rivalsans-regular.otf new file mode 100644 index 000000000..5ec64b3c8 Binary files /dev/null and b/fonts/rivalsans-regular.otf differ diff --git a/icons.svg b/icons.svg new file mode 100644 index 000000000..ee53591e0 --- /dev/null +++ b/icons.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/kuzuk.png b/images/kuzuk.png new file mode 100644 index 000000000..08f7ef5f1 Binary files /dev/null and b/images/kuzuk.png differ diff --git a/images/quatalogHWordmark.svg b/images/quatalogHWordmark.svg new file mode 100644 index 000000000..4d5db0ca1 --- /dev/null +++ b/images/quatalogHWordmark.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/quatalogIcon.svg b/images/quatalogIcon.svg new file mode 100644 index 000000000..ef4ac6eac --- /dev/null +++ b/images/quatalogIcon.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/quatalogMinecraftIcon.png b/images/quatalogMinecraftIcon.png new file mode 100644 index 000000000..3d1600317 Binary files /dev/null and b/images/quatalogMinecraftIcon.png differ diff --git a/images/quatalogVWordmark.svg b/images/quatalogVWordmark.svg new file mode 100644 index 000000000..2e81eb824 --- /dev/null +++ b/images/quatalogVWordmark.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/quatalogVWordmarkBacking.png b/images/quatalogVWordmarkBacking.png new file mode 100644 index 000000000..31f616ad9 Binary files /dev/null and b/images/quatalogVWordmarkBacking.png differ diff --git a/index.html b/index.html new file mode 100644 index 000000000..3ac8b34fa --- /dev/null +++ b/index.html @@ -0,0 +1,35 @@ + + + + Quatalog Home + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + diff --git a/js/fuse.js b/js/fuse.js new file mode 100644 index 000000000..308a9186a --- /dev/null +++ b/js/fuse.js @@ -0,0 +1,10 @@ +/** + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +// Copied here so that we do not depend on a CDN +var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,l=i.includeMatches,f=void 0===l?I.includeMatches:l,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,l=void 0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=l(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,l=void 0===h?I.distance:h,f=o.includeMatches,d=void 0===f?I.includeMatches:f,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void 0===f?I.findAllMatches:f,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(le(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=le(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); diff --git a/js/search.js b/js/search.js new file mode 100644 index 000000000..cd3f58bf2 --- /dev/null +++ b/js/search.js @@ -0,0 +1,80 @@ +// parses URL params +const params = window + .location + .search + .slice(1) + .split("&") + .map(p => p.split("=")) + .reduce((obj,[key,value]) => + ({ ...obj, [key]: decodeURIComponent(value) }), + {} + ); + +const search_term = params["search"]; + +const getSVG = function(name) { + return ''; +} + +const fuzzy_search_config = { + limit: 25, + includeScore: true, + ignoreLocation: true, + useExtendedSearch: true, + threshold: 0.01, + keys: [ + { + name: 'code', + weight: 0.1 + }, + { + name: 'description', + weight: 0.1 + }, + { + name: 'name', + weight: 0.8 + } + ] +} + +const attr_to_icon = { + 'CI': 'message', + 'HInq': 'magnifying', + 'PDII': 'briefcase', + 'WI': 'pencil', + 'CulmExp': 'cubes' +} + +const display_search_results = function(searchable_catalog) { + const fuse = new Fuse(searchable_catalog,fuzzy_search_config); + console.log("Searching for " + search_term + "..."); + const results = fuse.search(search_term,{limit:fuzzy_search_config.limit}); + const table = document.getElementById("searchResultsContainer"); + results.forEach(function(search_entry) { + const entry = search_entry.item; + const tr = table.insertRow(-1); + var elemInnerHtml = '' + + '

' + + entry.name + + '' + + entry.code + '' + + entry.credits + ""; + if(entry.attributes) + entry.attributes.forEach(function(attr) { + elemInnerHtml += '' + + attr + ''; + }); + elemInnerHtml += "

" + entry.description + "

" + '\n'; + tr.innerHTML = elemInnerHtml; + }); +} + +window.onload = function() { + // smart quotes + document.getElementById("searchTerm").innerHTML = "“" + search_term + "”"; + fetch("json/searchable_catalog.json") + .then(r => r.json()) + .then(display_search_results); +} diff --git a/js/search_helper.js b/js/search_helper.js new file mode 100644 index 000000000..9295938f0 --- /dev/null +++ b/js/search_helper.js @@ -0,0 +1,47 @@ +"use strict"; +const search_helper = async function(event,from_course_page = true) { + event.preventDefault(); + // "a b cde 12" => "a b cde 12" + const input = document.getElementById("search").value.split(" ").join(" "); + + var course_code = false; + if(input.length == 8) { + // "abcd1345" => ["abcd","1345"] + course_code = input.match(/.{1,4}/g) + } else if(input.replace(/ |-/g,"").length == 8) { + // "abcd - 1345" => ["abcd","1345"] + const arr = input.split(/(?:-| )+/); + if(arr.length == 2) course_code = arr; + } + + // only do this logic if the string might be a course code + // avoid having to fetch the courses_list if it definitely isn't one + if(course_code) { + // ["abcd","1345"] => "ABCD-1345" + course_code[0] = course_code[0].toUpperCase(); + const code_str = course_code.join("-"); + + // check if "ABCD-1345" is a real course code + const course_exists = await fetch( + from_course_page ? "../json/courses_list.json" : "json/courses_list.json" + ) + .then(list => list.json()) + .then(list => list.includes(code_str)); + + // if it is, redirect to it + if(course_exists) { + if(from_course_page) { + location.href = code_str; + } else { + location.href = "courses/" + code_str; + } + return; + } + } + + if(from_course_page) { + location.href = "../search?search=" + encodeURIComponent(input); + } else { + location.href = "search?search=" + encodeURIComponent(input); + } +} diff --git a/search.html b/search.html new file mode 100644 index 000000000..8d868bec0 --- /dev/null +++ b/search.html @@ -0,0 +1,40 @@ + + + Quatalog Search + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+

+ Search results for +

+ +
+