Skip to content

Commit

Permalink
feat(watchtime): small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
veryCrunchy committed May 9, 2024
1 parent e63e080 commit ea0d653
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/WatchTime.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<script setup>
<script setup lang="ts">
const props = defineProps({
all: { type: Boolean, required: false, default: false },
});
const title = props.all ? "top viewers all time" : "top viewers this month";
const watchtime = (await GqlGetWatchtime({ limit: 100 })).watchtime;
let watchtime: {
avatar?: string | null | undefined;
displayName: string;
time: number;
}[];
try {
watchtime = (await GqlGetWatchtime({ limit: 100 })).watchtime;
} catch {
//
}
const scrollContainer = ref();
const fadeThing = ref();
const handleScroll = (s, q) => {
const handleScroll = () => {
console.log(scrollContainer.value.scrollTop);
if (scrollContainer.value.scrollTop > 10) {
fadeThing.value.style.opacity = "1";
Expand All @@ -19,6 +27,7 @@ const handleScroll = (s, q) => {

<template>
<div
v-if="watchtime"
class="flex relative flex-col h-full max-h-5xl p-6 pt-18 pb-2 justify-between bg-secondary rounded-xl"
>
<div class="absolute top-6 left-0 flex w-full justify-center items-center">
Expand Down

0 comments on commit ea0d653

Please sign in to comment.