Skip to content

Commit e8922d6

Browse files
committed
Add footer
1 parent e830957 commit e8922d6

File tree

8 files changed

+72
-35
lines changed

8 files changed

+72
-35
lines changed

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "./globals.css";
22
import { Providers } from "./providers";
33
import { Metadata } from "next";
44
import Script from "next/script";
5+
import { Footer } from "@/components/Footer";
56

67
export const metadata: Metadata = {
78
title: "OpenReader WebUI",
@@ -30,6 +31,7 @@ export default function RootLayout({
3031
<div className="bg-base rounded-lg shadow-lg">
3132
{children}
3233
</div>
34+
<Footer />
3335
</div>
3436
</div>
3537
</Providers>

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Home() {
1212
return (
1313
<div className='p-4'>
1414
<div className="flex justify-between items-center mb-6">
15-
<h1 className="text-2xl font-bold text-center flex-grow">OpenReader WebUI</h1>
15+
<h1 className="text-xl font-bold text-center flex-grow">OpenReader WebUI</h1>
1616
<button
1717
onClick={() => setIsSettingsOpen(true)}
1818
className="rounded-full p-2.5 text-foreground hover:bg-base focus:bg-base

src/components/Footer.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/react'
2+
3+
export function Footer() {
4+
return (
5+
<footer className="m-8 text-sm text-muted">
6+
<div className="flex flex-col items-center space-y-2">
7+
<div className="flex space-x-3">
8+
<Popover className="relative">
9+
<PopoverButton className="hover:text-foreground transition-colors">
10+
Privacy info
11+
</PopoverButton>
12+
<PopoverPanel className="absolute bottom-8 bg-base p-4 rounded-lg shadow-lg w-64">
13+
<p>No data collection. Documents are uploaded to your local browser cache.</p>
14+
<p className='mt-3'>Each sentence of the document you are viewing is sent to my FastAPI server for audio generation, no requests or data is collected.</p>
15+
</PopoverPanel>
16+
</Popover>
17+
<span></span>
18+
<span>
19+
Powered by{' '}
20+
<a
21+
href="https://huggingface.co/hexgrad/Kokoro-82M"
22+
target="_blank"
23+
rel="noopener noreferrer"
24+
className="font-bold hover:text-foreground transition-colors"
25+
>
26+
hexgrad/Kokoro-82M
27+
</a>
28+
{' '}and{' '}
29+
<a
30+
href="https://github.com/remsky/Kokoro-FastAPI/tree/master"
31+
target="_blank"
32+
rel="noopener noreferrer"
33+
className="font-bold hover:text-foreground transition-colors"
34+
>
35+
Kokoro-FastAPI
36+
</a>
37+
</span>
38+
</div>
39+
</div>
40+
</footer>
41+
)
42+
}

src/components/PDFUploader.tsx

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useState, useCallback } from 'react';
44
import { useDropzone } from 'react-dropzone';
55
import { usePDF } from '@/contexts/PDFContext';
6+
import { UploadIcon } from '@/components/icons/Icons';
67

78
interface PDFUploaderProps {
89
className?: string;
@@ -42,7 +43,7 @@ export function PDFUploader({ className = '' }: PDFUploaderProps) {
4243
<div
4344
{...getRootProps()}
4445
className={`
45-
w-full p-8 border-2 border-dashed rounded-lg
46+
w-full py-5 px-3 border-2 border-dashed rounded-lg
4647
${isDragActive ? 'border-accent bg-base' : 'border-muted'}
4748
transition-colors duration-200 ease-in-out
4849
${isUploading ? 'cursor-not-allowed opacity-50' : 'cursor-pointer hover:border-accent hover:bg-base'}
@@ -51,20 +52,7 @@ export function PDFUploader({ className = '' }: PDFUploaderProps) {
5152
>
5253
<input {...getInputProps()} />
5354
<div className="flex flex-col items-center justify-center text-center">
54-
<svg
55-
className="w-12 h-12 mb-4 text-muted"
56-
fill="none"
57-
stroke="currentColor"
58-
viewBox="0 0 24 24"
59-
xmlns="http://www.w3.org/2000/svg"
60-
>
61-
<path
62-
strokeLinecap="round"
63-
strokeLinejoin="round"
64-
strokeWidth={2}
65-
d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
66-
/>
67-
</svg>
55+
<UploadIcon className="w-10 h-10 mb-2 text-muted" />
6856

6957
{isUploading ? (
7058
<p className="text-lg font-semibold text-foreground">
@@ -76,7 +64,7 @@ export function PDFUploader({ className = '' }: PDFUploaderProps) {
7664
{isDragActive ? 'Drop your PDF here' : 'Drop your PDF here, or click to select'}
7765
</p>
7866
<p className="text-sm text-muted">
79-
Only PDF files are accepted
67+
Only PDF files are currently accepted
8068
</p>
8169
{error && <p className="mt-2 text-sm text-red-500">{error}</p>}
8270
</>

src/components/icons/Icons.tsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,7 @@ export function SettingsIcon(props: React.SVGProps<SVGSVGElement>) {
140140
className={props.className || "w-6 h-6"}
141141
{...props}
142142
>
143-
<path
144-
strokeLinecap="round"
145-
strokeLinejoin="round"
146-
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
147-
/>
148-
<path
149-
strokeLinecap="round"
150-
strokeLinejoin="round"
151-
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
152-
/>
143+
<path fillRule="evenodd" clipRule="evenodd" d="M14.2788 2.15224C13.9085 2 13.439 2 12.5 2C11.561 2 11.0915 2 10.7212 2.15224C10.2274 2.35523 9.83509 2.74458 9.63056 3.23463C9.53719 3.45834 9.50065 3.7185 9.48635 4.09799C9.46534 4.65568 9.17716 5.17189 8.69017 5.45093C8.20318 5.72996 7.60864 5.71954 7.11149 5.45876C6.77318 5.2813 6.52789 5.18262 6.28599 5.15102C5.75609 5.08178 5.22018 5.22429 4.79616 5.5472C4.47814 5.78938 4.24339 6.1929 3.7739 6.99993C3.30441 7.80697 3.06967 8.21048 3.01735 8.60491C2.94758 9.1308 3.09118 9.66266 3.41655 10.0835C3.56506 10.2756 3.77377 10.437 4.0977 10.639C4.57391 10.936 4.88032 11.4419 4.88029 12C4.88026 12.5581 4.57386 13.0639 4.0977 13.3608C3.77372 13.5629 3.56497 13.7244 3.41645 13.9165C3.09108 14.3373 2.94749 14.8691 3.01725 15.395C3.06957 15.7894 3.30432 16.193 3.7738 17C4.24329 17.807 4.47804 18.2106 4.79606 18.4527C5.22008 18.7756 5.75599 18.9181 6.28589 18.8489C6.52778 18.8173 6.77305 18.7186 7.11133 18.5412C7.60852 18.2804 8.2031 18.27 8.69012 18.549C9.17714 18.8281 9.46533 19.3443 9.48635 19.9021C9.50065 20.2815 9.53719 20.5417 9.63056 20.7654C9.83509 21.2554 10.2274 21.6448 10.7212 21.8478C11.0915 22 11.561 22 12.5 22C13.439 22 13.9085 22 14.2788 21.8478C14.7726 21.6448 15.1649 21.2554 15.3694 20.7654C15.4628 20.5417 15.4994 20.2815 15.5137 19.902C15.5347 19.3443 15.8228 18.8281 16.3098 18.549C16.7968 18.2699 17.3914 18.2804 17.8886 18.5412C18.2269 18.7186 18.4721 18.8172 18.714 18.8488C19.2439 18.9181 19.7798 18.7756 20.2038 18.4527C20.5219 18.2105 20.7566 17.807 21.2261 16.9999C21.6956 16.1929 21.9303 15.7894 21.9827 15.395C22.0524 14.8691 21.9088 14.3372 21.5835 13.9164C21.4349 13.7243 21.2262 13.5628 20.9022 13.3608C20.4261 13.0639 20.1197 12.558 20.1197 11.9999C20.1197 11.4418 20.4261 10.9361 20.9022 10.6392C21.2263 10.4371 21.435 10.2757 21.5836 10.0835C21.9089 9.66273 22.0525 9.13087 21.9828 8.60497C21.9304 8.21055 21.6957 7.80703 21.2262 7C20.7567 6.19297 20.522 5.78945 20.2039 5.54727C19.7799 5.22436 19.244 5.08185 18.7141 5.15109C18.4722 5.18269 18.2269 5.28136 17.8887 5.4588C17.3915 5.71959 16.7969 5.73002 16.3099 5.45096C15.8229 5.17191 15.5347 4.65566 15.5136 4.09794C15.4993 3.71848 15.4628 3.45833 15.3694 3.23463C15.1649 2.74458 14.7726 2.35523 14.2788 2.15224ZM12.5 15C14.1695 15 15.5228 13.6569 15.5228 12C15.5228 10.3431 14.1695 9 12.5 9C10.8305 9 9.47716 10.3431 9.47716 12C9.47716 13.6569 10.8305 15 12.5 15Z"/>
153144
</svg>
154145
);
155146
}
@@ -173,3 +164,21 @@ export function CheckIcon(props: React.SVGProps<SVGSVGElement>) {
173164
</svg>
174165
);
175166
}
167+
168+
export function UploadIcon(props: React.SVGProps<SVGSVGElement>) {
169+
return (
170+
<svg
171+
xmlns="http://www.w3.org/2000/svg"
172+
viewBox="0 0 24 24"
173+
fill="currentColor"
174+
stroke="none"
175+
className={props.className}
176+
width={props.width || "1.5em"}
177+
height={props.height || "1.5em"}
178+
{...props}
179+
>
180+
<path d="M12.5535 16.5061C12.4114 16.6615 12.2106 16.75 12 16.75C11.7894 16.75 11.5886 16.6615 11.4465 16.5061L7.44648 12.1311C7.16698 11.8254 7.18822 11.351 7.49392 11.0715C7.79963 10.792 8.27402 10.8132 8.55352 11.1189L11.25 14.0682V3C11.25 2.58579 11.5858 2.25 12 2.25C12.4142 2.25 12.75 2.58579 12.75 3V14.0682L15.4465 11.1189C15.726 10.8132 16.2004 10.792 16.5061 11.0715C16.8118 11.351 16.833 11.8254 16.5535 12.1311L12.5535 16.5061Z" />
181+
<path d="M3.75 15C3.75 14.5858 3.41422 14.25 3 14.25C2.58579 14.25 2.25 14.5858 2.25 15V15.0549C2.24998 16.4225 2.24996 17.5248 2.36652 18.3918C2.48754 19.2919 2.74643 20.0497 3.34835 20.6516C3.95027 21.2536 4.70814 21.5125 5.60825 21.6335C6.47522 21.75 7.57754 21.75 8.94513 21.75H15.0549C16.4225 21.75 17.5248 21.75 18.3918 21.6335C19.2919 21.5125 20.0497 21.2536 20.6517 20.6516C21.2536 20.0497 21.5125 19.2919 21.6335 18.3918C21.75 17.5248 21.75 16.4225 21.75 15.0549V15C21.75 14.5858 21.4142 14.25 21 14.25C20.5858 14.25 20.25 14.5858 20.25 15C20.25 16.4354 20.2484 17.4365 20.1469 18.1919C20.0482 18.9257 19.8678 19.3142 19.591 19.591C19.3142 19.8678 18.9257 20.0482 18.1919 20.1469C17.4365 20.2484 16.4354 20.25 15 20.25H9C7.56459 20.25 6.56347 20.2484 5.80812 20.1469C5.07435 20.0482 4.68577 19.8678 4.40901 19.591C4.13225 19.3142 3.9518 18.9257 3.85315 18.1919C3.75159 17.4365 3.75 16.4354 3.75 15Z"/>
182+
</svg>
183+
);
184+
}

src/components/player/SpeedControl.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ const speedOptions = [
1919
{ value: 3, label: '3x' },
2020
];
2121

22-
export const SpeedControl = ({ speed, setSpeedAndRestart }: {
23-
speed: number;
22+
export const SpeedControl = ({ setSpeedAndRestart }: {
2423
setSpeedAndRestart: (speed: number) => void;
2524
}) => {
2625
const { voiceSpeed } = useConfig();

src/components/player/TTSPlayer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ export default function TTSPlayer({ currentPage, numPages }: {
2323
skipForward,
2424
skipBackward,
2525
isProcessing,
26-
speed,
2726
setSpeedAndRestart,
28-
voice,
2927
setVoiceAndRestart,
3028
availableVoices,
3129
skipToPage,
@@ -35,7 +33,7 @@ export default function TTSPlayer({ currentPage, numPages }: {
3533
<div className={`fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 transition-opacity duration-300`}>
3634
<div className="bg-base dark:bg-base rounded-full shadow-lg px-4 py-1 flex items-center space-x-1 relative">
3735
{/* Speed control */}
38-
<SpeedControl speed={speed} setSpeedAndRestart={setSpeedAndRestart} />
36+
<SpeedControl setSpeedAndRestart={setSpeedAndRestart} />
3937

4038
{/* Page Navigation */}
4139
<Navigator currentPage={currentPage} numPages={numPages} skipToPage={skipToPage} />
@@ -68,7 +66,7 @@ export default function TTSPlayer({ currentPage, numPages }: {
6866
</Button>
6967

7068
{/* Voice control */}
71-
<VoicesControl voice={voice} availableVoices={availableVoices} setVoiceAndRestart={setVoiceAndRestart} />
69+
<VoicesControl availableVoices={availableVoices} setVoiceAndRestart={setVoiceAndRestart} />
7270
</div>
7371
</div>
7472
);

src/components/player/VoicesControl.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77
import { ChevronUpDownIcon } from '@/components/icons/Icons';
88
import { useConfig } from '@/contexts/ConfigContext';
99

10-
export const VoicesControl = ({ voice, availableVoices, setVoiceAndRestart }: {
11-
voice: string;
10+
export const VoicesControl = ({ availableVoices, setVoiceAndRestart }: {
1211
availableVoices: string[];
1312
setVoiceAndRestart: (voice: string) => void;
1413
}) => {

0 commit comments

Comments
 (0)