update(journalList): 摘要 2 行溢出

mack-mac
mackt 7 months ago
parent 244839c383
commit c31d883486

@ -72,7 +72,7 @@ export default async function About() {
<br /> <br />
<p className="mt-[9px] text-[15px] leading-[24px]"> <p className="mt-[9px] text-[15px] leading-[24px]">
&nbsp; &nbsp;
<span className="text-[#C43737]">indier</span> <span className="text-brand">indier</span>
&nbsp; <br /> &nbsp; <br />
</p> </p>

@ -7,6 +7,7 @@
:root { :root {
--body-bg-color: #fff; --body-bg-color: #fff;
--primary-color: #c43737;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {

@ -1,6 +1,6 @@
import Link from 'next/link'; import Link from 'next/link';
import { Avatar, JournalCard, ButtonCollect } from '@/components'; import { Avatar, VolListCoverCard, ButtonCollect } from '@/components';
export default function JournalItem({ export default function JournalItem({
journalNo, journalNo,
@ -16,12 +16,16 @@ export default function JournalItem({
return ( return (
<div className="flex flex-col w-[712px] rounded-[6px] bg-base "> <div className="flex flex-col w-[712px] rounded-[6px] bg-base ">
<Link href={`/vol/${journalNo}`}> <Link href={`/vol/${journalNo}`}>
<JournalCard showPlay image={image} title={title} journalNo={journalNo} className="cursor-pointer" /> <VolListCoverCard img={image} title={title} no={journalNo} />
</Link> </Link>
{/* 摘要 */} {/* 摘要 */}
<p className="w-full mt-[15px] mb-[12px] text-[17px] leading-[23.8px] text-base cursor-pointer overflow-hidden whitespace-nowrap truncate"> <Link href={`/vol/${journalNo}`}>
<p className="w-full mt-[15px] mb-[12px] text-[17px] leading-[24px] text-base cursor-pointer text-overflow-2">
{summary} {summary}
</p> </p>
</Link>
{/* 精选评论 */} {/* 精选评论 */}
{!!commentList.length && ( {!!commentList.length && (
<div className="flex flex-row mb-[24px]"> <div className="flex flex-row mb-[24px]">

@ -2,19 +2,9 @@ import styles from '../index.module.css';
import { JournalCard } from '@/components'; import { JournalCard } from '@/components';
export default function CoverCard({ export default function CoverCard({ title, img, no }: { title: string; img: string; no: string }) {
title,
img,
no,
}: {
title: string;
img: string;
no: string;
playStatus: boolean;
onPlay: () => void;
}) {
return ( return (
<JournalCard image={img} journalNo={no}> <JournalCard image={img} journalNo={no} className="cursor-pointer">
<div className={`absolute bottom-0 w-full h-[126px] ${styles.title_background}`}> <div className={`absolute bottom-0 w-full h-[126px] ${styles.title_background}`}>
<p className="absolute bottom-[23px] left-[23px] text-[#fff] text-[24px] leading-[33.6px]">{title}</p> <p className="absolute bottom-[23px] left-[23px] text-[#fff] text-[24px] leading-[33.6px]">{title}</p>
</div> </div>

@ -22,5 +22,5 @@
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "dist/types/**/*.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "dist/types/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules", "uno.config.css"]
} }

@ -1,6 +1,7 @@
import { defineConfig, presetUno, presetAttributify, presetIcons } from 'unocss'; import { defineConfig, presetUno, presetAttributify, presetIcons } from 'unocss';
import presetAnimations from 'unocss-preset-animations'; import presetAnimations from 'unocss-preset-animations';
import { presetShadcn } from 'unocss-preset-shadcn'; import { presetShadcn } from 'unocss-preset-shadcn';
import { colors } from 'unocss/preset-mini';
export default defineConfig({ export default defineConfig({
presets: [ presets: [
@ -16,9 +17,23 @@ export default defineConfig({
}), }),
], ],
rules: [['text-flow', { 'text-overflow': 'ellipsis', 'white-space': 'nowrap', overflow: 'hidden' }]], rules: [
['text-flow', { 'text-overflow': 'ellipsis', 'white-space': 'nowrap', overflow: 'hidden' }],
[
/^text-overflow-(\d+)$/,
([, d]) => ({
overflow: 'hidden',
'text-overflow': 'ellipsis',
display: '-webkit-box',
'-webkit-line-clamp': parseInt(d),
/* autoprefixer: ignore next */
'-webkit-box-orient': 'vertical',
}),
],
],
shortcuts: { shortcuts: [
{
'switch-animation': 'transition duration-300', 'switch-animation': 'transition duration-300',
'bg-base': 'bg-[#fff] dark:bg-[#20202a] switch-animation', 'bg-base': 'bg-[#fff] dark:bg-[#20202a] switch-animation',
'card-base': 'bg-[#ffffff] dark:bg-[#10101a] switch-animation', 'card-base': 'bg-[#ffffff] dark:bg-[#10101a] switch-animation',
@ -26,8 +41,15 @@ export default defineConfig({
'switch-label-base': 'bg-gray-200 dark:bg-gray-800 switch-animation', 'switch-label-base': 'bg-gray-200 dark:bg-gray-800 switch-animation',
'switch-span-base': 'bg-white dark:bg-gray-300 switch-animation', 'switch-span-base': 'bg-white dark:bg-gray-300 switch-animation',
'text-overflow': 'overflow-hidden whitespace-nowrap truncate', 'text-overflow': 'overflow-hidden whitespace-nowrap truncate',
'text-brand': 'text-[#C43737]', 'text-brand': 'text-brand',
'bg-brand': 'bg-[#C43737]', 'bg-brand': 'bg-brand',
'border-brand': 'border-[#C43737]', 'border-brand': 'border-brand',
},
],
theme: {
colors: {
brand: 'var(--primary-color)',
},
}, },
}); });

Loading…
Cancel
Save