Skip to content

Commit

Permalink
fix: improve overview breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 26, 2021
1 parent 8c8dbcd commit 7b1ba0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/client/internals/SlidesOverview.vue
Expand Up @@ -22,15 +22,15 @@ function go(page: number) {
close()
}
const xs = breakpoints.smaller('xs')
const sm = breakpoints.smaller('sm')
const md = breakpoints.smaller('md')
const padding = 4 * 16 * 2
const gap = 2 * 16
const cardWidth = computed(() => {
if (sm.value)
if (xs.value)
return windowSize.width.value - padding
else if (md.value)
else if (sm.value)
return (windowSize.width.value - padding - gap) / 2
return 300
})
Expand Down
5 changes: 4 additions & 1 deletion packages/client/state/index.ts
Expand Up @@ -8,7 +8,10 @@ export const showInfoDialog = ref(false)
export const showGotoDialog = ref(false)

export const shortcutsEnabled = ref(true)
export const breakpoints = useBreakpoints(breakpointsTailwind)
export const breakpoints = useBreakpoints({
xs: 460,
...breakpointsTailwind,
})
export const windowSize = useWindowSize()
export const magicKeys = useMagicKeys()
export const isScreenVertical = computed(() => windowSize.height.value - windowSize.width.value / slideAspect > 180)
Expand Down

0 comments on commit 7b1ba0b

Please sign in to comment.