Skip to content

Commit

Permalink
💄style: improve style
Browse files Browse the repository at this point in the history
  • Loading branch information
blinko-space committed Nov 12, 2024
1 parent 76c1868 commit 15ed70c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
12 changes: 7 additions & 5 deletions src/components/Common/MarkdownRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,27 +143,29 @@ export const MarkdownRender = observer(({ content = '', onChange }: { content?:
code: Code,
a: ({ node, children }) => <LinkPreview href={children} />,
li: ({ node, children }) => {
console.log({ children,content })
if (children?.[0]?.type == 'input') {
const text = children[2]?.trim() ?? children[1]?.trim()
if (children?.[0]?.props.checked) {
return <div className='!ml-[-18px] flex items-center gap-1 cursor-pointer hover:opacity-80'
onClick={() => {
onChange?.(content!.replace(`* [x] ${children[2]}`, `* [ ] ${children[2]}`).replace(`- [x] ${children[2]}`, `- [ ] ${children[2]}`))
onChange?.(content!.replace(`* [x] ${text}`, `* [ ] ${text}`).replace(`- [x] ${text}`, `- [ ] ${text}`))
}}>
<div className='w-[20px] h-[20px]'>
<Icon className='text-[#EAB308]' icon="lets-icons:check-fill" width="20" height="20" />
</div>
<div className='line-through text-desc'>{children[2]}</div>
<div className='line-through text-desc'>{text}</div>
</div>
}
return <div className='!ml-[-18px] flex items-center gap-1 cursor-pointer hover:opacity-80'
onClick={() => {
console.log(`* [ ] ${children[2]}`)
onChange?.(content!.replace(`* [ ] ${children[2]}`, `* [x] ${children[2]}`).replace(`- [ ] ${children[2]}`, `- [x] ${children[2]}`))
console.log(`* [ ] ${text}`)
onChange?.(content!.replace(`* [ ] ${text}`, `* [x] ${text}`).replace(`- [ ] ${text}`, `- [x] ${text}`))
}}>
<div className='w-[20px] h-[20px]'>
<Icon className='text-[#EAB308]' icon="ci:radio-unchecked" width="20" height="20" />
</div>
<div>{children[2]}</div>
<div>{text}</div>
</div>
}
return <li >{children}</li>
Expand Down
13 changes: 6 additions & 7 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,13 @@ export const CommonLayout = observer(({

const SideBarContent = (
<div className="flex h-full w-[288px] flex-1 flex-col p-4 relative bg-background">
<div className="absolute inset-0 z-[-1] h-[250px] w-[250px] overflow-hidden blur-3xl ">
<div className="w-full h-[100%] bg-[#ffc65c] opacity-20"
style={{ "clipPath": "circle(35% at 50% 50%)" }} />
</div>

<div className="flex items-center gap-2 px-2 select-none w-full">
<div className="flex items-center gap-2 px-2 select-none w-full ">
{
theme == 'dark' ? <Image src="/logo-dark.svg" width={100} /> : <Image src="/logo.svg" width={100} />
}
<BlinkoNewVersion />
</div>
<ScrollShadow className="-mr-[16px] mt-[-5px] h-full max-h-full pr-6">
<ScrollShadow className="-mr-[16px] mt-[-5px] h-full max-h-full pr-6 ">
<div>
<div className="flex flex-col gap-1 mt-4 font-semibold">
{
Expand All @@ -96,6 +91,10 @@ export const CommonLayout = observer(({
</div>
</div>
</ScrollShadow>
<div className="absolute inset-0 h-[250px] w-[250px] overflow-hidden blur-3xl z-[0] pointer-events-none">
<div className="w-full h-[100%] bg-[#ffc65c] opacity-20"
style={{ "clipPath": "circle(35% at 50% 50%)" }} />
</div>
</div>
);

Expand Down
6 changes: 3 additions & 3 deletions src/pages/review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const App = observer(() => {
</Button>
</Tooltip>

<Tooltip content={t('archive')} onClick={async e => {
<Tooltip content={t('archive')} >
<Button onClick={async e => {
if (!store.currentNote) return
await blinko.upsertNote.call({ id: store.currentNote.id, isArchived: true })
await blinko.dailyReviewNoteList.call()
}}>
<Button isIconOnly color='primary' startContent={<Icon icon="eva:archive-outline" width="20" height="20" />}></Button>
}} isIconOnly color='primary' startContent={<Icon icon="eva:archive-outline" width="20" height="20" />}></Button>
</Tooltip>

<Button
Expand Down
2 changes: 1 addition & 1 deletion src/server/routers/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const noteRouter = router({
))
.query(async function () {
return await prisma.notes.findMany({
where: { createdAt: { gt: new Date(new Date().getTime() - 24 * 60 * 60 * 1000) }, isReviewed: false },
where: { createdAt: { gt: new Date(new Date().getTime() - 24 * 60 * 60 * 1000) }, isReviewed: false, isArchived: false },
orderBy: { id: 'desc' },
include: { attachments: true }
})
Expand Down
6 changes: 6 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ body {
}
}

.swiper-3d .swiper-slide-shadow{
background: var(--swiper-3d-shadow)!important;
}


@layer base {
:root {
--swiper-3d-shadow: rgba(0,0,0,.15);
--background: hsl(0 0% 100%);
--foreground: hsl(222.2 47.4% 11.2%);
--sencondbackground: #f8f8f8;
Expand Down Expand Up @@ -152,6 +157,7 @@ body {
}

.dark {
--swiper-3d-shadow: rgb(241 241 241 / 15%);
--background: #0B0B0C;
--foreground: #E1E1E1;
--sencondbackground: #1C1C1E;
Expand Down

0 comments on commit 15ed70c

Please sign in to comment.