This commit is contained in:
3eef8a28f26fb2bcc514e6f1938929a1f931762 2023-02-10 21:35:21 -05:00 committed by powe97
parent de7c73e5d0
commit c2e076d38f
3 changed files with 50 additions and 2 deletions

View file

@ -7,6 +7,9 @@
fill: #2c2b3d;
}
</style>
<symbol id="github-icon" viewBox="0 0 480 512">
<path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"/>
</symbol>
<symbol id="message" viewBox="0 0 640 512">
<path d="M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2 0 0 0 0C1 327.2-1.4 334.4 .8 340.9S9.1 352 16 352c21.8 0 43.8-5.6 62.1-12.5c9.2-3.5 17.8-7.4 25.3-11.4C134.1 343.3 169.8 352 208 352zM448 176c0 112.3-99.1 196.9-216.5 207C255.8 457.4 336.4 512 432 512c38.2 0 73.9-8.7 104.7-23.9c7.5 4 16 7.9 25.2 11.4c18.3 6.9 40.3 12.5 62.1 12.5c6.9 0 13.1-4.5 15.2-11.1c2.1-6.6-.2-13.8-5.8-17.9l0 0 0 0-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7c24.9-29 39.6-64.7 39.6-103.4c0-92.8-84.9-168.9-192.6-175.5c.4 5.1 .6 10.3 .6 15.5z"/>
</symbol>
@ -64,6 +67,7 @@
<view id="circle-question-view" viewBox="0 5632 512 512"/>
<view id="circle-empty-view" viewBox="0 6144 512 512"/>
<view id="circle-dot-view" viewBox="0 6656 512 512"/>
<view id="github-icon" viewBox="0 7168 480 512">
<use href="#message" x="0" y="0" width="640" height="512"/>
<use href="#pencil" x="0" y="512" width="512" height="512"/>
<use href="#magnifying" x="0" y="1024" width="512" height="512"/>
@ -78,4 +82,5 @@
<use href="#circle-question" x="0" y="5632" width="512" height="512"/>
<use href="#circle-empty" x="0" y="6144" width="512" height="512"/>
<use href="#circle-dot" x="0" y="6656" width="512" height="512"/>
<use href="#github-icon" x="0" y="7168" width="480" height="512"/>
</svg>

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

37
index.html Normal file
View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Quatalog Home</title>
<link rel="shortcut icon" href="./favicon/quatalogIcon.png">
<link rel="icon" href="./favicon/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
<link rel="manifest" href="./favicon/site.webmanifest">
<link rel="stylesheet" href="css/common.css" />
<link rel="stylesheet" href="css/home.css" />
<meta property="og:title" content="Quatalog" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://quatalog.com" />
<meta property="og:description" content="It's like the catalog but based"/>
<meta property="og:image" content="https://quatalog.com/images/quatalogVWordmarkBacking.png" />
<meta property="og:image:width" content="512" />
<meta property="og:image:height" content="256" />
<meta property="og:image:alt" content="Quatalog wordmark" />
<script src="js/search_helper.js"></script>
</head>
<body>
<svg id="home-title"><use href="./images/quatalogVWordmark.svg#QuatalogVWordmark"></use></svg>
<form onsubmit="search_helper(event)">
<input type="text" class="home-search" id="search" placeholder="Search...">
</form>
<p id="home-footer">
Check out our <a target="_blank" href="https://github.com/quatalog/quatalog">
source code
<svg><use href="icons.svg#github-icon"></use></svg>
</a> (or yell at us about issues!)
</p>
</body>
</html>

View file

@ -8,7 +8,7 @@ const search_helper = function(event) {
var course_code = false;
if(input.length == 8) {
// "abcd1345" => ["abcd","1345"]
course_code = input.match(/.{1,3}/g)
course_code = input.match(/.{1,4}/g)
} else if(input.length == 9) {
// "abcd - 1345" => ["abcd","1345"]
course_code = input.split(/(?:,| )+/);
@ -26,7 +26,13 @@ const search_helper = function(event) {
// if it is, redirect to it
if(course_exists) {
const loc = window.location.pathname;
// handle both homepage and courses pages
if(loc.substring(0,loc.lastIndexOf('/')) != "/courses") {
location.href = "courses/"+code_str;
} else {
location.href = code_str;
}
return;
}
}