1- <!DOCTYPE html>
1+ <!doctype html>
22< html lang ="en ">
3- < head >
4- < meta charset ="UTF-8 ">
5- < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
3+ < head >
4+ < meta charset ="UTF-8 " / >
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " / >
66 < title > Halifax Harbour Greetings</ title >
7- < link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/tailwind.min.css "
rel ="
stylesheet "
> 7+ < link
8+ href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/tailwind.min.css "
9+ rel ="stylesheet "
10+ />
811 < style >
9- .maritime-gradient {
10- background : linear-gradient (135deg , # 1e3a8a 0% , # 0369a1 50% , # 059669 100% );
11- }
12- .harbor-blue {
13- background-color : # 1e40af ;
14- }
15- .lighthouse-beacon {
16- animation : pulse 2s infinite;
17- }
12+ .maritime-gradient {
13+ background : linear-gradient (
14+ 135deg ,
15+ # 1e3a8a 0% ,
16+ # 0369a1 50% ,
17+ # 059669 100%
18+ );
19+ }
20+ .harbor-blue {
21+ background-color : # 1e40af ;
22+ }
23+ .lighthouse-beacon {
24+ animation : pulse 2s infinite;
25+ }
1826 </ style >
19- </ head >
20- < body class ="maritime-gradient text-white font-sans flex flex-col items-center justify-center min-h-screen ">
27+ </ head >
28+ < body
29+ class ="maritime-gradient text-white font-sans flex flex-col items-center justify-center min-h-screen "
30+ >
2131 < div class ="container mx-auto px-4 py-8 max-w-screen-md ">
22- < h1 class ="text-3xl font-bold mb-2 "> 🌊 Halifax Harbour Greetings ⚓</ h1 >
23- < p class ="text-blue-200 mb-4 text-center "> Welcome to the Atlantic's finest port city!</ p >
24- < div id ="greetingDisplay " class ="greeting harbor-blue rounded-lg shadow-lg p-6 min-h-20 flex items-center justify-center border-2 border-blue-300 ">
25- Click the button to receive a Maritime welcome!
26- </ div >
27- < button id ="randomGreetingButton " class ="bg-teal-600 hover:bg-teal-500 text-white font-bold py-3 px-6 rounded-lg mt-4 lighthouse-beacon shadow-lg transition-all duration-200 hover:shadow-xl "> 🦞 Ahoy!</ button >
32+ < h1 class ="text-3xl font-bold mb-2 "> 🌊 Halifax Harbour Greetings ⚓</ h1 >
33+ < p class ="text-blue-200 mb-4 text-center ">
34+ Welcome to the Atlantic's finest port city!
35+ </ p >
36+ < div
37+ id ="greetingDisplay "
38+ class ="greeting harbor-blue rounded-lg shadow-lg p-6 min-h-20 flex items-center justify-center border-2 border-blue-300 "
39+ >
40+ Click the button to receive a Maritime welcome!
41+ </ div >
42+ < button
43+ id ="randomGreetingButton "
44+ class ="bg-teal-600 hover:bg-teal-500 text-white font-bold py-3 px-6 rounded-lg mt-4 lighthouse-beacon shadow-lg transition-all duration-200 hover:shadow-xl "
45+ >
46+ 🦞 Ahoy!
47+ </ button >
2848 </ div >
2949
3050 < script >
31- async function getRandomGreeting ( ) {
32- try {
33- const response = await fetch ( 'http://localhost:8080/random' ) ;
34- const data = await response . json ( ) ;
35- document . getElementById ( 'greetingDisplay' ) . textContent = data . greeting ;
36- } catch ( error ) {
37- console . error ( 'Error fetching greeting:' , error ) ;
38- document . getElementById ( 'greetingDisplay' ) . textContent = 'Error fetching greeting' ;
39- } }
51+ async function getRandomGreeting ( ) {
52+ try {
53+ const response = await fetch ( "http://localhost:8080/random" ) ;
54+ const data = await response . json ( ) ;
55+ document . getElementById ( "greetingDisplay" ) . textContent =
56+ data . greeting ;
57+ } catch ( error ) {
58+ console . error ( "Error fetching greeting:" , error ) ;
59+ document . getElementById ( "greetingDisplay" ) . textContent =
60+ "Error fetching greeting" ;
61+ }
62+ }
4063
41- document . getElementById ( 'randomGreetingButton' ) . addEventListener ( 'click' , getRandomGreeting ) ;
64+ document
65+ . getElementById ( "randomGreetingButton" )
66+ . addEventListener ( "click" , getRandomGreeting ) ;
4267 </ script >
43- </ body >
44- </ html >
68+ </ body >
69+ </ html >
0 commit comments