Skip to content

Commit 46dab5e

Browse files
committed
Made basic, typing and styled homepage
1 parent 56bd225 commit 46dab5e

File tree

4 files changed

+94
-1
lines changed

4 files changed

+94
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Themes I Like:
2+
3+
https://andrewbanchich.github.io/forty-jekyll-theme/
4+
5+
https://bepatrickdavid.com
6+
7+
https://tobiasahlin.com

index.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
8+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
9+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
10+
<link rel="manifest" href="/site.webmanifest">
11+
<title>Callum Gilchrist</title>
12+
13+
<link rel="stylesheet" href="main.css">
414

15+
516
</head>
617
<body>
7-
This site is still being built. We hope to break free from the 1990's web design era.
18+
<div class="central">
19+
<!-- Prints out $Callum Gilchrist using javascript-->
20+
<h1 class="consoleStyle" id="NameTitle"></h1>
21+
<!-- Prints out Computer Science Student and General Nerd Using javascript -->
22+
<h2 class="consoleStyle" id="SubTitle"></h2>
23+
</div>
24+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
25+
<script src="indexScripts.js"></script>
826
</body>
927
</html>

indexScripts.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//Sets the speed in mili seconds between each char;
2+
let typeSpeed = 200;
3+
4+
//Sets the data to be typed
5+
let toType = ["$Callum Gilchrist","Computer Science Student and General Nerd"]; //Array of strings at first, then should become and array or reversed arrays
6+
let currentLine = 0;
7+
let typed = "";
8+
9+
//Makes the data to be typed usable with pop().
10+
for (var ai = 0; ai < toType.length; ai++) {
11+
toType[ai] = toType[ai].split("").reverse();
12+
}
13+
14+
async function typeHeadings() {
15+
//Ignores timer for single spaces.
16+
if (toType[currentLine][toType[currentLine].length - 1] == " ") {
17+
typed += toType[currentLine].pop();
18+
}
19+
typed += toType[currentLine].pop();
20+
21+
//Writes to the current line.
22+
switch (currentLine) {
23+
case 0:
24+
$("#NameTitle").text(typed);
25+
break;
26+
case 1:
27+
$("#SubTitle").text(typed);
28+
break;
29+
default:
30+
break;
31+
}
32+
33+
//If not at the end of the line, call the function again to print all the next letters.
34+
if (toType[currentLine].length !== 0) {
35+
setTimeout(typeHeadings, typeSpeed);
36+
//Once the end of a line is reached print the next line if there is one.
37+
} else if (currentLine + 1 < toType.length){
38+
typed = "";
39+
currentLine += 1;
40+
typeSpeed = 100;
41+
setTimeout(typeHeadings, typeSpeed);
42+
}
43+
}
44+
45+
typeHeadings();

main.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
body {
2+
background-color: black;
3+
color: white;
4+
}
5+
6+
#NameTitle {
7+
font-size: 40px;
8+
}
9+
10+
.consoleStyle {
11+
color: darkgreen;
12+
font-family: monospace;
13+
text-align: center;
14+
}
15+
16+
.central {
17+
position: absolute;
18+
left: 50%;
19+
top: 50%;
20+
transform: translate(-50%, -50%);
21+
padding: 10px;
22+
padding: 10px;
23+
}

0 commit comments

Comments
 (0)