Skip to content

Commit eb1ebcd

Browse files
committed
Prepped foor adding CSS (sometime in future) and added logo + title. Cleaned up.
1 parent 190e52b commit eb1ebcd

File tree

3 files changed

+63
-56
lines changed

3 files changed

+63
-56
lines changed

index.html

+63-56
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,74 @@
11
<!DOCTYPE html>
22

33
<html lang="en">
4-
<h1>Hello!</h1>
5-
<h2>My name is Owen. (also known as crossflame20, but I lost my crossflame20 GitHub account, so I made a "crossflame22" account.)</h2>
6-
<p id="birthday paragraph"></p>
7-
<script>
8-
// establishing today's date
9-
let currentTime = new Date();
10-
let month = currentTime.getMonth() + 1;
11-
let day = currentTime.getDate();
12-
let year = currentTime.getFullYear();
4+
<head>
5+
<title>crossflame20's homepage</title>
6+
<link rel="stylesheet" href="main.css">
7+
<link rel="shortcut icon" href="logo.ico">
8+
</head>
9+
<body>
10+
<h1>Hello!</h1>
11+
<h2>My name is Owen. (also known as crossflame20, but I lost my crossflame20 GitHub account, so I made a "crossflame22" account.)</h2>
12+
<p id="birthday paragraph"></p>
13+
<script>
14+
// establishing today's date
15+
let currentTime = new Date();
16+
let month = currentTime.getMonth() + 1;
17+
let day = currentTime.getDate();
18+
let year = currentTime.getFullYear();
1319

14-
// function to get days of any month
15-
function daysInMonth (_month, _year) {
16-
return new Date(_year, _month, 0).getDate();
17-
}
20+
// function to get days of any month
21+
function daysInMonth (_month, _year) {
22+
return new Date(_year, _month, 0).getDate();
23+
}
1824

19-
// get days after the 24th of last month
20-
if (month >= 2) {
21-
daysAfter = daysInMonth(month - 1, year) - 24;
22-
} else {
23-
daysAfter = daysInMonth(12, year - 1);
24-
}
25+
// get days after the 24th of last month
26+
if (month >= 2) {
27+
daysAfter = daysInMonth(month - 1, year) - 24;
28+
} else {
29+
daysAfter = daysInMonth(12, year - 1);
30+
}
2531

26-
// my birthdate
27-
const birthMonth = 7;
28-
const birthDay = 24;
29-
const birthYear = 2004;
32+
// my birthdate
33+
const birthMonth = 7;
34+
const birthDay = 24;
35+
const birthYear = 2004;
3036

31-
// comparing the two dates
32-
let yearDifference = year - birthYear;
33-
let monthDifference;
34-
let dayDifference;
37+
// comparing the two dates
38+
let yearDifference = year - birthYear;
39+
let monthDifference;
40+
let dayDifference;
3541

36-
if (month >= birthMonth) {
37-
monthDifference = month - birthMonth;
38-
} else {
39-
monthDifference = month + 5;
40-
yearDifference -= 1
41-
}
42-
if (day >= birthDay) {
43-
dayDifference = day - birthDay;
44-
} else {
45-
dayDifference = daysAfter + day;
46-
monthDifference -= 1;
47-
} // thanks ms c for helping get this figured out!
42+
if (month >= birthMonth) {
43+
monthDifference = month - birthMonth;
44+
} else {
45+
monthDifference = month + 5;
46+
yearDifference -= 1
47+
}
48+
if (day >= birthDay) {
49+
dayDifference = day - birthDay;
50+
} else {
51+
dayDifference = daysAfter + day;
52+
monthDifference -= 1;
53+
} // thanks ms c for helping get this figured out!
4854

49-
// save and return the difference in a readable format
50-
let comparison;
51-
if (dayDifference === 0) {
52-
comparison = `${yearDifference} year, \
53-
${monthDifference} month`;
54-
} else if (monthDifference === 0) {
55-
comparison = `${yearDifference} year, \
56-
${dayDifference} day`;
57-
} else if (dayDifference === 0 && monthDifference === 0) {
58-
comparison = `${yearDifference} year`;
59-
} else {
60-
comparison = `${yearDifference} year, \
61-
${monthDifference} month, ${dayDifference} day`;
62-
}
63-
document.getElementById("birthday paragraph").innerText = `I \
64-
am a ${comparison} old programmer from Concord, Ohio.`;
55+
// save and return the difference in a readable format
56+
let comparison;
57+
if (dayDifference === 0) {
58+
comparison = `${yearDifference} year, \
59+
${monthDifference} month`;
60+
} else if (monthDifference === 0) {
61+
comparison = `${yearDifference} year, \
62+
${dayDifference} day`;
63+
} else if (dayDifference === 0 && monthDifference === 0) {
64+
comparison = `${yearDifference} year`;
65+
} else {
66+
comparison = `${yearDifference} year, \
67+
${monthDifference} month, ${dayDifference} day`;
68+
}
69+
document.getElementById("birthday paragraph").innerText = `I \
70+
am a ${comparison} old programmer from Concord, Ohio.`;
6571
</script>
66-
<p>I will be updating this website as I improve at programming, and as I finish/start projects.</p>
72+
<p>I will be updating this website as I improve at programming, and as I finish/start projects.</p>
73+
</body>
6774
</html>

logo.ico

1.12 KB
Binary file not shown.

main.css

Whitespace-only changes.

0 commit comments

Comments
 (0)