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
... :( */
+ 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;
+ }
+}
+
-
-
-$cases = file("$docroot/webGui/styles/default-cases.css",FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
-foreach ($cases as $case) if (substr($case,0,6)=='.case-') $models[] = substr($case,1,strpos($case,':')-1);
-natsort($models);
-for ($i=0; $i < count($models); $i++) {
- $model = $models[$i];
- $name = substr($model,5);
- $title = str_replace('3u-avs-10-4','3u-avs-10/4',$name);
- $select = $name==$cmodel ? 'color:#e68a00' : '';
- echo "$title\n";
-}
-$select = $cmodel=='case-model.png' ? 'color:#e68a00' : '';
-?>
-=_('custom image')?>
-
-
-
+
+
+ foreach ($models as $model) {
+ $name = substr($model, 5);
+ $title = str_replace('3u-avs-10-4', '3u-avs-10/4', $name);
+ $caseActive = $name == $cmodel ? 'SelectCase-item--active' : '';
+ ?>
+
+
+ =$title?>
+
+ } ?>
+
+
+
+ =_('custom image')?>
+
+
+
+
+
\ 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