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-family: "font";
src: url("font.ttf") format("truetype");
font-family: "Inter";
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;
@ -47,7 +57,7 @@
@keyframes animatedgradient {
0% {
background-position: 0% 50%;
}
}
50% {
background-position: 100% 50%;
}
@ -62,6 +72,6 @@
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

View File

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

View File

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

View File

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

View File

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