-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
12 changed files
with
99 additions
and
63 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
import { useWindowSize } from '@vueuse/core' | ||
import { reactive, computed } from 'vue' | ||
import { computed, ref } from 'vue' | ||
|
||
export const aspect = 16 / 9 | ||
export const targetWidth = 980 | ||
export const targetHeight = targetWidth / aspect | ||
|
||
const screen = reactive(useWindowSize()) | ||
const screenAspect = computed(() => screen.width / screen.height) | ||
export const offsetRight = ref(0) | ||
export const offsetBottom = ref(0) | ||
|
||
const { width: winWidth, height: winHeight } = useWindowSize() | ||
|
||
const width = computed(() => winWidth.value - offsetRight.value) | ||
const height = computed(() => winHeight.value - offsetBottom.value) | ||
const screenAspect = computed(() => width.value / height.value) | ||
|
||
export const scale = computed(() => { | ||
if (screenAspect.value < aspect) | ||
return screen.width / targetWidth | ||
return screen.height * aspect / targetWidth | ||
return width.value / targetWidth | ||
return height.value * aspect / targetWidth | ||
}) | ||
|
||
export const marginTop = computed(() => (screen.height - targetHeight * scale.value) / 2) | ||
export const marginLeft = computed(() => (screen.width - targetWidth * scale.value) / 2) | ||
export const marginTop = computed(() => (height.value - targetHeight * scale.value) / 2) | ||
export const marginLeft = computed(() => (width.value - targetWidth * scale.value) / 2) |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { useMagicKeys } from '@vueuse/core' | ||
import { ref } from 'vue' | ||
import { useActiveElement } from './use' | ||
import { useMagicKeys, useActiveElement } from '@vueuse/core' | ||
import { computed, ref } from 'vue' | ||
|
||
export const activeElement = useActiveElement() | ||
export const isInputing = computed(() => ['INPUT', 'TEXTAREA'].includes(activeElement.value?.tagName || '')) | ||
|
||
export const magicKeys = useMagicKeys() | ||
export const showOverview = ref(false) | ||
export const showEditor = ref(false) |
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.