|
| 1 | +<nav id="nav-bar" hx-preserve |
| 2 | + class="z-20 px-6 xl:px-0 bg-brand-dark dark:bg-brand-light text-white overflow-x-clip dark:text-slate-950 sticky left-0 right-0 top-0" |
| 3 | + x-data="{ |
| 4 | + mobileNavOpen: false, |
| 5 | + theme: localStorage.theme ?? null, |
| 6 | + initDarkMode() { |
| 7 | + // Set up listener for system preference changes |
| 8 | + const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); |
| 9 | + |
| 10 | + // Initial check based on system preference if no explicit theme is set |
| 11 | + if (this.theme === null && darkModeMediaQuery.matches) { |
| 12 | + document.documentElement.classList.add('dark'); |
| 13 | + } |
| 14 | + |
| 15 | + // Listen for changes in system preference |
| 16 | + darkModeMediaQuery.addEventListener('change', (e) => { |
| 17 | + if (this.theme === null) { |
| 18 | + if (e.matches) { |
| 19 | + document.documentElement.classList.add('dark'); |
| 20 | + } else { |
| 21 | + document.documentElement.classList.remove('dark'); |
| 22 | + } |
| 23 | + } |
| 24 | + }); |
| 25 | + } |
| 26 | + }" x-init="initDarkMode()" @click.away="mobileNavOpen = false"> |
| 27 | + |
| 28 | + <div class="max-w-6xl mx-auto"> |
| 29 | + |
| 30 | + <div class="flex flex-row h-12 items-center"> |
| 31 | + |
| 32 | + <a class="navbar-brand mr-auto gap-2 flex flex-row items-center" href="{{ '/' | relative_url }}" |
| 33 | + @click="open=false; mobileNavOpen=false;"> |
| 34 | + <img class="inline dark:hidden" src="{{ '/img/logo/fsharp100mclight.png' | relative_url }}" |
| 35 | + alt="F# Logo" width="30" height="30" /> |
| 36 | + <img class="hidden dark:inline" src="{{ '/img/logo/fsharp100mcdark.png' | relative_url }}" alt="F# Logo" |
| 37 | + width="30" height="30" /> |
| 38 | + <span class="font-heading">F# Software Foundation</span> |
| 39 | + </a> |
| 40 | + |
| 41 | + <button @click="mobileNavOpen = !mobileNavOpen" class="visible md:hidden" type="button"> |
| 42 | + <i class="fa-solid fa-bars ml-auto "></i> |
| 43 | + </button> |
| 44 | + |
| 45 | + <div x-bind:aria-expanded="mobileNavOpen" |
| 46 | + class='bg-brand-light transition-transform p-2 md:p-0 z-20 translate-x-0 md:translate-0 aria-expanded:-translate-x-72 ease-out duration-300 w-72 md:w-auto aria-expanded:flex h-screen md:h-auto overflow-y-auto md:overflow-y-visible absolute top-12 -right-72 md:static md:bg-transparent md:flex flex-col md:flex-row md:align-items-stretch '> |
| 47 | + |
| 48 | + <!-- <a class="navbar-brand md:hidden px-4 py-2 mr-auto gap-2 flex flex-row items-center" href="{{ '/' | relative_url }}" |
| 49 | + @click="open=false; mobileNavOpen=false;"> |
| 50 | + <img class="inline dark:hidden" src="{{ '/img/logo/fsharp100mclight.png' | relative_url }}" alt="F# Logo" width="30" height="30" /> |
| 51 | + <img class="hidden dark:inline" src="{{ '/img/logo/fsharp100mcdark.png' | relative_url }}" alt="F# Logo" width="30" height="30" /> |
| 52 | + <span class="font-heading">F# Software Foundation</span> |
| 53 | + </a> --> |
| 54 | + |
| 55 | + <div class="nav-item" x-data="{open: false}" @click.away="open= false"> |
| 56 | + <button type="button" @click="open=!open" x-bind:aria-expanded="open"> |
| 57 | + Learn <i class="fa-solid fa-chevron-down text-white/70 dark:text-slate-950/70"></i> |
| 58 | + </button> |
| 59 | + |
| 60 | + <div x-cloak @click="open=false; mobileNavOpen=false;" x-transition x-show="open" role="menu" |
| 61 | + aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1"> |
| 62 | + <div role="none"> |
| 63 | + <!-- Active: "bg-gray-100 text-gray-900 outline-hidden", Not Active: "text-gray-700" --> |
| 64 | + <a href="{{ '/learn' | relative_url }}" role="menuitem" class="group" tabindex="-1">Learn |
| 65 | + F#</a> |
| 66 | + <a href="{{ '/docs' | relative_url }}" role="menuitem" class="group" |
| 67 | + tabindex="-1">Documentation</a> |
| 68 | + <a href="{{ '/testimonials' | relative_url }}" role="menuitem" class="group" |
| 69 | + tabindex="-1">Testimonials</a> |
| 70 | + <a href="{{ '/teaching/research' | relative_url }}" role="menuitem" class="group" |
| 71 | + tabindex="-1">Publications</a> |
| 72 | + <a href="https://www.youtube.com/c/fsharporg" role="menuitem" class="group" |
| 73 | + tabindex="-1">Videos (FSFF channel)</a> |
| 74 | + <a href="https://www.youtube.com/results?search_query=learn+f%23" role="menuitem" |
| 75 | + class="group" tabindex="-1">Videos <span class="badge">unaffiliated</span></a> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + |
| 80 | + <div class="nav-item" x-data="{open: false}" @click.away="open= false"> |
| 81 | + <button type="button" @click="open=!open" x-bind:aria-expanded="open"> |
| 82 | + Use <i class="fa-solid fa-chevron-down text-white/70 dark:text-slate-950/70"></i></i> |
| 83 | + </button> |
| 84 | + |
| 85 | + {% include usemenu.html %} |
| 86 | + </div> |
| 87 | + |
| 88 | + <div class="nav-item" x-data="{open: false}" @click.away="open= false"> |
| 89 | + <button type="button" @click="open=!open" x-bind:aria-expanded="open"> |
| 90 | + Guides <i class="fa-solid fa-chevron-down text-white/70 dark:text-slate-950/70"></i> |
| 91 | + </button> |
| 92 | + |
| 93 | + <div x-cloak @click="open=false; mobileNavOpen=false;" x-transition x-show="open" role="menu" |
| 94 | + aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1"> |
| 95 | + <div role="none"> |
| 96 | + <a href="{{ '/guides/cloud/' | relative_url }}" role="menuitem" class="group" |
| 97 | + tabindex="-1">Cloud</a> |
| 98 | + <a href="{{ '/guides/data-access/' | relative_url }}" role="menuitem" class="group" |
| 99 | + tabindex="-1">Data Access</a> |
| 100 | + <a href="{{ '/guides/data-science/' | relative_url }}" role="menuitem" class="group" |
| 101 | + tabindex="-1">Data Science</a> |
| 102 | + <a href="{{ '/guides/enterprise/' | relative_url }}" role="menuitem" class="group" |
| 103 | + tabindex="-1">Enterprise</a> |
| 104 | + <a href="{{ '/guides/mobile-apps/' | relative_url }}" role="menuitem" class="group" |
| 105 | + tabindex="-1">Mobile Apps</a> |
| 106 | + <a href="{{ '/guides/web/' | relative_url }}" role="menuitem" class="group" |
| 107 | + tabindex="-1">Web</a> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + |
| 112 | + <div class="nav-item" x-data="{open: false}" @click.away="open= false"> |
| 113 | + <button type="button" @click="open=!open" x-bind:aria-expanded="open"> |
| 114 | + Community <i class="fa-solid fa-chevron-down text-white/70 dark:text-slate-950/70"></i> |
| 115 | + </button> |
| 116 | + |
| 117 | + <div x-cloak @click="open=false; mobileNavOpen=false;" x-transition x-show="open" role="menu" |
| 118 | + aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1"> |
| 119 | + <div role="none"> |
| 120 | + <a href="{{ '/guides/engineering/issues' | relative_url }}" role="menuitem" class="group" |
| 121 | + tabindex="-1"> |
| 122 | + <i class="fa-solid fa-screwdriver-wrench"></i> Contribute a Fix / Report an Issue |
| 123 | + </a> |
| 124 | + </div> |
| 125 | + <div role="none"> |
| 126 | + <a role="menuitem" class="group" href="{{ '/community/projects/' | relative_url }}">F# Community Projects</a> |
| 127 | + <a role="menuitem" class="group" href="http://www.fssnip.net/">F# Code Snippets</a> |
| 128 | + <a role="menuitem" class="group" |
| 129 | + href="http://codereview.stackexchange.com/questions/tagged/f%23">F# Code Review <span |
| 130 | + class="badge">unaffiliated</span></a> |
| 131 | + </div> |
| 132 | + <div role="none"> |
| 133 | + <a role="menuitem" class="group" href="https://community.fsharp.org/user_groups">User |
| 134 | + Groups</a> |
| 135 | + <a role="menuitem" class="group" href="https://community.fsharp.org/speakers">Speakers |
| 136 | + Program</a> |
| 137 | + </div> |
| 138 | + <div role="none"> |
| 139 | + <a role="menuitem" class="group" href="https://forums.fsharp.org"> |
| 140 | + <i class="fa-solid fa-table-list"></i> Forum |
| 141 | + </a> |
| 142 | + <a href="{{ '/guides/slack' | relative_url }}" role="menuitem" class="group" tabindex="-1"> |
| 143 | + <i class="fa-brands fa-slack"></i> Slack |
| 144 | + </a> |
| 145 | + <a role="menuitem" class="group" href="https://discord.gg/R6n7c54"> |
| 146 | + <i class="fa-brands fa-discord"></i> Discord <span class="badge">unaffiliated</span> |
| 147 | + </a> |
| 148 | + <a href="https://bsky.app/starter-pack/blizard.io/3la4zswhqbt2e" role="menuitem" |
| 149 | + class="group" tabindex="-1"> |
| 150 | + <i class="fa-brands fa-bluesky"></i> Bluesky <span class="badge">unaffiliated</span> |
| 151 | + </a> |
| 152 | + <a role="menuitem" class="group" href="https://x.com/search?q=%23fsharp"> |
| 153 | + <i class="fa-brands fa-x-twitter"></i> X.com <span class="badge">unaffiliated</span> |
| 154 | + </a> |
| 155 | + <a role="menuitem" class="group" href="https://www.reddit.com/r/fsharp/"> |
| 156 | + <i class="fa-brands fa-reddit"></i> Reddit <span class="badge">unaffiliated</span> |
| 157 | + </a> |
| 158 | + <a role="menuitem" class="group" href="http://stackoverflow.com/questions/tagged/f%23"> |
| 159 | + <i class="fa-brands fa-stack-overflow"></i> StackOverflow <span |
| 160 | + class="badge">unaffiliated</span> |
| 161 | + </a> |
| 162 | + </div> |
| 163 | + </div> |
| 164 | + </div> |
| 165 | + |
| 166 | + <div class="nav-item" x-data="{open: false}" @click.away="open= false"> |
| 167 | + <button type="button" @click="open=!open" x-bind:aria-expanded="open"> |
| 168 | + Foundation <i class="fa-solid fa-chevron-down text-white/70 dark:text-slate-950/70"></i> |
| 169 | + </button> |
| 170 | + |
| 171 | + <div x-cloak @click="open=false; mobileNavOpen=false;" x-transition x-show="open" role="menu" |
| 172 | + aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1"> |
| 173 | + <div role="none"> |
| 174 | + <a role="menuitem" href="https://foundation.fsharp.org">Mission statement</a> |
| 175 | + <a role="menuitem" href="https://foundation.fsharp.org/join">Join</a> |
| 176 | + <a role="menuitem" href="https://foundation.fsharp.org/announcements">Announcements</a> |
| 177 | + <a role="menuitem" href="https://foundation.fsharp.org/member_roster">Member Roster</a> |
| 178 | + <a role="menuitem" href="https://foundation.fsharp.org/code_of_conduct">Code of Conduct</a> |
| 179 | + <a role="menuitem" href="https://foundation.fsharp.org/donate">Donate</a> |
| 180 | + <a role="menuitem" href="https://foundation.fsharp.org/logo">F# Logo</a> |
| 181 | + <a role="menuitem" href="https://foundation.fsharp.org/contact">Contact</a> |
| 182 | + </div> |
| 183 | + </div> |
| 184 | + </div> |
| 185 | + |
| 186 | + <button role="button" type="button" class="w-6 ml-2"> |
| 187 | + <i x-show="theme == null" |
| 188 | + @click="localStorage.theme = 'dark'; theme = 'dark'; document.documentElement.classList.add('dark')" |
| 189 | + class="ml-auto fa-solid fa-circle-half-stroke"></i> |
| 190 | + <i x-cloak x-show="theme === 'dark'" |
| 191 | + @click="localStorage.theme = 'light'; theme = 'light'; document.documentElement.classList.remove('dark')" |
| 192 | + class="ml-auto fa-solid fa-moon"></i> |
| 193 | + <i x-cloak x-show="theme === 'light'" |
| 194 | + @click="localStorage.removeItem('theme'); theme = null; if (window.matchMedia('(prefers-color-scheme: dark)').matches) document.documentElement.classList.add('dark')" |
| 195 | + class="ml-auto fa-solid fa-sun"></i> |
| 196 | + </button> |
| 197 | + </div> |
| 198 | + |
| 199 | + </div> |
| 200 | + |
| 201 | + |
| 202 | + </div> |
| 203 | + |
| 204 | + <div x-cloak @click="mobileNavOpen=false" x-transition.opacity.duration.300 x-show="mobileNavOpen" |
| 205 | + class="fixed inset-0 top-12 z-10 bg-black/30" ></div> |
| 206 | + |
| 207 | + |
| 208 | +</nav> |
| 209 | + |
| 210 | +<div class="htmx-indicator" hx-preserve id="loading-strip"></div> |
| 211 | + |
| 212 | + |
0 commit comments