Skip to content

Commit

Permalink
feat: styles
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Apr 13, 2024
1 parent 7799bd4 commit 70849f3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/renderer/src/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ body, #root {
@apply h-screen;
@apply text-zinc-700;
@apply cursor-default;
@apply select-none;

font-family: 'SNPro', sans-serif;
}
Expand Down
16 changes: 6 additions & 10 deletions src/renderer/src/components/feed-list.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { useFeeds } from '@renderer/lib/feeds'
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger
} from '@renderer/components/ui/collapsible'
import { m, AnimatePresence, useSpring } from 'framer-motion'
import { Collapsible, CollapsibleTrigger } from '@renderer/components/ui/collapsible'
import { m, AnimatePresence } from 'framer-motion'
import { useState } from 'react'

export function FeedList({ type }: { type: string }) {
Expand All @@ -20,7 +16,7 @@ export function FeedList({ type }: { type: string }) {
console.log('categories', categories)

return (
<div className="w-80 px-4">
<div className="w-64 px-5">
<div className="font-bold my-2">{type}</div>
{Object.keys(categories).map((category) => (
<FeedCategory key={category} name={category} list={categories[category]} />
Expand All @@ -37,9 +33,9 @@ function FeedCategory({ name, list }: { name: string; list: any[] }) {
open={open}
onOpenChange={(o) => setOpen(o)}
>
<CollapsibleTrigger className="flex items-center text-[15px] font-medium leading-loose py-[1px] w-full [&>i]:data-[state=open]:rotate-90">
<CollapsibleTrigger className="flex items-center text-sm font-medium leading-loose py-[2px] w-full [&>i]:data-[state=open]:rotate-90">
<i className="i-mingcute-right-fill mr-2 transition-transform" />
<span>{name}</span>
<span className='truncate'>{name}</span>
</CollapsibleTrigger>
<AnimatePresence>
{open && (
Expand Down Expand Up @@ -73,7 +69,7 @@ function FeedCategory({ name, list }: { name: string; list: any[] }) {
src={`https://icons.duckduckgo.com/ip3/${new URL(feed.site_url).host}.ico`}
className="w-4 h-4 mr-2 rounded-sm"
/>
<div>{feed.title}</div>
<div className='truncate'>{feed.title}</div>
</div>
))}
</m.div>
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/src/components/type-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const items = [
{
name: 'Articles',
icon: <i className="i-mingcute-news-fill" />,
className: 'text-indigo-600'
className: 'text-amber-700'
},
{
name: 'Social Media',
Expand Down Expand Up @@ -56,7 +56,7 @@ export function TypeTab() {
})

useEffect(() => {
spring.set(-active * 320)
spring.set(-active * 256)
}, [active])

useWheel(({ event, last, memo: wait = false, direction: [dx], delta: [dex] }) => {
Expand All @@ -81,11 +81,11 @@ export function TypeTab() {

return (
<TooltipProvider delayDuration={300}>
<div className="flex text-zinc-500 w-full justify-around text-xl my-2">
<div className="flex text-zinc-500 w-full justify-between text-xl my-2 px-5">
{items.map((item, index) => (
<div
key={item.name}
className={cn(active === index && item.className)}
className={cn(active === index && "text-zinc-800")}
onClick={() => {
setActive(index)
}}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
"z-50 overflow-hidden rounded-md bg-stone-300 px-2 py-1 text-sm text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TypeTab } from '@renderer/components/type-tab'
export function Component() {
return (
<div className="flex h-full">
<div className="w-80 pt-10 border-r shrink-0 flex flex-col bg-[#E1E1E1]">
<div className="w-64 pt-10 border-r shrink-0 flex flex-col bg-[#E1E1E1]">
<TypeTab />
</div>
<div className="w-80 pt-10 px-5 border-r shrink-0">Two</div>
Expand Down

0 comments on commit 70849f3

Please sign in to comment.