|
1 | 1 | package template
|
2 | 2 |
|
| 3 | +type NavbarItem struct { |
| 4 | + Name string |
| 5 | + Link templ.SafeURL |
| 6 | +} |
| 7 | + |
| 8 | +type Social struct { |
| 9 | + Icon string |
| 10 | + Link templ.SafeURL |
| 11 | +} |
| 12 | + |
3 | 13 | templ Base(title string) {
|
4 | 14 | <html>
|
5 | 15 | <head>
|
6 | 16 | <meta charset="UTF-8"/>
|
7 | 17 | <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
8 | 18 | <script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
| 19 | + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer"/> |
| 20 | + <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp,container-queries"></script> |
| 21 | + <script> |
| 22 | + tailwind.config = { |
| 23 | + theme: { |
| 24 | + extend: {}, |
| 25 | + }, |
| 26 | + darkMode: "class" |
| 27 | + }; |
| 28 | + </script> |
| 29 | + <link rel="preconnect" href="https://fonts.googleapis.com"/> |
| 30 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/> |
| 31 | + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet"/> |
| 32 | + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet"/> |
9 | 33 | <title>{ title }</title>
|
10 | 34 | <link rel="icon" type="image/x-icon" href="public/favicon.ico"/>
|
| 35 | + <style> |
| 36 | + html, body { |
| 37 | + font-family: 'Inter', sans-serif; |
| 38 | + margin: 0; |
| 39 | + padding: 0; |
| 40 | + } |
| 41 | + |
| 42 | + .space-mono { |
| 43 | + font-family: 'Space Mono', monospace; |
| 44 | + font-weight: 400; |
| 45 | + line-height: 1.5; |
| 46 | + } |
| 47 | + </style> |
11 | 48 | </head>
|
12 |
| - <body> |
13 |
| - <main class="p-6 grid gap-4"> |
| 49 | + <body class="bg-[#F5F5F5] dark:bg-[#1E1E1E] dark:text-[#D9D9D9] transition-all duration-500"> |
| 50 | + <main> |
14 | 51 | { children... }
|
15 | 52 | </main>
|
16 | 53 | </body>
|
17 | 54 | </html>
|
18 | 55 | }
|
19 | 56 |
|
20 |
| -templ Home(title string) { |
| 57 | +templ Home(title string, navbar []NavbarItem, socials []Social) { |
21 | 58 | @Base(title) {
|
22 |
| - <div>Under Construction</div> |
| 59 | + // add dark mode toggle |
| 60 | + <div class="fixed bottom-4 right-4 z-50"> |
| 61 | + <button |
| 62 | + class="w-12 h-12 rounded-full text-xl bg-[#D9D9D9] hover:bg-[#98989F] dark:bg-[#2f2f2f] dark:hover:bg-[#464646] transition-all duration-300" |
| 63 | + onclick="document.documentElement.classList.toggle('dark')" |
| 64 | + > |
| 65 | + <i class="fa-solid fa-moon dark:hidden"></i> |
| 66 | + <i class="fa-solid fa-sun hidden dark:block"></i> |
| 67 | + </button> |
| 68 | + </div> |
| 69 | + // place hummus.png on the bottom left corner |
| 70 | + <img |
| 71 | + src="public/hummus.svg" |
| 72 | + class="fixed -bottom-8 -left-8 w-40 h-auto transform rotate-[18deg] hover:-bottom-4 hover:rotate-[20deg] hover:-left-4 transition-all duration-300 z-50" |
| 73 | + /> |
| 74 | + // main content |
| 75 | + <div class="max-w-xl mx-auto flex flex-col p-4 md:p-0 space-y-8 md:space-y-12 md:min-h-screen"> |
| 76 | + <div></div> |
| 77 | + <div class="text-lg md:text-2xl text-white"> |
| 78 | + <p class="p-4 text-center font-medium tracking-wide bg-[#00ADD8] rounded-xl"> |
| 79 | + Stay tuned for the announcement of |
| 80 | + <br class="hidden md:block"/> |
| 81 | + the first official GoUAE Meetup! |
| 82 | + </p> |
| 83 | + </div> |
| 84 | + <div class="text-lg md:text-3xl mx-auto flex flex-col items-center justify-center md:items-start"> |
| 85 | + <div class="space-mono flex flex-wrap items-center justify-center gap-4 dark:text-[#98989F]"> |
| 86 | + <span>A </span> |
| 87 | + // GO logo |
| 88 | + <img src="public/go.png" class="h-4 md:h-6 w-auto"/> |
| 89 | + <span>User Group </span> |
| 90 | + <span>in the 🇦🇪 UAE</span> |
| 91 | + <span>For the </span> |
| 92 | + // MENA logo |
| 93 | + <img src="public/mena.png" class="h-6 rounded-md md:h-16 w-auto md:rounded-xl"/> |
| 94 | + <span>MENA Region</span> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + <div class="flex justify-center md:justify-evenly items-center text-lg flex-wrap gap-4 md:gap-0"> |
| 98 | + for i, item := range navbar { |
| 99 | + <a href={ item.Link } class="no-underline hover:bg-[#00ADD8] hover:text-white rounded-full px-2 py-1">{ item.Name }</a> |
| 100 | + if i < len(navbar) - 1 { |
| 101 | + <i class="fa-solid fa-xmark hidden md:block text-[#CAC6C6] text-xs"></i> |
| 102 | + } |
| 103 | + } |
| 104 | + </div> |
| 105 | + <p class="pt-8 text-md md:text-xl md:text-justify text-[#3D3B3B] dark:text-[#D9D9D9]"> |
| 106 | + GoUAE is a UAE-based community for anyone |
| 107 | + interested in the Go programming language. |
| 108 | + GoUAE was founded on Saturday, May 25, 2024, |
| 109 | + and since then the group has grown to over 100 members. |
| 110 | + </p> |
| 111 | + <div class="flex-1"></div> |
| 112 | + <div class="flex justify-center md:justify-between items-center flex-col md:flex-row gap-4 md:gap-0 text-center md:text-left"> |
| 113 | + <div class="text-[#676767] dark:text-[#D9D9D9]"> |
| 114 | + <div class="font-medium"> |
| 115 | + © GoUAE 2024 |
| 116 | + </div> |
| 117 | + <div class="font-bold"> |
| 118 | + A Coders(HQ) Community |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + <div class="flex flex-wrap items-center justify-center gap-x-2 md:grid md:grid-cols-3 md:grid-rows-2"> |
| 122 | + <div class="hidden md:block"></div> |
| 123 | + for _, social := range socials { |
| 124 | + <a |
| 125 | + href={ social.Link } |
| 126 | + target="_blank" |
| 127 | + class="w-12 h-12 rounded-full flex items-center justify-center no-underline text-[#464646] dark:text-[#D9D9D9] hover:bg-[#00ADD8] hover:text-white" |
| 128 | + > |
| 129 | + <i class={ "text-2xl fa-brands", social.Icon }></i> |
| 130 | + </a> |
| 131 | + } |
| 132 | + </div> |
| 133 | + </div> |
| 134 | + <div></div> |
| 135 | + </div> |
| 136 | + <div class="h-24 md:h-0"></div> |
23 | 137 | }
|
24 | 138 | }
|
0 commit comments