+
\ No newline at end of file
diff --git a/app/Views/partials/validation-form.twig b/app/Views/partials/validation-form.twig
index 933ac13..82b155a 100644
--- a/app/Views/partials/validation-form.twig
+++ b/app/Views/partials/validation-form.twig
@@ -1,7 +1,9 @@
+{% include "components/spinner.twig" %}
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/Views/validation-test.twig b/app/Views/validation-test.twig
index 9322b7e..57c5493 100644
--- a/app/Views/validation-test.twig
+++ b/app/Views/validation-test.twig
@@ -2,10 +2,8 @@
{% block title %}validation-test{% endblock %}
{% block content %}
-
validation-test
-
This is the validation-test page.
-
Validation Test Form
-
- {% include "partials/validation-form.twig" %}
-
+
Validation Test Form
+
+ {% include "partials/validation-form.twig" %}
+
{% endblock %}
diff --git a/core/Console/PostInstall.php b/core/Console/PostInstall.php
index a545046..c571320 100644
--- a/core/Console/PostInstall.php
+++ b/core/Console/PostInstall.php
@@ -59,11 +59,11 @@ public static function run()
}
$color = '';
- $needsColor = in_array($choice, ['5','6','7','8']);
+ $needsColor = in_array($choice, ['5', '6', '7', '8']);
if ($needsColor) {
echo "Enter color name (amber, blue, cyan, fuchsia, green, grey, indigo, jade, lime, orange, pink, pumpkin, purple, red, sand, slate, violet, yellow, zinc): ";
$color = strtolower(trim(fgets(STDIN)));
- $validColors = ['amber','blue','cyan','fuchsia','green','grey','indigo','jade','lime','orange','pink','pumpkin','purple','red','sand','slate','violet','yellow','zinc'];
+ $validColors = ['amber', 'blue', 'cyan', 'fuchsia', 'green', 'grey', 'indigo', 'jade', 'lime', 'orange', 'pink', 'pumpkin', 'purple', 'red', 'sand', 'slate', 'violet', 'yellow', 'zinc'];
if (!in_array($color, $validColors)) {
echo "Invalid color. Defaulting to blue.\n";
$color = 'blue';
@@ -78,21 +78,96 @@ public static function run()
$file = '';
switch ($choice) {
- case '1': $file = "pico$min.css"; break;
- case '2': $file = "pico.classless$min.css"; break;
- case '3': $file = "pico.conditional$min.css"; break;
- case '4': $file = "pico.fluid.classless$min.css"; break;
- case '5': $file = "pico.$color$min.css"; break;
- case '6': $file = "pico.classless.$color$min.css"; break;
- case '7': $file = "pico.conditional.$color$min.css"; break;
- case '8': $file = "pico.fluid.classless.conditional.$color$min.css"; break;
- case '9': $file = "pico.colors$min.css"; break;
- default: $file = "pico$min.css"; break;
+ case '1':
+ $file = "pico$min.css";
+ break;
+ case '2':
+ $file = "pico.classless$min.css";
+ break;
+ case '3':
+ $file = "pico.conditional$min.css";
+ break;
+ case '4':
+ $file = "pico.fluid.classless$min.css";
+ break;
+ case '5':
+ $file = "pico.$color$min.css";
+ break;
+ case '6':
+ $file = "pico.classless.$color$min.css";
+ break;
+ case '7':
+ $file = "pico.conditional.$color$min.css";
+ break;
+ case '8':
+ $file = "pico.fluid.classless.conditional.$color$min.css";
+ break;
+ case '9':
+ $file = "pico.colors$min.css";
+ break;
+ default:
+ $file = "pico$min.css";
+ break;
}
$url = $base . $file;
$dest = __DIR__ . '/../../public/assets/css/sprout.min.css';
self::download($url, $dest);
+
+ // Prompt for dark/light mode toggle
+ echo "\nWould you like to include a dark/light mode toggle button in your navbar? (y/N): ";
+ $includeToggle = strtolower(trim(fgets(STDIN)));
+ if ($includeToggle === 'y') {
+ $navbarPath = __DIR__ . '/../../app/Views/components/navbar.twig';
+ $navbar = file_get_contents($navbarPath);
+ // Only add if not already present
+ if (strpos($navbar, 'theme-toggle-btn') === false) {
+ $toggleBtn = <<
+
+
+
+ HTML;
+ // Insert before of the right-side nav (last in file)
+ $navbar = preg_replace('/(<\/ul>)(?![\s\S]*<\/ul>)/', "$toggleBtn\n$1", $navbar, 1);
+ // Add the script before at the end
+ $toggleScript = <<
+ SCRIPT;
+ $navbar = preg_replace('/<\/div>\s*$/', "$toggleScript\n", $navbar, 1);
+ file_put_contents($navbarPath, $navbar);
+ echo "â Dark/light mode toggle added to your navbar.\n";
+ } else {
+ echo "âšī¸ Dark/light mode toggle already present in your navbar.\n";
+ }
+ } else {
+ echo "âšī¸ You can add a dark/light mode toggle later by yourself if you wish.\n";
+ }
}
}