|
10 | 10 | <link href="favicon.ico" rel="apple-touch-icon">
|
11 | 11 | <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i" rel="stylesheet">
|
12 | 12 | <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
|
| 13 | + <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" rel="stylesheet"> |
13 | 14 | <link href=" https://unpkg.com/[email protected]/css/boxicons.min.css" rel=" stylesheet" >
|
14 | 15 | <link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.0/styles/default.min.css" rel="stylesheet">
|
15 | 16 | <link href="https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.css" rel="stylesheet">
|
16 | 17 | <link href="styles/home.css" rel="stylesheet">
|
17 | 18 | <link href="styles/icofont.min.css" rel="stylesheet">
|
| 19 | + <link href="styles/dark-mode.css" rel="stylesheet" id="dark-mode-style-sheet" disabled> |
| 20 | + <script> |
| 21 | + // Running this early to prevent an initial white flash on page load when dark mode is the default theme. |
| 22 | + const darkModeStyleSheet = document.getElementById('dark-mode-style-sheet'); |
| 23 | + const theme = localStorage.getItem("theme") || "auto"; |
| 24 | + |
| 25 | + if (theme === "auto") { |
| 26 | + darkModeStyleSheet.disabled = !window.matchMedia("(prefers-color-scheme: dark)").matches; |
| 27 | + } |
| 28 | + else if (theme === "dark") { |
| 29 | + darkModeStyleSheet.disabled = false; |
| 30 | + } else if (theme === "light") { |
| 31 | + darkModeStyleSheet.disabled = true; |
| 32 | + } |
| 33 | + </script> |
18 | 34 | </head>
|
19 | 35 | <body>
|
| 36 | + <div class="container-xl"> |
| 37 | + <div class="dropdown p-3 float-right"> |
| 38 | + <a class="btn btn-theme dropdown-toggle" href="#" role="button" id="themeSelector" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 39 | + <i id="active-theme"></i> |
| 40 | + </a> |
| 41 | + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="themeSelector"> |
| 42 | + <a class="dropdown-item theme-choice" data-theme="light" href="#"><i class="bi bi-sun"></i> Light</a> |
| 43 | + <a class="dropdown-item theme-choice" data-theme="dark" href="#"><i class="bi bi-moon"></i> Dark</a> |
| 44 | + <a class="dropdown-item theme-choice" data-theme="auto" href="#"><i class="bi-circle-half"></i> Auto</a> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + </div> |
20 | 48 | <section id="hero" class="d-flex align-items-center">
|
21 | 49 | <div class="container">
|
22 | 50 | <div class="row">
|
|
0 commit comments