From c25ee13caba487ee682c2441094cbc973de5cab2 Mon Sep 17 00:00:00 2001 From: 22nibis Date: Tue, 24 Jun 2025 12:22:34 +0530 Subject: [PATCH] style: tablet view version 1 --- .../middle-section.component.css | 17 +- .../touch-pad-menu.component.css | 95 ++++++++- .../touch-pad-menu.component.html | 181 +++++++++--------- src/app/home/home.component.html | 10 +- src/app/home/home.component.ts | 42 +++- 5 files changed, 243 insertions(+), 102 deletions(-) diff --git a/src/app/components/middle-section/middle-section.component.css b/src/app/components/middle-section/middle-section.component.css index 9bda405..f167728 100644 --- a/src/app/components/middle-section/middle-section.component.css +++ b/src/app/components/middle-section/middle-section.component.css @@ -1,3 +1,6 @@ + + + .borderless-custom { border-collapse: separate; border-spacing: 4px; @@ -57,6 +60,16 @@ div[style*="background-color: black"] .custom-cell { .pure-white { background-color: #ffffff !important; } +/* Desktop view (default) - reorder the layout */ +@media (min-width: 801px) { + .main-table { + order: 1; + } + + .transaction-summary { + order: 2; + } +} /* Responsive layout for tablet and mobile */ @media (max-width: 800px) { @@ -64,10 +77,10 @@ div[style*="background-color: black"] .custom-cell { flex-direction: column; align-items: center; height: auto; - overflow-y: auto; + max-height: 50vh; /* Optional: set a cap to avoid too much height */ + overflow-y: auto; /* Add vertical scrollbar */ padding-bottom: 1rem; } - .transaction-summary, .main-table { width: 80% !important; diff --git a/src/app/components/touch-pad-menu/touch-pad-menu.component.css b/src/app/components/touch-pad-menu/touch-pad-menu.component.css index 2dc99ab..a7dab40 100644 --- a/src/app/components/touch-pad-menu/touch-pad-menu.component.css +++ b/src/app/components/touch-pad-menu/touch-pad-menu.component.css @@ -5,6 +5,19 @@ border-radius: 8px; } +.scrollable-touchpad { + max-height: 65vh; + overflow-y: auto; +} + +.scrollable-touchpad::-webkit-scrollbar { + width: 6px; +} +.scrollable-touchpad::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.2); + border-radius: 4px; +} + button { font-weight: bold; } @@ -13,6 +26,86 @@ button { background-color: #ffffff !important; border: 1px solid #ced4da; color: #5d6165; - } +/* ✅ Tablet & Mobile View */ +@media (max-width: 800px) { + .container-fluid { + padding: 0 1rem; + } + + .row.align-items-center { + flex-direction: column !important; + align-items: center; + gap: 0.5rem; + } + + /* Stack and center 3 sections */ + .touch-pad-container .row.gx-2 { + flex-direction: column; + align-items: center; + } + + .touch-pad-container .col-3 { + width: 90% !important; + margin-bottom: 1rem; + order: 1; + } + + .touch-pad-container .col-3 .row.gx-1 { + display: flex; + flex-wrap: wrap; + } + + .touch-pad-container .col-3 .col-4 { + flex: 0 0 33.3333%; + max-width: 33.3333%; + } + + .touch-pad-container .col-2 { + width: 90% !important; + margin-bottom: 1rem; + order: 2; + } + + .touch-pad-container .col-2 .row.gx-1 { + display: flex; + flex-wrap: wrap; + } + + .touch-pad-container .col-2 .col-6 { + flex: 0 0 50%; + max-width: 50%; + } + + .touch-pad-container .col-2 .col-4 { + flex: 0 0 33.3333%; + max-width: 33.3333%; + } + + .touch-pad-container .col-7 { + width: 90% !important; + margin: 0 auto 1rem auto; + order: 3; + } + + .touch-pad-container .col-7 .row.gx-1 { + display: flex; + flex-wrap: wrap; + } + + .touch-pad-container .col-7 .col-2 { + flex: 0 0 16.6667%; + max-width: 16.6667%; + } + + .col-2 .btn, + .col-3 .btn, + .col-7 .btn { + font-size: 1rem; + } + + .scrollable-touchpad { + max-height: 40vh; + } +} diff --git a/src/app/components/touch-pad-menu/touch-pad-menu.component.html b/src/app/components/touch-pad-menu/touch-pad-menu.component.html index 5d36208..3afe07e 100644 --- a/src/app/components/touch-pad-menu/touch-pad-menu.component.html +++ b/src/app/components/touch-pad-menu/touch-pad-menu.component.html @@ -1,99 +1,98 @@ - -
-
+
+
- -
- - - - + +
+ +
+ + + + +
+ + +
+ +
+ + +
+ + +
- -
- -
+ +
+ +
+ + + + +
- -
- - -
- -
-
- - - -
-
- - -
-
-
-
- -
-
-
-
- - -
-
-
-
- -
-
-
-
- - -
-
-
- -
- -
-
- -
- - - -
- -
-
- - - -
- -
-
- - - -
- -
-
- - -
- -
-
- -
-
-
+ +
+ + + +
+
+ +
+
+ + +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ +
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 0159bb5..89cfb3c 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -13,11 +13,17 @@
+ + + +
+ +
- -
+ +
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 6c79ac4..31186ff 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,13 +1,43 @@ -import { Component } from '@angular/core'; -import { NavbarComponent } from '../components/navbar/navbar.component'; +import { Component, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core'; import { SidebarComponent } from '../components/sidebar/sidebar.component'; -import { TouchPadMenuComponent } from '../components/touch-pad-menu/touch-pad-menu.component'; +import { NavbarComponent } from '../components/navbar/navbar.component'; import { MiddleSectionComponent } from '../components/middle-section/middle-section.component'; +import { TouchPadMenuComponent } from '../components/touch-pad-menu/touch-pad-menu.component'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-home', standalone: true, - imports: [NavbarComponent, SidebarComponent, TouchPadMenuComponent, MiddleSectionComponent], // ✅ Add here + imports: [ + CommonModule, + SidebarComponent, + NavbarComponent, + MiddleSectionComponent, + TouchPadMenuComponent, + ], templateUrl: './home.component.html', - styleUrls: ['./home.component.css'] + styleUrls: ['./home.component.css'], }) -export class HomeComponent {} +export class HomeComponent implements OnInit, OnDestroy { + isTabletView = false; + private resizeObserver!: () => void; + + constructor(private cdr: ChangeDetectorRef) {} + + ngOnInit() { + this.updateView(); + this.resizeObserver = () => { + this.updateView(); + this.cdr.detectChanges(); + }; + window.addEventListener('resize', this.resizeObserver); + } + + ngOnDestroy() { + window.removeEventListener('resize', this.resizeObserver); + } + + private updateView() { + this.isTabletView = window.innerWidth <= 800; + } +}