-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:8aka-Team/NitWikit-VitePress
- Loading branch information
Showing
15 changed files
with
862 additions
and
14 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
35 changes: 35 additions & 0 deletions
35
.vitepress/theme/components/nitwikit-ui/packages/bili-player/bili-player.vue
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,35 @@ | ||
<template> | ||
<div class="bili-player"> | ||
<iframe class="bili-player__inner" :src="iframeSrc" scrolling="no" border="0" frameborder="no" framespacing="0" | ||
allowfullscreen="true"></iframe> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, onMounted, ref } from 'vue' | ||
const props = withDefaults(defineProps<NwImageProps>(), { | ||
}); | ||
const iframeSrc = computed(() => `//player.bilibili.com/player.html?isOutside=true&bvid=${props.bvId}&autoPlay=false`); | ||
</script> | ||
|
||
<script lang="ts"> | ||
interface NwImageProps { | ||
title: string; | ||
src: string; | ||
bvId: string; | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.bili-player { | ||
width: 100%; | ||
height: 400px; | ||
&__inner { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
.vitepress/theme/components/nitwikit-ui/packages/bili-player/index.ts
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,3 @@ | ||
import $BiliPlayer from "./bili-player.vue"; | ||
|
||
export const BiliPlayer = $BiliPlayer; |
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
16 changes: 16 additions & 0 deletions
16
.vitepress/theme/components/nitwikit-ui/packages/image-viewer/image-viewer.vue
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,16 @@ | ||
<script lang="ts" setup> | ||
import { onActivated, onMounted, onBeforeUnmount, ref } from 'vue' | ||
import Viewer from 'viewerjs'; | ||
import 'viewerjs/dist/viewer.css' | ||
const instance = ref() | ||
onMounted(() => { | ||
instance.value = new Viewer(document.querySelector('.vp-doc')); | ||
}) | ||
onBeforeUnmount(() => { | ||
instance.value?.destroy() | ||
}) | ||
</script> |
3 changes: 3 additions & 0 deletions
3
.vitepress/theme/components/nitwikit-ui/packages/image-viewer/index.ts
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,3 @@ | ||
import $NwImageViewer from "./image-viewer.vue"; | ||
|
||
export const NwImageViewer = $NwImageViewer; |
31 changes: 31 additions & 0 deletions
31
.vitepress/theme/components/nitwikit-ui/packages/image/image.vue
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,31 @@ | ||
<template> | ||
<div class="nw-image"> | ||
<img class="nw-image__inner" ref="nwImageRef" :src="props.src" :alt="props.alt" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, onMounted, ref } from 'vue' | ||
import { withBase } from 'vitepress' | ||
import Viewer from 'viewerjs'; | ||
import 'viewerjs/dist/viewer.css' | ||
const props = withDefaults(defineProps<NwImageProps>(), { | ||
}); | ||
const nwImageRef = ref<HTMLImageElement | null>(null); | ||
onMounted(() => { | ||
const viewer = new Viewer(nwImageRef.value); | ||
}) | ||
</script> | ||
|
||
<script lang="ts"> | ||
interface NwImageProps { | ||
src: string; | ||
alt: string; | ||
} | ||
</script> | ||
|
||
<style lang="scss"></style> |
3 changes: 3 additions & 0 deletions
3
.vitepress/theme/components/nitwikit-ui/packages/image/index.ts
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,3 @@ | ||
import $NwImage from "./image.vue"; | ||
|
||
export const NwImage = $NwImage; |
Oops, something went wrong.