Auto config fonts

This commit is contained in:
n4ze3m 2024-04-27 23:32:47 +05:30
parent 0173a7fdbb
commit ca1a6e9b1a
7 changed files with 40 additions and 15 deletions

BIN
src/assets/inter.ttf Normal file

Binary file not shown.

View File

@ -1,9 +1,19 @@
@font-face { @font-face {
font-family: "font"; font-family: "Inter";
src: url("font.ttf") format("truetype"); src: url("inter.ttf") format("truetype");
} }
* {
font-family: "font" !important; @font-face {
font-family: "Onest";
src: url("onest.ttf") format("truetype");
}
.inter {
font-family: "Inter", sans-serif !important;
}
.onest {
font-family: "Onest", sans-serif !important;
} }
@tailwind base; @tailwind base;
@ -62,6 +72,6 @@
/* Hide scrollbar for IE, Edge and Firefox */ /* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar { .no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */ -ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */ scrollbar-width: none; /* Firefox */
} }

View File

@ -11,13 +11,16 @@ import { PageAssistProvider } from "@/components/Common/PageAssistProvider"
function IndexOption() { function IndexOption() {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { t } = useTranslation() const { t, i18n } = useTranslation()
return ( return (
<MemoryRouter> <MemoryRouter>
<ConfigProvider <ConfigProvider
theme={{ theme={{
algorithm: algorithm:
mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
fontFamily: i18n.language === "ru" ? "Onest" : "Inter"
}
}} }}
renderEmpty={() => ( renderEmpty={() => (
<Empty <Empty

View File

@ -11,14 +11,17 @@ import { PageAssistProvider } from "@/components/Common/PageAssistProvider"
function IndexSidepanel() { function IndexSidepanel() {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { t } = useTranslation() const { t, i18n } = useTranslation()
return ( return (
<MemoryRouter> <MemoryRouter>
<ConfigProvider <ConfigProvider
theme={{ theme={{
algorithm: algorithm:
mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
fontFamily: i18n.language === "ru" ? "Onest" : "Inter"
}
}} }}
renderEmpty={() => ( renderEmpty={() => (
<Empty <Empty

View File

@ -10,12 +10,17 @@ import { OptionSettings } from "./option-settings"
import { OptionShare } from "./option-settings-share" import { OptionShare } from "./option-settings-share"
import { OptionKnowledgeBase } from "./option-settings-knowledge" import { OptionKnowledgeBase } from "./option-settings-knowledge"
import { OptionAbout } from "./option-settings-about" import { OptionAbout } from "./option-settings-about"
import { useTranslation } from "react-i18next"
export const OptionRouting = () => { export const OptionRouting = () => {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { i18n } = useTranslation()
return ( return (
<div className={mode === "dark" ? "dark" : "light"}> <div
className={`${mode === "dark" ? "dark" : "light"} ${
i18n.language === "ru" ? "onest" : "inter"
}`}>
<Routes> <Routes>
<Route path="/" element={<OptionIndex />} /> <Route path="/" element={<OptionIndex />} />
<Route path="/settings" element={<OptionSettings />} /> <Route path="/settings" element={<OptionSettings />} />
@ -32,9 +37,13 @@ export const OptionRouting = () => {
export const SidepanelRouting = () => { export const SidepanelRouting = () => {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { i18n } = useTranslation()
return ( return (
<div className={mode === "dark" ? "dark" : "light"}> <div
className={`${mode === "dark" ? "dark" : "light"} ${
i18n.language === "ru" ? "onest" : "inter"
}`}>
<Routes> <Routes>
<Route path="/" element={<SidepanelChat />} /> <Route path="/" element={<SidepanelChat />} />
<Route path="/settings" element={<SidepanelSettings />} /> <Route path="/settings" element={<SidepanelSettings />} />

View File

@ -24,7 +24,7 @@ export default defineConfig({
srcDir: "src", srcDir: "src",
outDir: "build", outDir: "build",
manifest: { manifest: {
version: "1.1.4", version: "1.1.5",
name: '__MSG_extName__', name: '__MSG_extName__',
description: '__MSG_extDescription__', description: '__MSG_extDescription__',
default_locale: 'en', default_locale: 'en',