-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<script setup lang="ts"> | ||
import { useVModel } from '@vueuse/core' | ||
import { skipExportPdfTip } from '../state' | ||
import Modal from './Modal.vue' | ||
const props = defineProps({ | ||
modelValue: { | ||
default: false, | ||
}, | ||
}) | ||
const emit = defineEmits(['update:modelValue']) | ||
const value = useVModel(props, 'modelValue', emit) | ||
function print() { | ||
value.value = false | ||
setTimeout(window.print, 100) | ||
} | ||
</script> | ||
|
||
<template> | ||
<Modal v-model="value" class="px-6 py-4 flex flex-col gap-2"> | ||
<div class="flex gap-2 text-xl"> | ||
<div class="i-carbon:information my-auto" />Tips | ||
</div> | ||
<div> | ||
Slidev will open your browser's built-in print dialog to export the slides as PDF. <br> | ||
To export the slides correctly, please: | ||
<ul class="list-disc my-4 pl-4"> | ||
<li> Choose "Save to PDF" as the Destination. </li> | ||
<li> Choose "Default" as the Margin. </li> | ||
<li> Toggle on "Print backgrounds". </li> | ||
</ul> | ||
<div class="mb-2 op-70 text-sm"> | ||
If you're encountering problems, please try the CLI or open an issue on GitHub. | ||
</div> | ||
<div class="form-check op-70"> | ||
<input | ||
v-model="skipExportPdfTip" | ||
name="record-camera" | ||
type="checkbox" | ||
> | ||
<label for="record-camera" @click="skipExportPdfTip = !skipExportPdfTip">Don't show this dialog next time.</label> | ||
</div> | ||
</div> | ||
<div class="flex my-1"> | ||
<button class="cancel" @click="value = false"> | ||
Cancel | ||
</button> | ||
<div class="flex-auto" /> | ||
<button @click="print"> | ||
Start | ||
</button> | ||
</div> | ||
</Modal> | ||
</template> | ||
|
||
<style scoped> | ||
button { | ||
@apply bg-blue-400 text-white px-4 py-1 rounded border-b-2 border-blue-600; | ||
@apply hover:(bg-blue-500 border-blue-700); | ||
} | ||
button.cancel { | ||
@apply bg-gray-400 bg-opacity-50 text-white px-4 py-1 rounded border-b-2 border-main; | ||
@apply hover:(bg-opacity-75 border-opacity-75); | ||
} | ||
.form-check { | ||
@apply leading-5; | ||
* { | ||
@apply my-auto align-middle; | ||
} | ||
label { | ||
@apply ml-1 text-sm select-none; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters