Skip to content

Commit

Permalink
feat: 已读章节半透明
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Jul 12, 2024
1 parent c4783cc commit d406f4e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/web/src/pages/common/chapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function useChapter() {
const rows = res?.data || [];
historys.value = rows;
if (rows.length && rows[0].chapterPath) {
chaptersRef.value?.querySelector(`[data-url="${rows[0].chapterPath}"]`)?.scrollIntoView({ behavior: 'instant' });
chaptersRef.value?.querySelector(`[data-url="${rows[0].chapterPath}"]`)?.scrollIntoView({ behavior: 'smooth' });
}
}

Expand Down
6 changes: 5 additions & 1 deletion packages/web/src/pages/pc/chapter/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
v-for="item in list"
:key="item.url"
class="w-full text-[--foreground] h-32 lh-32 hover:bg-[--ar-color-primary-bg] hover:text-[--ar-color-primary-text] cursor-pointer px-8 overflow-hidden whitespace-nowrap text-ellipsis rounded-2"
:class="{
'op-70': !!findHistory(item)
}"
:data-url="item.chapterPath"
@click="showContent(item)"
>
{{ item.name }}
Expand All @@ -20,5 +24,5 @@
<script setup>
import { useChapter } from '@/pages/common/chapter';
const { chaptersRef, showContent, loading, list } = useChapter();
const { chaptersRef, showContent, loading, list, findHistory } = useChapter();
</script>
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"paths": {
"@any-reader/rule-utils": ["./packages/rule-utils/src/index.ts"],
"@any-reader/core": ["./packages/core/src/index.ts"],
"@any-reader/epub": ["./packages/epub/src/index.ts"],
"@any-reader/shared": ["./packages/shared/src/index.ts"]
// "@any-reader/rule-utils": ["./packages/rule-utils/src/index.ts"],
// "@any-reader/core": ["./packages/core/src/index.ts"],
// "@any-reader/epub": ["./packages/epub/src/index.ts"],
// "@any-reader/shared": ["./packages/shared/src/index.ts"]
}
}
}

0 comments on commit d406f4e

Please sign in to comment.