Skip to content

Commit

Permalink
feat(presenter): adding a third presenter view layout. (#1980)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <github@antfu.me>
  • Loading branch information
krisajenkins and antfu authored Dec 16, 2024
1 parent bfba5d6 commit 27e9e74
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/client/internals/NavControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if (__SLIDEV_FEATURE_RECORD__)
<div class="i-carbon:text-annotation-toggle" />
</IconButton>

<IconButton v-if="isPresenter" title="Toggle Presenter Layout" class="aspect-ratio-initial" @click="togglePresenterLayout">
<IconButton v-if="isPresenter" title="Toggle Presenter Layout" class="aspect-ratio-initial flex items-center" @click="togglePresenterLayout">
<div class="i-carbon:template" />
{{ presenterLayout }}
</IconButton>
Expand Down
9 changes: 9 additions & 0 deletions packages/client/pages/presenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ onMounted(() => {
'bottom bottom';
}
.grid-container.layout3 {
grid-template-columns: 2fr 3fr;
grid-template-rows: 1fr 1fr min-content;
grid-template-areas:
'note next'
'main next'
'bottom bottom';
}
@media (max-aspect-ratio: 3/5) {
.grid-container.layout1 {
grid-template-columns: 1fr;
Expand Down
2 changes: 1 addition & 1 deletion packages/client/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const presenterLayout = useLocalStorage('slidev-presenter-layout', 1, { l

export function togglePresenterLayout() {
presenterLayout.value = presenterLayout.value + 1
if (presenterLayout.value > 2)
if (presenterLayout.value > 3)
presenterLayout.value = 1
}

Expand Down

0 comments on commit 27e9e74

Please sign in to comment.