Skip to content

Commit

Permalink
适配长推文,调整列表边距
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Chef committed Jul 20, 2023
1 parent 8dba7f6 commit 538f18c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
25 changes: 16 additions & 9 deletions src/content-script/site-adapters/followin/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ import { cropText } from '../../../utils'
export default {
inputQuery: async () => {
try {
const title = document.querySelector('main article h1')?.textContent
const description = document.querySelector('#article-content')?.textContent
if (title && description) {
const author = document.querySelector('main article a > span')?.textContent
return await cropText(
`以下是一篇文章,标题是:"${title}",作者是:"${author}",内容是:\n"${description}".请以如下格式输出你的回答:
======
{文章摘要}
const author = document.querySelector('main article a > span')?.textContent
const description =
document.querySelector('#article-content')?.textContent ||
document.querySelector('#thead-gallery')?.textContent
if (author && description) {
const title = document.querySelector('main article h1')?.textContent
if (title) {
return await cropText(
`以下是一篇文章,请给出文章的结论和3到5个要点.标题是:"${title}",作者是:"${author}",内容是:\n"${description}".
`,
)
)
} else {
return await cropText(
`以下是一篇长推文,请给出文章的结论和3到5个要点.作者是:"${author}",内容是:\n"${description}".
`,
)
}
}
} catch (e) {
console.log(e)
Expand Down
2 changes: 1 addition & 1 deletion src/content-script/site-adapters/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,6 @@ export const config = {
inputQuery: followin.inputQuery,
sidebarContainerQuery: [],
appendContainerQuery: [],
resultsContainerQuery: ['#article-content'],
resultsContainerQuery: ['#article-content', '#thead-gallery'],
},
}
11 changes: 11 additions & 0 deletions src/content-script/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

[data-theme='auto'] {
@import 'github-markdown-css/github-markdown.css';

@media screen and (prefers-color-scheme: dark) {
@import 'highlight.js/scss/github-dark.scss';
--font-color: #c9d1d9;
Expand All @@ -13,6 +14,7 @@
--color-neutral-muted: rgba(110, 118, 129, 0.4);
--code-background-color: rgb(13, 17, 23);
}

@media screen and (prefers-color-scheme: light) {
@import 'highlight.js/scss/github.scss';
--font-color: #24292f;
Expand Down Expand Up @@ -98,26 +100,32 @@
background-color: var(--theme-color);
width: 9px;
}

::-webkit-scrollbar-thumb {
background-color: var(--theme-border-color);
border-radius: 20px;
border: transparent;
}

::-webkit-scrollbar-corner {
background: transparent;
}

&::-webkit-scrollbar {
background-color: var(--theme-color);
width: 9px;
}

&::-webkit-scrollbar-thumb {
background-color: var(--theme-border-color);
border-radius: 20px;
border: transparent;
}

&::-webkit-scrollbar-corner {
background: transparent;
}

p {
color: var(--font-color);
}
Expand All @@ -133,6 +141,7 @@

li {
counter-increment: item;
margin-bottom: 0px;

&::marker {
content: counter(item) '. ';
Expand Down Expand Up @@ -288,11 +297,13 @@
background-color: var(--theme-color);
width: 9px;
}

&::-webkit-scrollbar-thumb {
background-color: var(--theme-border-color);
border-radius: 20px;
border: transparent;
}

&::-webkit-scrollbar-corner {
background: transparent;
}
Expand Down

0 comments on commit 538f18c

Please sign in to comment.