Skip to content

Commit

Permalink
general fix
Browse files Browse the repository at this point in the history
  • Loading branch information
electh committed Jan 24, 2025
1 parent 88d71c7 commit 3833a3e
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import AddCategoryModal from "@/components/FeedList/components/AddCategoryModal.
import { useHotkeys } from "@/hooks/useHotkeys.js";
import SearchModal from "@/components/Search/SearchModal.jsx";
import LogoutModal from "@/components/FeedList/components/LogoutModal.jsx";
import AboutModal from "@/components/About/AboutModal.jsx";

function App() {
const { syncInterval } = useStore(settingsState);
Expand All @@ -39,6 +40,7 @@ function App() {
<AddCategoryModal />
<SearchModal />
<LogoutModal />
<AboutModal />
</SidebarProvider>
);
}
Expand Down
23 changes: 23 additions & 0 deletions src/components/About/AboutModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useTranslation } from "react-i18next";
import { useStore } from "@nanostores/react";
import { aboutModalOpen } from "@/stores/modalStore";
import { FancyLogo } from "@/components/About/FancyLogo.jsx";
import CustomModal from "@/components/ui/CustomModal.jsx";

export default function AboutModal() {
const { t } = useTranslation();
const $aboutModalOpen = useStore(aboutModalOpen);

return (
<CustomModal
open={$aboutModalOpen}
onOpenChange={() => aboutModalOpen.set(false)}
title={t("about.title")}
content={
<div className="px-4 pb-4 space-y-6">
<FancyLogo since="2025"/>
</div>
}
/>
);
}
45 changes: 45 additions & 0 deletions src/components/About/FancyLogo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { useRef } from "react";
import logo from "@/assets/logo.png";
import { Image } from "@heroui/react";

export const FancyLogo = ({ since }) => {
const boundingRef = useRef(null);

return (
<div className="flex flex-col [perspective:800px] p-5 bg-content2 rounded-md">
<div
onMouseLeave={() => {
boundingRef.current = null;
}}
onMouseEnter={(ev) => {
boundingRef.current = ev.currentTarget.getBoundingClientRect();
}}
onMouseMove={(ev) => {
if (!boundingRef.current) return;
const x = ev.clientX - boundingRef.current.left;
const y = ev.clientY - boundingRef.current.top;
const xPercentage = x / boundingRef.current.width;
const yPercentage = y / boundingRef.current.height;
const xRotation = (xPercentage - 0.5) * 20;
const yRotation = (0.5 - yPercentage) * 20;

ev.currentTarget.style.setProperty("--x-rotation", `${yRotation}deg`);
ev.currentTarget.style.setProperty("--y-rotation", `${xRotation}deg`);
ev.currentTarget.style.setProperty("--x", `${xPercentage * 100}%`);
ev.currentTarget.style.setProperty("--y", `${yPercentage * 100}%`);
}}
className="group relative w-full flex flex-col gap-6 py-6 items-center overflow-hidden rounded-md bg-gradient-to-b from-[#EAFFED] to-[#C6F7C9] p-4 text-[#01A977] transition-transform ease-out hover:[transform:rotateX(var(--x-rotation))_rotateY(var(--y-rotation))_scale(1.05)]"
>
<Image src={logo} alt="logo" classNames={{ wrapper: "size-24", image: "aspect-square" }} />
<footer className="flex items-end">
<span className="flex rounded-sm border border-current px-1 py-px text-xs uppercase">
NEXTFLUX{" "}
<span className="-my-px mx-1 inline-block w-4 border-l border-r border-current bg-[repeating-linear-gradient(-45deg,currentColor,currentColor_1px,transparent_1px,transparent_2px)]" />{" "}
{since}
</span>
</footer>
<div className="z-10 pointer-events-none absolute inset-0 group-hover:bg-[radial-gradient(at_var(--x)_var(--y),rgba(255,255,255,0.3)_20%,transparent_80%)]" />
</div>
</div>
);
};
2 changes: 1 addition & 1 deletion src/components/ArticleList/components/ArticleCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function ArticleCard({ article }) {
<Ripple
ripples={ripples}
onClear={onClear}
color="hsl(var(--nextui-content4))"
color="hsl(var(--heroui-content4))"
/>
<div
className={cn(
Expand Down
12 changes: 6 additions & 6 deletions src/components/ArticleView/ArticleView.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ p {
}

.line-numbers code .line::before {
color: hsl(var(--nextui-default-400));
color: hsl(var(--heroui-default-400));
content: counter(step);
counter-increment: step;
display: inline-block;
Expand Down Expand Up @@ -73,12 +73,12 @@ figcaption {
/*Plyr 自定义样式*/
.plyr {
--plyr-audio-border: none;
--plyr-audio-control-color: hsl(var(--nextui-content4-foreground));
--plyr-audio-controls-background: hsl(var(--nextui-content1));
--plyr-color-main: hsl(var(--nextui-primary));
--plyr-audio-control-color: hsl(var(--heroui-content4-foreground));
--plyr-audio-controls-background: hsl(var(--heroui-content1));
--plyr-color-main: hsl(var(--heroui-primary));
--plyr-tooltip-arrow-size: 0;
--plyr-tooltip-background: hsl(var(--nextui-content1));
--plyr-tooltip-color: hsl(var(--nextui-content1-foreground));
--plyr-tooltip-background: hsl(var(--heroui-content1));
--plyr-tooltip-color: hsl(var(--heroui-content1-foreground));
--plyr-tooltip-shadow: var(--shadow-custom);
}

Expand Down
14 changes: 13 additions & 1 deletion src/components/FeedList/components/ProfileButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import {
Cog,
ExternalLink,
Keyboard,
Info,
LogOut,
} from "lucide-react";
import { authState } from "@/stores/authStore.js";
import { settingsModalOpen } from "@/stores/settingsStore.js";
import { logoutModalOpen, shortcutsModalOpen } from "@/stores/modalStore.js";
import { logoutModalOpen, shortcutsModalOpen, aboutModalOpen } from "@/stores/modalStore.js";
import { useSidebar } from "@/components/ui/sidebar.jsx";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -47,6 +48,17 @@ export default function ProfileButton() {
</Button>
</DropdownTrigger>
<DropdownMenu aria-label="Profile Actions" variant="flat">
<DropdownItem
key="about"
textValue="about"
startContent={<Info className="size-4" />}
onPress={() => {
aboutModalOpen.set(true);
isMobile && setOpenMobile(false);
}}
>
{t("sidebar.profile.about")}
</DropdownItem>
<DropdownItem
key="settings"
textValue="settings"
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,7 @@ export default {
description500: "Internal server error",
backToHome: "Back to Home",
},
about: {
title: "About",
},
};
5 changes: 5 additions & 0 deletions src/i18n/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default {
categoryNameRequired: "请输入分类标题",
addFeed: "新增订阅",
profile: {
about: "关于",
settings: "设置",
openMiniflux: "访问 Miniflux",
logout: "注销",
Expand Down Expand Up @@ -259,4 +260,8 @@ export default {
description500: "系统发生错误",
backToHome: "返回主页",
},
about: {
title: "关于",
},
};

1 change: 1 addition & 0 deletions src/stores/modalStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export const renameModalOpen = atom(false);
export const addCategoryModalOpen = atom(false);
export const shortcutsModalOpen = atom(false);
export const logoutModalOpen = atom(false);
export const aboutModalOpen = atom(false);
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default {
},
},
pulse: {
"0%, 100%": { backgroundColor: "hsl(var(--nextui-content2))" },
"50%": { backgroundColor: "hsl(var(--nextui-content4))" },
"0%, 100%": { backgroundColor: "hsl(var(--heroui-content2))" },
"50%": { backgroundColor: "hsl(var(--heroui-content4))" },
},
},
animation: {
Expand Down

0 comments on commit 3833a3e

Please sign in to comment.