switch to fine and coarse media queries

This commit is contained in:
tresabhi committed 2026-11-20 23:41:12 -06:00
1 parent 68335de62c
commit ca28986730
8 files changed
+29 -35

No files matched your search

@@ -4,13 +4,12 @@ import { CaretUpIcon, GearIcon } from "@radix-ui/react-icons";
import { api } from "../api/dynamic";
import { Logo } from "../icons/Logo";
import { LinkI18nWrapper } from "./LinkI18nWrapper";
import type { Props as NavbarDesktopProps } from "./NavbarDesktop.astro";
import { filtered } from "./NavbarDesktop.astro";
import { filtered, type Props as NavbarFineProps } from "./NavbarFine.astro";
import NavbarMobileAutoHide from "./NavbarMobileAutoHide.astro";
import { Scroller, ScrollerOrientation } from "./Scroller";
import { Text } from "./Text";
export type Props = NavbarDesktopProps & {
export type Props = NavbarFineProps & {
solid?: boolean;
};
@@ -27,13 +26,13 @@ const strings = await api.strings(locale);
}
#navbar-mobile-spacer {
display: none;
flex-shrink: 0;
display: none;
height: calc(var(--icon-size) + 2 * var(--padding));
@media screen and (max-width: 80rem) {
display: block;
@media (pointer: coarse) {
display: flex;
}
}
@@ -59,7 +58,7 @@ const strings = await api.strings(locale);
flex-direction: column;
justify-content: flex-end;
@media screen and (max-width: 80rem) {
@media (pointer: coarse) {
display: flex;
}
@@ -27,8 +27,10 @@ export const filtered = Object.values(tools).filter(
--padding: var(--space-4);
--min-content-width: calc(var(--icon-size) + 2 * var(--padding));
@media screen and (max-width: 80rem) {
display: none;
display: none;
@media (pointer: fine) {
display: block;
}
width: var(--min-content-width);
@@ -10,10 +10,8 @@
height: 100%;
background-color: black;
border-radius: var(--space-4);
@media screen and (max-width: 80rem) {
border-radius: 0;
@media (pointer: fine) {
border-radius: var(--space-4);
}
}
}
@@ -7,7 +7,7 @@
display: none;
@media screen and (max-width: 80rem) {
@media (pointer: coarse) {
display: flex;
}
}
@@ -21,16 +21,13 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
--margin: var(--space-4);
flex: 1;
border-radius: var(--space-4);
overflow: hidden;
margin: var(--margin) var(--margin) 0 0;
background-size: cover;
@media screen and (max-width: 80rem) {
margin: 0;
border-radius: 0;
@media (pointer: fine) {
margin: var(--margin) var(--margin) 0 0;
border-radius: var(--space-4);
}
.content {
@@ -3,8 +3,8 @@ import BaseMeta from "../components/BaseMeta.astro";
import BaseStyles from "../components/BaseStyles.astro";
import ColorAlias from "../components/ColorAlias.astro";
import ColorScale from "../components/ColorScale.astro";
import NavbarDesktop from "../components/NavbarDesktop.astro";
import NavbarMobile from "../components/NavbarMobile.astro";
import NavbarCourse from "../components/NavbarCourse.astro";
import NavbarFine from "../components/NavbarFine.astro";
import SystemTheme from "../components/SystemTheme.astro";
import { tools } from "../constants/tools";
import type { LocaleAcceptorProps } from "../hooks/useLocale";
@@ -53,7 +53,11 @@ const tool = tools.tanks;
min-height: 100dvh;
display: flex;
flex-direction: row-reverse;
flex-direction: column;
@media (pointer: fine) {
flex-direction: row-reverse;
}
background-color: var(--gray-1);
color: var(--gray-12);
@@ -66,10 +70,6 @@ const tool = tools.tanks;
display: flex;
flex-direction: column;
}
@media screen and (max-width: 80rem) {
flex-direction: column;
}
}
</style>
</head>
@@ -79,7 +79,7 @@ const tool = tools.tanks;
<slot />
</main>
<NavbarDesktop {locale} {tool} />
<NavbarMobile {locale} {tool} solid={solidNavbar} />
<NavbarFine {locale} {tool} />
<NavbarCourse {locale} {tool} solid={solidNavbar} />
</body>
</html>
@@ -6,7 +6,7 @@
padding: var(--space-4);
padding-left: 0;
@media screen and (max-width: 80rem) {
@media (pointer: coarse) {
padding-left: var(--space-4);
}
@@ -7,10 +7,8 @@
.sandbox {
flex-grow: 1;
padding-top: var(--space-4);
@media screen and (max-width: 80rem) {
padding-top: 0;
@media (pointer: fine) {
padding-top: var(--space-4);
}
}
@@ -34,7 +32,7 @@
}
}
@media screen and (max-width: 80rem) {
@media (pointer: coarse) {
.sandbox,
.loadout {
&[data-tabbed="false"] {