File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ a.darkmode {
1515 0 0 3px rgb (0 0 0 / 12% ),
1616 0 1px 2px rgb (0 0 0 / 24% );
1717 transition : 0.2s ease-in box-shadow;
18+ text-decoration : none;
1819}
1920
2021a .darkmode : hover {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function camelToSkewer(string $str): string
2222 function ($ matches ) {
2323 return "- " . strtolower ($ matches [0 ]);
2424 },
25- $ str,
25+ $ str
2626 );
2727}
2828?>
@@ -46,7 +46,6 @@ function gtag() {
4646 gtag('config', 'G-48CYVH0XEF');
4747 </script>
4848 <title>GitHub Readme Streak Stats Demo</title>
49- <link href="https://css-gg-cdn.pages.dev/css" rel="stylesheet">
5049 <link rel="stylesheet" href="./css/style.css?v=<?= filemtime ("./css/style.css " ) ?> ">
5150 <link rel="stylesheet" href="./css/toggle-dark.css?v=<?= filemtime ("./css/toggle-dark.css " ) ?> ">
5251
@@ -281,7 +280,13 @@ function gtag() {
281280 </div>
282281
283282 <a href="javascript:toggleTheme()" class="darkmode" title="toggle dark mode">
284- <i class="<?php echo $ darkmode === "on " ? "gg-sun " : "gg-moon " ; ?> "></i>
283+ <span id="darkmode-icon">
284+ <?php if ($ darkmode === "on " ): ?>
285+ 🌞
286+ <?php else : ?>
287+ 🌙
288+ <?php endif ; ?>
289+ </span>
285290 </a>
286291</body>
287292
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function getCookie(name) {
3939 * Turn on dark mode
4040 */
4141function darkmode ( ) {
42- document . querySelector ( ". darkmode i " ) . className = "gg-sun " ;
42+ document . querySelector ( "# darkmode-icon " ) . innerText = "🌞 " ;
4343 setCookie ( "darkmode" , "on" , 9999 ) ;
4444 document . body . setAttribute ( "data-theme" , "dark" ) ;
4545}
@@ -48,7 +48,7 @@ function darkmode() {
4848 * Turn on light mode
4949 */
5050function lightmode ( ) {
51- document . querySelector ( ". darkmode i " ) . className = "gg-moon " ;
51+ document . querySelector ( "# darkmode-icon " ) . innerText = "🌙 " ;
5252 setCookie ( "darkmode" , "off" , 9999 ) ;
5353 document . body . removeAttribute ( "data-theme" ) ;
5454}
You can’t perform that action at this time.
0 commit comments