From 5b0b9ca250b9b956ee622adc22d3f015d1855a57 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Wed, 28 Jun 2023 17:53:57 +0100 Subject: [PATCH] Improved mobile styling (removing border-radius etc) --- apps/web/package.json | 1 + apps/web/public/style.css | 29 ++++++++++++------------- apps/web/src/components/App.jsx | 5 ++++- apps/web/src/components/HomePage.jsx | 4 +++- apps/web/src/components/Keyboard.jsx | 14 ++++++++++-- apps/web/src/components/Nav.jsx | 7 ++++-- apps/web/src/components/ProjectPage.jsx | 5 ++++- package-lock.json | 19 ++++++++++++++-- 8 files changed, 60 insertions(+), 24 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index eb8ae9d..14bd1ee 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -34,6 +34,7 @@ "@lagunovsky/redux-react-router": "^4.3.0", "axios": "^1.2.1", "bas2tap": "^0.0.1-alpha.4", + "clsx": "^1.2.1", "codemirror": "^5.65.11", "date-fns": "^2.29.3", "file-dialog": "^0.0.8", diff --git a/apps/web/public/style.css b/apps/web/public/style.css index 846311d..dc781cf 100644 --- a/apps/web/public/style.css +++ b/apps/web/public/style.css @@ -77,15 +77,15 @@ code { align-items: center; } -.p-tabview, -.p-tabview > .p-tabview-nav-container, -.p-tabview > .p-tabview-nav-container > .p-tabview-nav-content, -.p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav, -.p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav > .p-tabview-selected, -.p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav > .p-tabview-selected > a, -#jsspeccy-screen > div, -#jsspeccy-screen > div > div, -#jsspeccy-screen > div > div > canvas { +.desktop .p-tabview, +.desktop .p-tabview > .p-tabview-nav-container, +.desktop .p-tabview > .p-tabview-nav-container > .p-tabview-nav-content, +.desktop .p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav, +.desktop .p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav > .p-tabview-selected, +.desktop .p-tabview > .p-tabview-nav-container > .p-tabview-nav-content > .p-tabview-nav > .p-tabview-selected > a, +.desktop #jsspeccy-screen > div, +.desktop #jsspeccy-screen > div > div, +.desktop #jsspeccy-screen > div > div > canvas { border-radius: 5px 5px 0 0; } @@ -102,12 +102,7 @@ code { image-rendering: crisp-edges; } -#virtkeys { - border-radius: 0 0 5px 5px; -} - .CodeMirror { - border-radius: 5px; font-family: monospace !important; font-size: 16px !important; height: calc(100vh - 177px) !important; @@ -115,11 +110,15 @@ code { border: 1px solid #5B5B5B; } +.desktop .CodeMirror { + border-radius: 5px; +} + .CodeMirror-scrollbar-filler { background-color: #424242 !important; } -.p-button { +.desktop .p-button { border-radius: 5px !important; } diff --git a/apps/web/src/components/App.jsx b/apps/web/src/components/App.jsx index 37c2533..b7787e5 100644 --- a/apps/web/src/components/App.jsx +++ b/apps/web/src/components/App.jsx @@ -22,16 +22,19 @@ import YourProfilePage from "./YourProfilePage"; import YourProjectsPage from "./YourProjectsPage"; import ErrorNotFoundPage from "./ErrorNotFoundPage"; import ErrorPage from "./ErrorPage"; +import clsx from "clsx"; export default function App() { const err = useSelector(state => state?.error.msg); + const isMobile = useSelector(state => state?.window.isMobile); + const className = clsx('pb-1', isMobile ? 'mobile' : 'desktop'); return ( 'ZX Coder'}> -
+