1
1
<!DOCTYPE html>
2
2
3
3
< 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 ( ) ;
13
19
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
+ }
18
24
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
+ }
25
31
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 ;
30
36
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 ;
35
41
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!
48
54
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.` ;
65
71
</ 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 >
67
74
</ html >
0 commit comments