-
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.
- Loading branch information
Showing
12 changed files
with
193 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
ScrollAreaCorner, | ||
ScrollAreaRoot, | ||
type ScrollAreaRootProps, | ||
ScrollAreaViewport, | ||
} from 'radix-vue' | ||
import ScrollBar from './ScrollBar.vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ScrollAreaRoot v-bind="delegatedProps" :class="cn('relative overflow-hidden', props.class)"> | ||
<ScrollAreaViewport class="h-full w-full rounded-[inherit]"> | ||
<slot /> | ||
</ScrollAreaViewport> | ||
<ScrollBar /> | ||
<ScrollAreaCorner /> | ||
</ScrollAreaRoot> | ||
</template> |
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,30 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes['class'] }>(), { | ||
orientation: 'vertical', | ||
}) | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ScrollAreaScrollbar | ||
v-bind="delegatedProps" | ||
:class=" | ||
cn('flex touch-none select-none transition-colors', | ||
orientation === 'vertical' | ||
&& 'h-full w-2.5 border-l border-l-transparent p-px', | ||
orientation === 'horizontal' | ||
&& 'h-2.5 flex-col border-t border-t-transparent p-px', | ||
props.class)" | ||
> | ||
<ScrollAreaThumb class="relative flex-1 rounded-full bg-border" /> | ||
</ScrollAreaScrollbar> | ||
</template> |
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,2 @@ | ||
export { default as ScrollArea } from './ScrollArea.vue' | ||
export { default as ScrollBar } from './ScrollBar.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 @@ | ||
<script setup lang="ts"> | ||
import {sumToImageUrl} from "~/utils/api"; | ||
import {Collapsible} from "~/components/ui/collapsible"; | ||
import {Badge} from "~/components/ui/badge"; | ||
const {episode} = defineProps<{ | ||
episode: any, | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<Collapsible> | ||
<div id="main" class="flex items-center cursor-pointer" @click="navigateTo(`/webtoon/${episode.id}`)"> | ||
<NuxtImg :src="sumToImageUrl(episode.thumbnail)" loading="lazy" class="aspect-square h-20 sm:h-24 md:h-28 xl:h-32"/> | ||
<div id="infos" class="flex items-center w-full justify-between px-2 h-20 sm:h-24 md:h-28 xl:h-32"> | ||
<div id="text-infos" class="flex flex-col justify-between gap-auto h-full py-1 sm:py-2"> | ||
<div class="flex flex-col gap-0 md:gap-1 lg:gap-2"> | ||
<div id="title" class="flex flex-row gap-2"> | ||
<div v-if="episode.isNew" class="flex items-center"> | ||
<Badge v-if="episode.isNew" variant="default">New</Badge> | ||
</div> | ||
<h4 class="whitespace-nowrap truncate max-w-64">{{ episode.title }}</h4> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</Collapsible> | ||
</template> | ||
|
||
<style scoped> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script setup lang="ts"> | ||
import {ref, onMounted} from "vue"; | ||
import {getEpisodes} from "~/utils/api"; | ||
import EpisodeItem from "~/components/webtoons/episodes/EpisodeItem.vue"; | ||
const episodes = ref<any[]>([]); | ||
const id = useRoute().params.id as any as number; | ||
onMounted(async() => { | ||
const response = await getEpisodes(id); | ||
episodes.value = response.data; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="h-full w-full md:w-3/4 lg:w-1/2 2xl:w-1/3 border-x-[1px]"> | ||
<div id="content" class="h-full overflow-y-scroll"> | ||
<div v-for="episode in episodes" :key="episode.id"> | ||
<Separator/> | ||
<EpisodeItem :episode="episode"/> | ||
</div> | ||
<Separator/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script setup lang="ts"> | ||
import * as apiurlMiddleware from "~/middleware/apiurl.middleware"; | ||
import EpisodeList from "~/components/webtoons/episodes/EpisodeList.vue"; | ||
definePageMeta({ | ||
middleware: [ | ||
apiurlMiddleware.default | ||
], | ||
layout: "nav-layout" | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="flex justify-center h-[calc(theme(height.dvh)-70px)]"> | ||
<EpisodeList/> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</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