Spaces:
Sleeping
Sleeping
Commit ·
b23c850
1
Parent(s): 09dd2d7
style: re-apply branding, dynamic verse, and layout stability fixes
Browse files- frontend/src/App.tsx +54 -28
frontend/src/App.tsx
CHANGED
|
@@ -8,13 +8,29 @@ interface Message {
|
|
| 8 |
content: string;
|
| 9 |
}
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
const App: React.FC = () => {
|
| 12 |
const [messages, setMessages] = useState<Message[]>([]);
|
| 13 |
const [input, setInput] = useState('');
|
| 14 |
const [isLoading, setIsLoading] = useState(false);
|
| 15 |
const [sessionId] = useState<string>(() => Math.random().toString(36).substring(7));
|
|
|
|
| 16 |
const chatEndRef = useRef<HTMLDivElement>(null);
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
useEffect(() => {
|
| 19 |
chatEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
| 20 |
}, [messages]);
|
|
@@ -53,53 +69,63 @@ const App: React.FC = () => {
|
|
| 53 |
};
|
| 54 |
|
| 55 |
return (
|
| 56 |
-
<div className="min-h-screen bg-[#002B22] flex flex-col items-center justify-center p-0
|
| 57 |
{/* Dynamic Background Elements */}
|
| 58 |
<div className="absolute top-[-20%] left-[-10%] w-[60%] h-[60%] bg-[#007055]/20 rounded-full blur-[150px] animate-pulse pointer-events-none"></div>
|
| 59 |
<div className="absolute bottom-[-20%] right-[-10%] w-[60%] h-[60%] bg-[#FDFBD4]/5 rounded-full blur-[150px] pointer-events-none"></div>
|
| 60 |
|
| 61 |
-
<div className="w-full max-w-5xl h-screen
|
| 62 |
|
| 63 |
{/* Modern Sidebar-style Header (Desktop) / Top Header (Mobile) */}
|
| 64 |
-
<aside className="w-full
|
| 65 |
<div className="relative group">
|
| 66 |
<div className="absolute -inset-1 bg-gradient-to-tr from-[#FDFBD4] to-[#007055] rounded-3xl blur opacity-25 group-hover:opacity-50 transition duration-1000 group-hover:duration-200"></div>
|
| 67 |
-
<div className="relative w-
|
| 68 |
<img src="/assets/logo.jpg" alt="CLCC Logo" className="w-full h-full object-cover" />
|
| 69 |
</div>
|
| 70 |
</div>
|
| 71 |
<div className="text-center sm:text-left space-y-2">
|
| 72 |
-
<h1 className="text-4xl font-black tracking-tighter bg-clip-text text-transparent bg-gradient-to-br from-white via-[#FDFBD4] to-[#007055]">
|
| 73 |
Theo AI
|
| 74 |
</h1>
|
| 75 |
<div className="inline-flex items-center px-3 py-1 bg-[#FDFBD4]/10 rounded-full border border-[#FDFBD4]/20">
|
| 76 |
-
<span className="text-[10px] font-bold text-[#FDFBD4] uppercase tracking-widest">
|
| 77 |
-
|
| 78 |
</span>
|
| 79 |
</div>
|
| 80 |
</div>
|
| 81 |
-
<div className="hidden
|
| 82 |
-
<
|
| 83 |
-
"
|
| 84 |
-
<
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
</div>
|
| 87 |
</aside>
|
| 88 |
|
| 89 |
{/* Main Interaction Area */}
|
| 90 |
<main className="flex-1 flex flex-col min-w-0 bg-transparent relative">
|
| 91 |
{/* Chat Messages */}
|
| 92 |
-
<div className="flex-1 overflow-y-auto p-4
|
| 93 |
{messages.length === 0 && (
|
| 94 |
<div className="h-full flex flex-col items-center justify-center space-y-6 text-center animate-in fade-in zoom-in duration-700">
|
| 95 |
<div className="w-16 h-16 bg-[#FDFBD4]/5 rounded-2xl flex items-center justify-center border border-[#FDFBD4]/10 shadow-inner">
|
| 96 |
<Bot size={32} className="text-[#FDFBD4]" />
|
| 97 |
</div>
|
| 98 |
-
<div className="space-y-2 max-w-sm">
|
| 99 |
<h2 className="text-2xl font-bold text-white">Shalom, Beloved</h2>
|
| 100 |
-
<p className="text-white/40 text-sm leading-relaxed">
|
| 101 |
I am centered in Christ to provide you with scriptural guidance and faithful encouragement.
|
| 102 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
</div>
|
| 104 |
</div>
|
| 105 |
)}
|
|
@@ -109,15 +135,15 @@ const App: React.FC = () => {
|
|
| 109 |
className={`flex ${msg.role === 'user' ? 'justify-end' : 'justify-start'} animate-in fade-in slide-in-from-bottom-6 duration-500 fill-mode-both`}
|
| 110 |
style={{ animationDelay: `${index * 50}ms` }}
|
| 111 |
>
|
| 112 |
-
<div className={`group flex flex-col max-w-[
|
| 113 |
<div className={`flex items-center gap-2 mb-2 px-2 ${msg.role === 'user' ? 'flex-row-reverse' : 'flex-row'}`}>
|
| 114 |
<div className={`text-[10px] font-bold uppercase tracking-widest ${msg.role === 'user' ? 'text-[#007055]' : 'text-[#FDFBD4]/60'}`}>
|
| 115 |
{msg.role === 'user' ? 'You' : 'Theo'}
|
| 116 |
</div>
|
| 117 |
</div>
|
| 118 |
-
<div className={`relative p-5
|
| 119 |
-
|
| 120 |
-
|
| 121 |
}`}>
|
| 122 |
<div className={`markdown-content prose prose-invert prose-sm max-w-none
|
| 123 |
prose-p:leading-relaxed prose-headings:text-[#FDFBD4] prose-strong:text-[#FDFBD4]
|
|
@@ -145,32 +171,32 @@ const App: React.FC = () => {
|
|
| 145 |
</div>
|
| 146 |
|
| 147 |
{/* Sophisticated Input Box */}
|
| 148 |
-
<div className="p-
|
| 149 |
<div className="relative group max-w-3xl mx-auto">
|
| 150 |
<div className="absolute -inset-0.5 bg-gradient-to-r from-[#007055] via-[#FDFBD4]/20 to-[#004D3C] rounded-3xl blur opacity-20 group-focus-within:opacity-40 transition duration-500"></div>
|
| 151 |
-
<div className="relative flex items-center bg-[#00362B]/60 backdrop-blur-xl border border-white/10 rounded-3xl p-2 transition-all duration-300 group-focus-within:border-[#FDFBD4]/30 group-focus-within:bg-[#00362B]/80 shadow-2xl">
|
| 152 |
<input
|
| 153 |
type="text"
|
| 154 |
value={input}
|
| 155 |
onChange={(e) => setInput(e.target.value)}
|
| 156 |
onKeyPress={(e) => e.key === 'Enter' && handleSend()}
|
| 157 |
placeholder="Type your spiritual inquiry here..."
|
| 158 |
-
className="flex-1 bg-transparent py-4 px-6 focus:outline-none text-white placeholder:text-white/20"
|
| 159 |
disabled={isLoading}
|
| 160 |
/>
|
| 161 |
<button
|
| 162 |
onClick={handleSend}
|
| 163 |
disabled={isLoading || !input.trim()}
|
| 164 |
-
className={`p-4 rounded-2xl transition-all duration-500 ${input.trim()
|
| 165 |
-
|
| 166 |
-
|
| 167 |
}`}
|
| 168 |
>
|
| 169 |
-
<Send size={
|
| 170 |
</button>
|
| 171 |
</div>
|
| 172 |
-
<div className="flex justify-center mt-4">
|
| 173 |
-
<p className="text-[9px] uppercase tracking-[0.4em] text-white/20 font-black">
|
| 174 |
Faith-based Intelligence • CLCC
|
| 175 |
</p>
|
| 176 |
</div>
|
|
|
|
| 8 |
content: string;
|
| 9 |
}
|
| 10 |
|
| 11 |
+
const VERSES = [
|
| 12 |
+
{ text: "Thy word is a lamp unto my feet, and a light unto my path.", ref: "Psalm 119:105" },
|
| 13 |
+
{ text: "For I know the thoughts that I think toward you, saith the Lord, thoughts of peace, and not of evil.", ref: "Jeremiah 29:11" },
|
| 14 |
+
{ text: "But they that wait upon the Lord shall renew their strength; they shall mount up with wings as eagles.", ref: "Isaiah 40:31" },
|
| 15 |
+
{ text: "Trust in the Lord with all thine heart; and lean not unto thine own understanding.", ref: "Proverbs 3:5" },
|
| 16 |
+
{ text: "I can do all things through Christ which strengtheneth me.", ref: "Philippians 4:13" },
|
| 17 |
+
{ text: "The Lord is my shepherd; I shall not want.", ref: "Psalm 23:1" },
|
| 18 |
+
{ text: "And be not conformed to this world: but be ye transformed by the renewing of your mind.", ref: "Romans 12:2" }
|
| 19 |
+
];
|
| 20 |
+
|
| 21 |
const App: React.FC = () => {
|
| 22 |
const [messages, setMessages] = useState<Message[]>([]);
|
| 23 |
const [input, setInput] = useState('');
|
| 24 |
const [isLoading, setIsLoading] = useState(false);
|
| 25 |
const [sessionId] = useState<string>(() => Math.random().toString(36).substring(7));
|
| 26 |
+
const [verse, setVerse] = useState(VERSES[0]);
|
| 27 |
const chatEndRef = useRef<HTMLDivElement>(null);
|
| 28 |
|
| 29 |
+
useEffect(() => {
|
| 30 |
+
const dayOfYear = Math.floor((new Date().getTime() - new Date(new Date().getFullYear(), 0, 0).getTime()) / 86400000);
|
| 31 |
+
setVerse(VERSES[dayOfYear % VERSES.length]);
|
| 32 |
+
}, []);
|
| 33 |
+
|
| 34 |
useEffect(() => {
|
| 35 |
chatEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
| 36 |
}, [messages]);
|
|
|
|
| 69 |
};
|
| 70 |
|
| 71 |
return (
|
| 72 |
+
<div className="min-h-screen bg-[#002B22] flex flex-col items-center justify-center p-0 md:p-4 font-outfit text-white overflow-x-hidden relative">
|
| 73 |
{/* Dynamic Background Elements */}
|
| 74 |
<div className="absolute top-[-20%] left-[-10%] w-[60%] h-[60%] bg-[#007055]/20 rounded-full blur-[150px] animate-pulse pointer-events-none"></div>
|
| 75 |
<div className="absolute bottom-[-20%] right-[-10%] w-[60%] h-[60%] bg-[#FDFBD4]/5 rounded-full blur-[150px] pointer-events-none"></div>
|
| 76 |
|
| 77 |
+
<div className="w-full max-w-5xl h-screen md:h-[92vh] flex flex-col md:flex-row relative z-10 bg-black/20 backdrop-blur-2xl md:rounded-[2.5rem] overflow-hidden border border-white/5 shadow-[0_32px_64px_-12px_rgba(0,0,0,0.5)]">
|
| 78 |
|
| 79 |
{/* Modern Sidebar-style Header (Desktop) / Top Header (Mobile) */}
|
| 80 |
+
<aside className="w-full md:w-80 bg-[#00362B]/80 p-6 md:p-8 flex flex-col items-center md:items-start space-y-6 md:space-y-8 border-b md:border-b-0 md:border-r border-white/5 shrink-0">
|
| 81 |
<div className="relative group">
|
| 82 |
<div className="absolute -inset-1 bg-gradient-to-tr from-[#FDFBD4] to-[#007055] rounded-3xl blur opacity-25 group-hover:opacity-50 transition duration-1000 group-hover:duration-200"></div>
|
| 83 |
+
<div className="relative w-20 h-20 md:w-32 md:h-32 rounded-[2rem] overflow-hidden border border-white/10 shadow-2xl transform transition-transform group-hover:scale-105 duration-500">
|
| 84 |
<img src="/assets/logo.jpg" alt="CLCC Logo" className="w-full h-full object-cover" />
|
| 85 |
</div>
|
| 86 |
</div>
|
| 87 |
<div className="text-center sm:text-left space-y-2">
|
| 88 |
+
<h1 className="text-3xl md:text-4xl font-black tracking-tighter bg-clip-text text-transparent bg-gradient-to-br from-white via-[#FDFBD4] to-[#007055]">
|
| 89 |
Theo AI
|
| 90 |
</h1>
|
| 91 |
<div className="inline-flex items-center px-3 py-1 bg-[#FDFBD4]/10 rounded-full border border-[#FDFBD4]/20">
|
| 92 |
+
<span className="text-[9px] md:text-[10px] font-bold text-[#FDFBD4] uppercase tracking-widest whitespace-nowrap">
|
| 93 |
+
CLCC - TECHDISCIPLES
|
| 94 |
</span>
|
| 95 |
</div>
|
| 96 |
</div>
|
| 97 |
+
<div className="hidden md:block flex-1 w-full pt-8">
|
| 98 |
+
<div className="p-4 rounded-2xl bg-white/5 border border-white/5 backdrop-blur-sm animate-in fade-in slide-in-from-top-4 duration-1000">
|
| 99 |
+
<h3 className="text-[10px] font-bold text-[#FDFBD4]/40 uppercase tracking-widest mb-3">Verse of the Day</h3>
|
| 100 |
+
<p className="text-[#FDFBD4]/80 text-xs leading-relaxed font-light italic">
|
| 101 |
+
"{verse.text}"
|
| 102 |
+
<span className="block mt-2 font-bold not-italic opacity-100 text-[#FDFBD4]">— {verse.ref}</span>
|
| 103 |
+
</p>
|
| 104 |
+
</div>
|
| 105 |
</div>
|
| 106 |
</aside>
|
| 107 |
|
| 108 |
{/* Main Interaction Area */}
|
| 109 |
<main className="flex-1 flex flex-col min-w-0 bg-transparent relative">
|
| 110 |
{/* Chat Messages */}
|
| 111 |
+
<div className="flex-1 overflow-y-auto p-4 md:p-10 space-y-8 scroll-smooth scrollbar-hide h-full">
|
| 112 |
{messages.length === 0 && (
|
| 113 |
<div className="h-full flex flex-col items-center justify-center space-y-6 text-center animate-in fade-in zoom-in duration-700">
|
| 114 |
<div className="w-16 h-16 bg-[#FDFBD4]/5 rounded-2xl flex items-center justify-center border border-[#FDFBD4]/10 shadow-inner">
|
| 115 |
<Bot size={32} className="text-[#FDFBD4]" />
|
| 116 |
</div>
|
| 117 |
+
<div className="space-y-2 max-w-sm px-4">
|
| 118 |
<h2 className="text-2xl font-bold text-white">Shalom, Beloved</h2>
|
| 119 |
+
<p className="text-white/40 text-sm leading-relaxed mb-4">
|
| 120 |
I am centered in Christ to provide you with scriptural guidance and faithful encouragement.
|
| 121 |
</p>
|
| 122 |
+
<div className="md:hidden p-4 rounded-2xl bg-white/5 border border-white/5 text-left">
|
| 123 |
+
<h3 className="text-[8px] font-bold text-[#FDFBD4]/30 uppercase tracking-[0.2em] mb-2">Today's Word</h3>
|
| 124 |
+
<p className="text-[#FDFBD4]/70 text-xs italic">
|
| 125 |
+
"{verse.text}"
|
| 126 |
+
<span className="block mt-1 font-bold not-italic text-[10px]">— {verse.ref}</span>
|
| 127 |
+
</p>
|
| 128 |
+
</div>
|
| 129 |
</div>
|
| 130 |
</div>
|
| 131 |
)}
|
|
|
|
| 135 |
className={`flex ${msg.role === 'user' ? 'justify-end' : 'justify-start'} animate-in fade-in slide-in-from-bottom-6 duration-500 fill-mode-both`}
|
| 136 |
style={{ animationDelay: `${index * 50}ms` }}
|
| 137 |
>
|
| 138 |
+
<div className={`group flex flex-col max-w-[95%] md:max-w-[80%] ${msg.role === 'user' ? 'items-end' : 'items-start'}`}>
|
| 139 |
<div className={`flex items-center gap-2 mb-2 px-2 ${msg.role === 'user' ? 'flex-row-reverse' : 'flex-row'}`}>
|
| 140 |
<div className={`text-[10px] font-bold uppercase tracking-widest ${msg.role === 'user' ? 'text-[#007055]' : 'text-[#FDFBD4]/60'}`}>
|
| 141 |
{msg.role === 'user' ? 'You' : 'Theo'}
|
| 142 |
</div>
|
| 143 |
</div>
|
| 144 |
+
<div className={`relative p-5 md:p-6 rounded-[2rem] text-sm leading-relaxed shadow-xl transition-all duration-300 ${msg.role === 'user'
|
| 145 |
+
? 'bg-gradient-to-br from-[#007055] to-[#004D3C] text-white rounded-tr-none border border-white/5'
|
| 146 |
+
: 'bg-white/5 backdrop-blur-md text-white/90 rounded-tl-none border border-white/5 hover:bg-white/10'
|
| 147 |
}`}>
|
| 148 |
<div className={`markdown-content prose prose-invert prose-sm max-w-none
|
| 149 |
prose-p:leading-relaxed prose-headings:text-[#FDFBD4] prose-strong:text-[#FDFBD4]
|
|
|
|
| 171 |
</div>
|
| 172 |
|
| 173 |
{/* Sophisticated Input Box */}
|
| 174 |
+
<div className="p-4 md:p-10 shrink-0">
|
| 175 |
<div className="relative group max-w-3xl mx-auto">
|
| 176 |
<div className="absolute -inset-0.5 bg-gradient-to-r from-[#007055] via-[#FDFBD4]/20 to-[#004D3C] rounded-3xl blur opacity-20 group-focus-within:opacity-40 transition duration-500"></div>
|
| 177 |
+
<div className="relative flex items-center bg-[#00362B]/60 backdrop-blur-xl border border-white/10 rounded-3xl p-1.5 md:p-2 transition-all duration-300 group-focus-within:border-[#FDFBD4]/30 group-focus-within:bg-[#00362B]/80 shadow-2xl">
|
| 178 |
<input
|
| 179 |
type="text"
|
| 180 |
value={input}
|
| 181 |
onChange={(e) => setInput(e.target.value)}
|
| 182 |
onKeyPress={(e) => e.key === 'Enter' && handleSend()}
|
| 183 |
placeholder="Type your spiritual inquiry here..."
|
| 184 |
+
className="flex-1 bg-transparent py-3 md:py-4 px-4 md:px-6 focus:outline-none text-white placeholder:text-white/20 text-sm md:text-base"
|
| 185 |
disabled={isLoading}
|
| 186 |
/>
|
| 187 |
<button
|
| 188 |
onClick={handleSend}
|
| 189 |
disabled={isLoading || !input.trim()}
|
| 190 |
+
className={`p-3 md:p-4 rounded-2xl transition-all duration-500 ${input.trim()
|
| 191 |
+
? 'bg-[#FDFBD4] text-[#002B22] shadow-[0_0_20px_rgba(253,251,212,0.3)] hover:scale-105 active:scale-95'
|
| 192 |
+
: 'bg-white/5 text-white/20 shadow-none'
|
| 193 |
}`}
|
| 194 |
>
|
| 195 |
+
<Send size={18} className={isLoading ? 'animate-pulse' : ''} />
|
| 196 |
</button>
|
| 197 |
</div>
|
| 198 |
+
<div className="flex justify-center mt-3 md:mt-4">
|
| 199 |
+
<p className="text-[8px] md:text-[9px] uppercase tracking-[0.4em] text-white/20 font-black">
|
| 200 |
Faith-based Intelligence • CLCC
|
| 201 |
</p>
|
| 202 |
</div>
|