diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index 4233dac14..3bf97012c 100644 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -265,7 +265,12 @@ switch ($themeHelper->getThemeName()) { // $themeHelper set in DefaultPageLayout
- +

@@ -275,8 +280,7 @@ switch ($themeHelper->getThemeName()) { // $themeHelper set in DefaultPageLayout
- - +
diff --git a/emhttp/plugins/dynamix/scripts/select_case b/emhttp/plugins/dynamix/scripts/select_case index 0c05052af..67d87884c 100755 --- a/emhttp/plugins/dynamix/scripts/select_case +++ b/emhttp/plugins/dynamix/scripts/select_case @@ -24,49 +24,163 @@ require_once "$docroot/webGui/include/Translations.php"; $boot = "/boot/config/plugins/dynamix"; $file = $argv[1]; $cmodel = is_file("$boot/$file") ? file_get_contents("$boot/$file") : ''; + +$cases = file("$docroot/webGui/styles/default-cases.css", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); +$models = []; + +// Extract case model names from CSS file +foreach ($cases as $case) { + if (substr($case, 0, 6) == '.case-') { + $models[] = substr($case, 1, strpos($case, ':') - 1); + } +} + +natsort($models); ?> +:root { + --case-size: 80px; + --case-gap: 12px; + --hover-color: var(--orange-800); + --active-color: var(--orange-500); + --font-family: clear-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} +.SelectCase { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(var(--case-size), 1fr)); + gap: var(--case-gap); + justify-items: center; + /* offset the swal body automatically being a
... :( */
+    margin-top: -3rem;
+    margin-bottom: -3rem;
+}
+
+.SelectCase-item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    gap: 1rem;
+    width: var(--case-size);
+    padding: 1rem;
+    text-align: center;
+    cursor: pointer;
+    transition: color 0.2s ease;
+    border-radius: 8px;
+}
+
+.SelectCase-item:hover {
+    color: var(--hover-color);
+}
+
+.SelectCase-item--active {
+    color: var(--active-color);
+}
+
+.SelectCase-item span {
+    font-size: 40px;
+    line-height: 1;
+}
+.SelectCase-item-name {
+    font-family: var(--font-family);
+    font-size: 10px;
+    font-weight: 500;
+    word-wrap: break-word;
+    max-width: 100%;
+}
+
+/* Tablet and up */
+@media (min-width: 640px) {
+    :root {
+        --case-size: 100px;
+        --case-gap: 16px;
+    }
+
+    .SelectCase-item span {
+        font-size: 56px;
+    }
+
+    .SelectCase-item-name {
+        font-size: 11px;
+    }
+}
+
+/* Desktop and up */
+@media (min-width: 1024px) {
+    :root {
+        --case-size: 128px;
+        --case-gap: 24px;
+    }
+
+    .SelectCase-item span {
+        font-size: 64px;
+    }
+
+    .SelectCase-item-name {
+        font-size: 12px;
+    }
+}
+
 
-
 
-
$title
\n"; -} -$select = $cmodel=='case-model.png' ? 'color:#e68a00' : ''; -?> -
- - - +
+ +
+ +
+
+ + +
+ +
+
+
+ + + \ No newline at end of file diff --git a/emhttp/plugins/dynamix/sheets/DashStats.css b/emhttp/plugins/dynamix/sheets/DashStats.css index d5c612920..0700fdc27 100644 --- a/emhttp/plugins/dynamix/sheets/DashStats.css +++ b/emhttp/plugins/dynamix/sheets/DashStats.css @@ -510,4 +510,21 @@ legend { .tile-system-memory-charts { grid-template-columns: repeat(4, 1fr); } +} + +.tile-select-case { + cursor: pointer; + transition: color 0.2s ease, opacity 0.2s ease; +} + +.tile-select-case:hover { + color: var(--orange-800); +} + +.tile-select-case:has(img) { + opacity: 1; +} + +.tile-select-case:has(img):hover { + opacity: .75; } \ No newline at end of file