diff --git a/fwt/components/Display.tsx b/fwt/components/Display.tsx new file mode 100644 index 0000000..3f78103 --- /dev/null +++ b/fwt/components/Display.tsx @@ -0,0 +1,41 @@ +import '../styles/Viewport.sass' +import { type JSXElement, Switch, Match } from 'solid-js' + +interface Props { + children: JSXElement + desktop?: boolean + tablet?: boolean + mobile?: boolean +} + +export default (props: Props) => { + return ( + <> + + +
{props.children}
+
+ + +
{props.children}
+
+ + +
{props.children}
+
+ + +
{props.children}
+
+ + +
{props.children}
+
+ + +
{props.children}
+
+
+ + ) +} diff --git a/fwt/index.ts b/fwt/index.ts index 3ef241e..df20152 100644 --- a/fwt/index.ts +++ b/fwt/index.ts @@ -12,6 +12,7 @@ export { default as Logo } from './components/Logo' export { default as Navbar } from './components/Navbar' export { default as Page } from './components/Page' export { default as Row } from './components/Row' +export { default as Display } from './components/Display' export { default as OptimizeBackground } from './Optimizers/OptimizeBackground' export { default as OptimizeImage } from './Optimizers/OptimizeImage' diff --git a/fwt/styles/Viewport.sass b/fwt/styles/Viewport.sass new file mode 100644 index 0000000..1e0b5bc --- /dev/null +++ b/fwt/styles/Viewport.sass @@ -0,0 +1 @@ +@use '/src/styles/classes.sass' diff --git a/src/styles/classes.sass b/src/styles/classes.sass index 6379690..81228b3 100644 --- a/src/styles/classes.sass +++ b/src/styles/classes.sass @@ -11,61 +11,49 @@ opacity: 1 .on-desktop-only - @media only screen and (max-width: view.$desktop) + @media only screen and (min-width: 0px) and (max-width: view.$desktop) + display: none + + @media only screen and (min-width: view.$desktop) display: block - @media only screen and (max-width: view.$tablet) - display: none - - @media only screen and (max-width: view.$mobile) - display: none - .on-tablet-only - @media only screen and (max-width: view.$desktop) + @media only screen and (min-width: 0px) and (max-width: view.$tablet) display: none - @media only screen and (max-width: view.$tablet) + @media only screen and (min-width: view.$tablet) and (max-width: view.$desktop) display: block - @media only screen and (max-width: view.$mobile) + @media only screen and (min-width: view.$desktop) display: none .on-mobile-only - @media only screen and (max-width: view.$desktop) - display: none - - @media only screen and (max-width: view.$tablet) - display: none - - @media only screen and (max-width: view.$mobile) + @media only screen and (min-width: view.$mobile) display: block + @media only screen and (min-width: view.$tablet) + display: none + .on-desktop-tablet-only - @media only screen and (max-width: view.$desktop) - display: block - - @media only screen and (max-width: view.$tablet) - display: block - - @media only screen and (max-width: view.$mobile) + @media only screen and (min-width: 0px) and (max-width: view.$tablet) display: none + @media only screen and (min-width: view.$tablet) + display: block + .on-desktop-mobile-only - @media only screen and (max-width: view.$desktop) + @media only screen and (min-width: 0px) and (max-width: view.$mobile) display: block - @media only screen and (max-width: view.$tablet) + @media only screen and (min-width: view.$mobile) and (max-width: view.$desktop) display: none - @media only screen and (max-width: view.$mobile) + @media only screen and (min-width: view.$desktop) display: block .on-tablet-mobile-only - @media only screen and (max-width: view.$desktop) + @media only screen and (min-width: 0px) and (max-width: view.$desktop) + display: block + + @media only screen and (min-width: view.$desktop) display: none - - @media only screen and (max-width: view.$tablet) - display: block - - @media only screen and (max-width: view.$mobile) - display: block