aboutsummaryrefslogtreecommitdiff
path: root/app/views/components
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2020-01-05 01:56:43 -0500
committerThedro Neely <thedroneely@gmail.com>2020-01-05 01:56:43 -0500
commitd67d4c0351747554afcf42fa5df002b093d2c6d5 (patch)
tree9c331ad67c4df945fbba9a21f0d5ba9cf73df6da /app/views/components
parentee3de3629c26775dacdbaaf196585de70ccbabf9 (diff)
downloadthedroneely.com-d67d4c0351747554afcf42fa5df002b093d2c6d5.tar.gz
thedroneely.com-d67d4c0351747554afcf42fa5df002b093d2c6d5.tar.bz2
thedroneely.com-d67d4c0351747554afcf42fa5df002b093d2c6d5.zip
app/views/components: Add components
Diffstat (limited to 'app/views/components')
-rw-r--r--app/views/components/context-menu.php31
-rw-r--r--app/views/components/theme-toggle.php33
2 files changed, 64 insertions, 0 deletions
diff --git a/app/views/components/context-menu.php b/app/views/components/context-menu.php
new file mode 100644
index 0000000..a33cbb7
--- /dev/null
+++ b/app/views/components/context-menu.php
@@ -0,0 +1,31 @@
+<div class="dropdown <?php echo $type ?? null ?>">
+ <input
+ class="is-hidden input-dropdown"
+ type="checkbox"
+ id="dropdown-menu__<?php echo $id ?? null ?>"
+ />
+
+ <label for="dropdown-menu__<?php echo $id ?? null ?>">
+ <?php echo $label ?? null ?>
+ </label>
+
+ <div class="dropdown-menu">
+ <div class="dropdown-content">
+ <?php
+ echo $content ?? null;
+ if ($links ?? null === true) {
+ include views('partials', 'navigator.links');
+ $formClass = 'theme-toggle';
+ $buttonClass ='theme-toggle-button button is-text has-text-left is-block';
+ include views('components', 'theme-toggle');
+ }
+ ?>
+ </div>
+ </div>
+</div>
+
+<style>
+ .input-dropdown[type="checkbox"]:checked ~ .dropdown-menu {
+ display: block;
+ }
+</style>
diff --git a/app/views/components/theme-toggle.php b/app/views/components/theme-toggle.php
new file mode 100644
index 0000000..c28b240
--- /dev/null
+++ b/app/views/components/theme-toggle.php
@@ -0,0 +1,33 @@
+<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 featherIcon('sun', 'is-hidden-touch'); ?>
+ <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 featherIcon('moon', 'is-hidden-touch'); ?>
+ <span>Dark</span>
+ </button>
+
+ <?php } ?>
+</form>