Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cc500e2
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Jan 23, 2025
6719833
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Jan 23, 2025
b263e71
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Jan 23, 2025
807263d
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Feb 6, 2025
49cdcdf
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Feb 17, 2025
8fcd55a
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Feb 19, 2025
bf3cb3a
aaztk.vercel.app mdx.vercel.app fb.com/ztrabc
zawa8 Feb 19, 2025
2d0df37
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Feb 22, 2025
b375cbc
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 4, 2025
78a7a09
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 9, 2025
aee3ba5
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 9, 2025
3c034a5
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 10, 2025
89f9f6f
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 16, 2025
4cf9d32
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 16, 2025
b9cd5ab
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 16, 2025
cfcb9ca
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 16, 2025
6e0f1b3
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 19, 2025
a4d5aeb
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
269badf
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
c0e056e
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
e9d9282
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
b23aaf5
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
43eb000
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
650bdd7
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 22, 2025
a42d00f
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Mar 24, 2025
aa46da4
mck82.vercel.app zikis8.vercel.app fb.com/ztrabc
zawa8 Apr 7, 2025
67690cb
zawa8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 8, 2025
47dd282
zawa8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 13, 2025
37046ae
zawa8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 14, 2025
0c286c3
ztr8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 20, 2025
d79c793
zawa8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 20, 2025
cc743c9
ztr8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 20, 2025
c8aa80a
ztr8.vercel.app mck82.vercel.app fb.com/ztrabc x.com/etphor
zawa8 Apr 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env*.local

# vercel
Expand Down
18 changes: 11 additions & 7 deletions app/api/translate/route.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import { type NextRequest } from 'next/server'
const { Translate } = require('@google-cloud/translate').v2;

const translate = new Translate({ key: process.env.GOOGLE_TRANSLATE_API_KEY });

export async function POST(req: NextRequest) {
const { text, target } = await req.json()
// Translates the text into the target language. "text" can be a string for
// translating a single piece of text, or an array of strings for translating
// multiple texts.
// "text" can be a string or an array of strings for translating multiple texts.
let [translations] = await translate.translate(text, target);
translations = Array.isArray(translations) ? translations : [translations];
console.log('Translations:');
translations.forEach((translation: any, i: any) => {
console.log(`${text} => (${target}) ${translation}`);
});

return Response.json(translations)
}

//https://cloud.google.com/nodejs/docs/reference/translate/latest/translate/v2.translate
//https://cloud.google.com/nodejs/docs/reference/translate/latest/translate/v2.translate
// <script type="text/javascript" src="https://cdn.weglot.com/weglot.min.js"></script>
// <script>
// Weglot.initialize({
// api_key: 'wg_2e36ee5568854ba6ed2b64d472fc3a358'
// });
// </script>
// <!-- ConveyThis Script Start -->
// <script src="//cdn.conveythis.com/javascript/conveythis.js?api_key=pub_18d69d4f5249e7c5c3d6747ce7455c55"></script>
// <!-- ConveyThis Script End -->
15 changes: 5 additions & 10 deletions app/chat/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import '../globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import ChatsSidebar from '@/components/ChatsSidebar'
import ChatsSidebarMobile from '@/components/ChatsSidebarMobile'
const inter = Inter({ subsets: ['latin'] })
import { hindienglosoftw8asc } from '@/components/lifonts/localfonts'

export const metadata: Metadata = {
title: 'Ukuhumusha',
description: 'Unhinged ChatGPT',
title: '8aiueohcg+8ADHTNkvz',
description: 'asiA multiliNgual chatgpt 8aiueohcg+8ADHTNkvz+yileven(=Y=8+3) tdpbsyrlmnf',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
export default function RootLayout({ children, }: { children: React.ReactNode }) {
return (
<html lang="en">
<body className={`${inter.className}`}>
<body className={`${hindienglosoftw8asc.className} min-h-screen bg-background antialiased`}>
<div className='w-full flex flex-row'>
<ChatsSidebar />
<ChatsSidebarMobile />
Expand Down
2 changes: 2 additions & 0 deletions app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import LoginPrompt from "@/components/LoginPrompt"
import { useAuth } from "@/utils/Firebase"
import Chat from "@/components/Chat"
import FontPicker from "@/components/lifonts/lifp";

export default function Page() {
const { signedIn } = useAuth();
return (
<main className="w-full">
<FontPicker/>
{signedIn ? <Chat /> : <LoginPrompt />}
</main>
)
Expand Down
10 changes: 4 additions & 6 deletions app/dev/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import '../globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import Header from '@/components/Header'

const inter = Inter({ subsets: ['latin'] })
import { hindienglosoftw8asc } from '@/components/lifonts/localfonts'

export const metadata: Metadata = {
title: 'Ukuhumusha',
description: 'Unhinged ChatGPT',
title: '8aiueohcg+8ADHTNkvz',
description: 'asiA multiliNgual chatgpt 8aiueohcg+8ADHTNkvz+zileven(=J=8+3) tdpbsyrlmnf',
}

export default function RootLayout({
Expand All @@ -17,7 +15,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>
<body className={hindienglosoftw8asc.className}>
{children}</body>
</html>
)
Expand Down
Binary file modified app/icon.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 5 additions & 12 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { inglishenglosoftw8asc} from '@/components/lifonts/localfonts'
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'


const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Ukuhumusha',
description: 'Unhinged ChatGPT',
title: 'zikis8',
description: 'xsia multiliNguxl chxtgpt',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
export default function RootLayout({ children, }: { children: React.ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>
<body className={`${inglishenglosoftw8asc.className} min-h-screen bg-background antialiased`}>
{children}</body>
</html>
)
Expand Down
16 changes: 6 additions & 10 deletions app/legal/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import '../globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { hindienglosoftw8asc } from '@/components/lifonts/localfonts'

import UkuhumushaHeader from '@/components/UkuhumushaHeader'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Ukuhumusha',
description: 'Unhinged ChatGPT',
title: '8aiueohcg+8ADHTNkvz',
description: 'asiA multiliNgual chatgpt 8aiueohcg+8ADHTNkvz+zileven(=J=8+3) tdpbsyrlmnf',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
export default function RootLayout({ children, }: { children: React.ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>
<body className={`${hindienglosoftw8asc.className} min-h-screen bg-background antialiased`}>
<div className="w-full h-full bg-p-5">
<div className='flex relative items-center justify-center flex-col gap-2 w-full h-screen rounded-t-3xl bg-white text-center'>
<UkuhumushaHeader />
Expand Down
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion components/ChatGuest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ChatGuest() {
const [messages, setMessages] = useState<any>(INITIAL_MESSAGES)//messages in EN
const [translatedMessages, setTranslatedMessages] = useState<any>([])//messages in obscure foreign language
const [input, setInput] = useState("")
const [target, setTarget] = useState("zu")
const [target, setTarget] = useState("hi")
const [translateOpen, setTranslateOpen] = useState(true)
const [date, setDate] = useState<string>("")

Expand Down
2 changes: 1 addition & 1 deletion components/ChatsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function ChatsSidebar() {
<div className="md:block hidden w-80 h-screen overflow-y-scroll scrollbar bg-gray-800 ">
<Link href={"/chat"} className="text-white items-center flex flex-row gap-2 p-2 border-[1px] rounded-md border-gray-400">
<AiOutlinePlus />
<p>New Chat</p>
<p>niyu chat</p>
</Link>
<div className="relative flex flex-col items-center justify-start px-2 py-2">
<div className="w-12 h-auto absolute top-0 right-0 bg-gradient-to-l from-gray-800"></div>
Expand Down
16 changes: 9 additions & 7 deletions components/GetStarted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRouter } from "next/navigation"
import { handleSignIn } from "@/utils/Firebase"
import { useAuth } from "@/utils/Firebase"
import { useEffect } from "react"
import FontPicker from "./lifonts/lifp"


export default function GetStarted() {
Expand All @@ -22,23 +23,24 @@ export default function GetStarted() {
<div className="w-full h-full bg-p-5">
<div className="flex relative items-center justify-center flex-col gap-2 w-full h-full rounded-t-3xl bg-white">
<span className="flex flex-row items-center justify-center gap-2 absolute top-6 left-8">
<h1>Ukuhumusha Chat</h1>
<h1>multi laNguage fontpicker n chat</h1>
<BsCircleFill />
</span>
<h1 className="h-6">Get Started</h1>
<h1 className="h-6">get stArted</h1>
<div className="flex flex-col sm:flex-row gap-4">
<button onClick={handleSignIn} className="login-button">Login</button>
<button onClick={handleSignIn} className="login-button">Sign Up</button>
<FontPicker/>
<button onClick={handleSignIn} className="login-button">please du login</button>
<button onClick={handleSignIn} className="login-button">kindly du signup</button>
</div>
<Link href={"/guest"} className="text-center h-12"><b>Proceed as Guest</b></Link>
<Link href={"/guest"} className="text-center h-12"><b>proceed as guest_meHman</b></Link>

<div className="absolute bottom-0 w-full flex items-center justify-center h-20">
<div className="flex flex-row gap-2 text-sm text-gray-400">
<a href="https://arxiv.org/pdf/2310.02446.pdf" target="_blank" className="text-sm text-gray-400">About</a>
|
<Link href="/legal">Terms of use</Link>
<Link href="/legal">terms of use</Link>
|
<Link href="/legal/privacy">Privacy Policy</Link>
<Link href="/legal/privacy">privacy policy</Link>
</div>

</div>
Expand Down
57 changes: 57 additions & 0 deletions components/lifonts/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[
{ "olabel": "binary:89LY_VWPF(wnti=10=8+8=4*4)", "ovalue": "binarywenglosoftw8asc", "sfonts": [
{ "olabel": "binary:89LY_VWPF(wnti=10=8+8=4*4)", "ovalue": "binarywenglosoftw8asc" }
] },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc", "sfonts": [
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" },
{ "olabel": "binary:89LY_VWPF(wnti=10=8+8=4*4)", "ovalue": "binarywenglosoftw8asc" }
] },
{ "olabel": "hinqi englosoft", "ovalue": "hindienglosoftw8asc", "sfonts": [
{ "olabel": "hinqi englosoft", "ovalue": "hindienglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "russian englosoft", "ovalue": "russianenglosoftw8asc", "sfonts": [
{ "olabel": "russian englosoft", "ovalue": "russianenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "bangla englosoft", "ovalue": "banglaenglosoftw8asc", "sfonts": [
{ "olabel": "bangla englosoft", "ovalue": "banglaenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "korexn englosoft", "ovalue": "koreanenglosoftw8asc", "sfonts": [
{ "olabel": "korexn englosoft", "ovalue": "koreanenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "sinhxla englosoft", "ovalue": "sinhalaenglosoftw8asc", "sfonts": [
{ "olabel": "sinhxla englosoft", "ovalue": "sinhalaenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "jelugu englosoft", "ovalue": "teluguenglosoftw8asc", "sfonts": [
{ "olabel": "jelugu englosoft", "ovalue": "teluguenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "jxmil englosoft", "ovalue": "tamilenglosoftw8asc", "sfonts": [
{ "olabel": "jxmil englosoft", "ovalue": "tamilenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "mxlxyalxm englosoft", "ovalue": "malayalamenglosoftw8asc", "sfonts": [
{ "olabel": "mxlxyalxm englosoft", "ovalue": "malayalamenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "kxnnxda englosoft", "ovalue": "kannadaenglosoftw8asc", "sfonts": [
{ "olabel": "kxnnxda englosoft", "ovalue": "kannadaenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "oriya englosoft", "ovalue": "oriyaenglosoftw8asc", "sfonts": [
{ "olabel": "oriya englosoft", "ovalue": "oriyaenglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "gurmukhi englosoft", "ovalue": "gurmukhienglosoftw8asc", "sfonts": [
{ "olabel": "gurmukhi englosoft", "ovalue": "gurmukhienglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] },
{ "olabel": "guzraji englosoft", "ovalue": "guzratienglosoftw8asc", "sfonts": [
{ "olabel": "guzraji englosoft", "ovalue": "guzratienglosoftw8asc" },
{ "olabel": "inglish englosoft", "ovalue": "inglishenglosoftw8asc" }
] }
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added components/lifonts/fonts/del/25_woff2/ing25.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
45 changes: 45 additions & 0 deletions components/lifonts/lifp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use client";
import React, { useState } from 'react';
import Select from 'react-select';
import data from './data.json';
import { loklfont_2_fontcn } from './loklfont_2_fontcn';

interface ScriptOption { olabel: string; ovalue: string;
sfonts: Array<{ olabel: string; ovalue: string }>;
}

const FontPicker: React.FC = () => {
const [script, setScript] = useState<ScriptOption | null>(null);
const [sfont, setSFont] = useState<{ olabel: string; ovalue: string } | null>(null);
const [sfontlist, setSFontList] = useState<Array<{ olabel: string; ovalue: string }>>([]);

const handleScriptChange = (scriptObject: ScriptOption | null) => {
setScript(scriptObject);
if (scriptObject) {
setSFontList(scriptObject.sfonts);
setSFont(scriptObject.sfonts[0]);
setBodyFont(scriptObject.ovalue);
}
};

const handleSFontChange = (sfontObject: { olabel: string; ovalue: string } | null) => {
setSFont(sfontObject);
if (sfontObject) { setBodyFont(sfontObject.ovalue); }
};
const setBodyFont = (sval: string) => { document.body.className = "";
const sf = loklfont_2_fontcn(sval); document.body.classList.add(sf); document.body.classList.add("antialiased");
};
return (
<div style={{ width: 400, marginBottom: 20, color: 'black', backgroundColor: 'white' }} >
<Select id='scriptsel' placeholder="lAng(bhαsα).select" value={script} options={data}
onChange={handleScriptChange}
getOptionLabel={(x) => x.olabel} getOptionValue={(x) => x.ovalue}
/>
<Select id='fontsel' className='hidden' isDisabled placeholder="languagefont.select" value={sfont} options={sfontlist}
onChange={handleSFontChange}
getOptionLabel={(x) => x.olabel} getOptionValue={(x) => x.ovalue}
/>
</div>
);
};
export default FontPicker;
18 changes: 18 additions & 0 deletions components/lifonts/localfonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import localFont from "next/font/local";
///////////////// nonindik bilo
export const binarywenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/binarywenglosoftw8asc.woff2", display: "swap", });
export const inglishenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/inglishenglosoftw8asc.woff2", display: "swap", });
export const koreanenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/koreanenglosoftw8asc.woff2", display: "swap", });
export const russianenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/russianenglosoftw8asc.woff2", display: "swap", });
///////////////// indik bilo
export const hindienglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/hindienglosoftw8asc.woff2", display: "swap", });
export const banglaenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/banglaenglosoftw8asc.woff2", display: "swap", });
export const gurmukhienglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/gurmukhienglosoftw8asc.woff2", display: "swap", });
export const guzratienglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/guzratienglosoftw8asc.woff2", display: "swap", });
export const oriyaenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/oriyaenglosoftw8asc.woff2", display: "swap", });
export const tamilenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/tamilenglosoftw8asc.woff2", display: "swap", });
export const teluguenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/teluguenglosoftw8asc.woff2", display: "swap", });
export const kannadaenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/kannadaenglosoftw8asc.woff2", display: "swap", });
export const malayalamenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/malayalamenglosoftw8asc.woff2", display: "swap", });
export const sinhalaenglosoftw8asc = localFont({ src: "./fonts/hscii/englosoftw8/englosoftw8asc/sinhalaenglosoftw8asc.woff2", display: "swap", });

25 changes: 25 additions & 0 deletions components/lifonts/loklfont_2_fontcn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
inglishenglosoftw8asc, binarywenglosoftw8asc, russianenglosoftw8asc,
banglaenglosoftw8asc, guzratienglosoftw8asc, kannadaenglosoftw8asc, malayalamenglosoftw8asc, sinhalaenglosoftw8asc, teluguenglosoftw8asc,
gurmukhienglosoftw8asc, hindienglosoftw8asc, koreanenglosoftw8asc, oriyaenglosoftw8asc, tamilenglosoftw8asc,
} from "./localfonts";

export const loklfont_2_fontcn = (sval: string): string => {
switch (sval) {
case "binarywenglosoftw8asc": return binarywenglosoftw8asc.className;
case "koreanenglosoftw8asc": return koreanenglosoftw8asc.className;
case "russianenglosoftw8asc": return russianenglosoftw8asc.className;
case "inglishenglosoftw8asc": return inglishenglosoftw8asc.className;
case "hindienglosoftw8asc": return hindienglosoftw8asc.className;
case "banglaenglosoftw8asc": return banglaenglosoftw8asc.className;
case "sinhalaenglosoftw8asc": return sinhalaenglosoftw8asc.className;
case "tamilenglosoftw8asc": return tamilenglosoftw8asc.className;
case "kannadaenglosoftw8asc": return kannadaenglosoftw8asc.className;
case "malayalamenglosoftw8asc": return malayalamenglosoftw8asc.className;
case "teluguenglosoftw8asc": return teluguenglosoftw8asc.className;
case "oriyaenglosoftw8asc": return oriyaenglosoftw8asc.className;
case "gurmukhienglosoftw8asc": return gurmukhienglosoftw8asc.className;
case "guzratienglosoftw8asc": return guzratienglosoftw8asc.className;
default: return hindienglosoftw8asc.className;
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react": "^18",
"react-dom": "^18",
"react-icons": "^4.11.0",
"react-select": "^5.9.0",
"react-spinners": "^0.13.8",
"request": "^2.88.2"
},
Expand Down
Loading