diff options
author | Thedro Neely <thedroneely@gmail.com> | 2021-04-30 03:51:13 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2021-04-30 15:31:01 -0400 |
commit | 9d39a7ba3de79e27029bb5c9c2d72e114d8fa795 (patch) | |
tree | 226696a3c635e5f91b1ca97edff49b7f34663f58 /app/views/components/theme.toggle.php | |
parent | fbd112c924190b1f622c59ff480f0cd2a2433249 (diff) | |
download | thedroneely.com-9d39a7ba3de79e27029bb5c9c2d72e114d8fa795.tar.gz thedroneely.com-9d39a7ba3de79e27029bb5c9c2d72e114d8fa795.tar.bz2 thedroneely.com-9d39a7ba3de79e27029bb5c9c2d72e114d8fa795.zip |
app/views/partials/navigator: Unify
Diffstat (limited to 'app/views/components/theme.toggle.php')
-rw-r--r-- | app/views/components/theme.toggle.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/views/components/theme.toggle.php b/app/views/components/theme.toggle.php new file mode 100644 index 0000000..3b2d15b --- /dev/null +++ b/app/views/components/theme.toggle.php @@ -0,0 +1,35 @@ +<form + class="<?php echo $formClass ?? null; ?>" + method="get" + action="<?php echo $_SERVER['REQUEST_URI']; ?>" +> + <?php if ($theme->color() === 'dark') { ?> + + <button + title="Switch to Light Theme" + class="<?php echo $buttonClass ?? null; ?>" + name="theme" + type="submit" + value="light" + > + <?php echo icon('sun', $iconClass ?? null); ?> + <span>Light</span> + </button> + + <?php } else { ?> + + <button + title="Switch to Dark Theme" + class="<?php echo $buttonClass ?? null; ?>" + name="theme" + type="submit" + value="dark" + > + <?php echo icon('moon', $iconClass ?? null); ?> + <span>Dark</span> + </button> + + <?php } ?> +</form> + +<?php $formClass = $buttonClass = $iconClass = null; ?> |