1- // components.js
21function AboutPage ( ) {
3- // Create the main container
42 const container = document . createElement ( 'div' ) ;
5- container . classList . add ( 'space-y-4 ' , 'p-6' , 'text-center' ) ;
3+ container . classList . add ( 'min-h-screen ' , 'p-6' , 'text-center' , 'bg-blue-100' , 'dark:bg-blue-900' , 'text-gray-900' , 'dark:text-white' , 'transition-colors' , 'duration-300 ') ;
64
7- // Create the main title
85 const title = document . createElement ( 'h1' ) ;
96 title . textContent = 'DWA Starter Vanilla' ;
10- title . classList . add ( 'text-3xl' , 'font-bold' , 'mb-4' ) ;
7+ title . classList . add ( 'text-3xl' , 'font-bold' , 'mb-4' , 'text-blue-800' , 'dark:text-blue-200' ) ;
118
12- // Create the first paragraph
139 const para1 = document . createElement ( 'p' ) ;
1410 para1 . textContent = "Decentralized Web App: it's a Web5 Progressive Web App." ;
15- para1 . classList . add ( 'text-lg' ) ;
11+ para1 . classList . add ( 'text-lg' , 'text-blue-700' , 'dark:text-blue-300' ) ;
1612
17- // Create the subtitle
1813 const subtitle = document . createElement ( 'h2' ) ;
1914 subtitle . textContent = 'Why PWA?' ;
20- subtitle . classList . add ( 'text-2xl' , 'font-semibold' , 'mt-4' ) ;
15+ subtitle . classList . add ( 'text-2xl' , 'font-semibold' , 'mt-4' , 'text-blue-800' , 'dark:text-blue-200' ) ;
2116
22- // Create the second paragraph
2317 const para2 = document . createElement ( 'p' ) ;
2418 para2 . textContent = 'It\'s a perfect match with Web5 DWNs since a PWA can work offline and DWN has a synced local storage.' ;
25- para2 . classList . add ( 'text-lg' ) ;
19+ para2 . classList . add ( 'text-lg' , 'text-blue-700' , 'dark:text-blue-300' ) ;
2620
27- // Append elements to the container
2821 container . appendChild ( title ) ;
2922 container . appendChild ( para1 ) ;
3023 container . appendChild ( subtitle ) ;
3124 container . appendChild ( para2 ) ;
3225
33- // Return the container element
3426 return container ;
3527 }
3628
37- export function Home ( ) {
38- document . getElementById ( 'app' ) . innerHTML = `<h1>Home</h1>` ;
39- }
40-
41- export function About ( ) {
29+ export function Home ( ) {
30+ const homeContainer = document . createElement ( 'div' ) ;
31+ homeContainer . classList . add ( 'min-h-screen' , 'p-6' , 'bg-green-100' , 'dark:bg-green-900' , 'text-gray-900' , 'dark:text-white' , 'transition-colors' , 'duration-300' ) ;
32+
33+ const title = document . createElement ( 'h1' ) ;
34+ title . textContent = 'Home' ;
35+ title . classList . add ( 'text-3xl' , 'font-bold' , 'mb-4' , 'text-green-800' , 'dark:text-green-200' ) ;
36+
37+ homeContainer . appendChild ( title ) ;
38+
39+ document . getElementById ( 'app' ) . innerHTML = '' ;
40+ document . getElementById ( 'app' ) . appendChild ( homeContainer ) ;
41+ }
42+
43+ export function About ( ) {
4244 const app = document . getElementById ( 'app' ) ;
43- app . innerHTML = '' ; // Clear the current content
44-
45- // Create and append the About page
46- const aboutPage = AboutPage ( ) ; // Call the AboutPage function to get the component
45+ app . innerHTML = '' ;
46+ const aboutPage = AboutPage ( ) ;
4747 app . appendChild ( aboutPage ) ;
48- }
49-
50- export function Settings ( ) {
51- document . getElementById ( 'app' ) . innerHTML = `<h1>Settings</h1>` ;
52- }
53-
54- export function NotFound ( ) {
55- document . getElementById ( 'app' ) . innerHTML = `<h1>404 - Page Not Found</h1>` ;
56- }
57-
48+ }
49+
50+ export function Settings ( ) {
51+ const settingsContainer = document . createElement ( 'div' ) ;
52+ settingsContainer . classList . add ( 'min-h-screen' , 'p-6' , 'bg-purple-100' , 'dark:bg-purple-900' , 'text-gray-900' , 'dark:text-white' , 'transition-colors' , 'duration-300' ) ;
53+
54+ const title = document . createElement ( 'h1' ) ;
55+ title . textContent = 'Settings' ;
56+ title . classList . add ( 'text-3xl' , 'font-bold' , 'mb-4' , 'text-purple-800' , 'dark:text-purple-200' ) ;
57+
58+ settingsContainer . appendChild ( title ) ;
59+
60+ document . getElementById ( 'app' ) . innerHTML = '' ;
61+ document . getElementById ( 'app' ) . appendChild ( settingsContainer ) ;
62+ }
63+
64+ export function NotFound ( ) {
65+ const notFoundContainer = document . createElement ( 'div' ) ;
66+ notFoundContainer . classList . add ( 'min-h-screen' , 'p-6' , 'bg-red-100' , 'dark:bg-red-900' , 'text-gray-900' , 'dark:text-white' , 'transition-colors' , 'duration-300' ) ;
67+
68+ const title = document . createElement ( 'h1' ) ;
69+ title . textContent = '404 - Page Not Found' ;
70+ title . classList . add ( 'text-3xl' , 'font-bold' , 'mb-4' , 'text-red-800' , 'dark:text-red-200' ) ;
71+
72+ notFoundContainer . appendChild ( title ) ;
73+
74+ document . getElementById ( 'app' ) . innerHTML = '' ;
75+ document . getElementById ( 'app' ) . appendChild ( notFoundContainer ) ;
76+ }
0 commit comments