Álvaro Valenzuela Valdes commited on
Commit
f353f19
·
1 Parent(s): 249ca00

Fix avatar rendering and integrate premium superhero avatar based on founder likeness (cleaned)

Browse files
frontend/components/AgentChat.tsx CHANGED
@@ -3,6 +3,7 @@
3
  import { useState, useRef, useEffect } from "react";
4
  import type { Tender, CompanyProfile } from "../lib/types";
5
  import { uploadDocument, getAPIBase } from "../lib/api";
 
6
 
7
  type Message = {
8
  role: "user" | "assistant";
@@ -207,8 +208,8 @@ export default function AgentChat({ tender, companyProfile }: Props) {
207
  {/* Chat Header */}
208
  <div className="p-4 md:p-6 border-b border-white/5 flex flex-col md:flex-row md:items-center justify-between gap-4 bg-white/[0.03]">
209
  <div className="flex items-center gap-4">
210
- <div className={`text-2xl md:text-3xl transition-all duration-500 relative ${isLoading || isTyping ? 'scale-110' : ''}`}>
211
- {selectedAgent.avatar}
212
  {(isLoading || isTyping || isUploading) && (
213
  <div className="absolute inset-0 bg-purple-500/20 blur-xl rounded-full animate-pulse" />
214
  )}
 
3
  import { useState, useRef, useEffect } from "react";
4
  import type { Tender, CompanyProfile } from "../lib/types";
5
  import { uploadDocument, getAPIBase } from "../lib/api";
6
+ import { avatarBase64 } from "../lib/avatar";
7
 
8
  type Message = {
9
  role: "user" | "assistant";
 
208
  {/* Chat Header */}
209
  <div className="p-4 md:p-6 border-b border-white/5 flex flex-col md:flex-row md:items-center justify-between gap-4 bg-white/[0.03]">
210
  <div className="flex items-center gap-4">
211
+ <div className={`w-12 h-12 rounded-full overflow-hidden border border-white/20 transition-all duration-500 relative ${isLoading || isTyping ? 'scale-110' : ''}`}>
212
+ <img src={avatarBase64} alt="AI Agent" className="w-full h-full object-cover" />
213
  {(isLoading || isTyping || isUploading) && (
214
  <div className="absolute inset-0 bg-purple-500/20 blur-xl rounded-full animate-pulse" />
215
  )}
frontend/components/Sidebar.tsx CHANGED
@@ -1,6 +1,7 @@
1
  "use client";
2
  import { translations, Language } from "../lib/translations";
3
  import { avatarBase64 } from "../lib/avatar";
 
4
 
5
  import { useState, type Dispatch, type SetStateAction } from "react";
6
 
@@ -117,7 +118,7 @@ export default function Sidebar({ tabs, activeTab, onTabSelect, status, lang, fo
117
  <div className="absolute -inset-0.5 bg-gradient-to-r from-purple-600 to-cyan-600 rounded-xl blur opacity-20 group-hover:opacity-40 transition"></div>
118
  <div className="relative w-10 h-10 rounded-xl overflow-hidden border border-white/10 bg-slate-900">
119
  <img
120
- src={avatarBase64}
121
  alt="Profile"
122
  className="w-full h-full object-cover"
123
  />
 
1
  "use client";
2
  import { translations, Language } from "../lib/translations";
3
  import { avatarBase64 } from "../lib/avatar";
4
+ import { userPhotoBase64 } from "../lib/user_photo";
5
 
6
  import { useState, type Dispatch, type SetStateAction } from "react";
7
 
 
118
  <div className="absolute -inset-0.5 bg-gradient-to-r from-purple-600 to-cyan-600 rounded-xl blur opacity-20 group-hover:opacity-40 transition"></div>
119
  <div className="relative w-10 h-10 rounded-xl overflow-hidden border border-white/10 bg-slate-900">
120
  <img
121
+ src={userPhotoBase64}
122
  alt="Profile"
123
  className="w-full h-full object-cover"
124
  />
frontend/components/SystemInfo.tsx CHANGED
@@ -4,6 +4,7 @@ import { useState } from "react";
4
  import { syncDatabase } from "../lib/api";
5
  import { translations, Language } from "../lib/translations";
6
  import { avatarBase64 } from "../lib/avatar";
 
7
 
8
  type Props = {
9
  lang: Language;
@@ -127,8 +128,8 @@ export default function SystemInfo({ lang }: Props) {
127
  <div className="absolute -inset-2 bg-gradient-to-r from-purple-600 to-cyan-600 rounded-full blur opacity-25 group-hover:opacity-100 transition duration-1000"></div>
128
  <div className="relative w-72 h-72 rounded-full overflow-hidden border-2 border-white/20 bg-slate-900 flex items-center justify-center shadow-2xl">
129
  <img
130
- src={avatarBase64}
131
- alt="Álvaro Tech Founder"
132
  className="w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"
133
  onError={(e) => {
134
  console.log("Avatar load failed, using dynamic placeholder...");
@@ -143,6 +144,40 @@ export default function SystemInfo({ lang }: Props) {
143
  </div>
144
  </div>
145
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  {/* Agents Section */}
148
  <div className="space-y-6">
 
4
  import { syncDatabase } from "../lib/api";
5
  import { translations, Language } from "../lib/translations";
6
  import { avatarBase64 } from "../lib/avatar";
7
+ import { userPhotoBase64 } from "../lib/user_photo";
8
 
9
  type Props = {
10
  lang: Language;
 
128
  <div className="absolute -inset-2 bg-gradient-to-r from-purple-600 to-cyan-600 rounded-full blur opacity-25 group-hover:opacity-100 transition duration-1000"></div>
129
  <div className="relative w-72 h-72 rounded-full overflow-hidden border-2 border-white/20 bg-slate-900 flex items-center justify-center shadow-2xl">
130
  <img
131
+ src={userPhotoBase64}
132
+ alt="Álvaro Valenzuela"
133
  className="w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"
134
  onError={(e) => {
135
  console.log("Avatar load failed, using dynamic placeholder...");
 
144
  </div>
145
  </div>
146
  </div>
147
+
148
+ {/* Superhero Section */}
149
+ <div className="glass-card rounded-3xl p-8 md:p-12 border border-purple-500/30 bg-purple-500/[0.05] relative overflow-hidden text-left">
150
+ <div className="absolute -left-20 -bottom-20 h-64 w-64 rounded-full bg-cyan-500/10 blur-[100px]" />
151
+ <div className="grid md:grid-cols-2 gap-12 items-center relative z-10">
152
+ <div className="order-2 md:order-1 flex flex-col items-center justify-center">
153
+ <div className="relative group">
154
+ <div className="absolute -inset-2 bg-gradient-to-r from-cyan-600 to-purple-600 rounded-full blur opacity-40 group-hover:opacity-100 transition duration-1000"></div>
155
+ <div className="relative w-80 h-80 rounded-full overflow-hidden border-4 border-cyan-400/30 bg-slate-900 shadow-2xl">
156
+ <img
157
+ src={avatarBase64}
158
+ alt="AndesOps Superhero"
159
+ className="w-full h-full object-cover"
160
+ />
161
+ </div>
162
+ </div>
163
+ </div>
164
+ <div className="order-1 md:order-2 space-y-6">
165
+ <h3 className="text-4xl font-black text-white tracking-tighter uppercase italic">
166
+ The <span className="text-cyan">Cognitive</span> Superhero
167
+ </h3>
168
+ <p className="text-xl text-slate-300 leading-relaxed font-light">
169
+ Built on the likeness of its creator, the <span className="font-bold text-white">AndesOps Cognitive Hero</span> is the manifestation of our AI architecture.
170
+ Equipped with neural-tech interfaces and powered by <span className="text-purple-400 font-bold">AMD Instinct™</span>,
171
+ it processes thousands of tender requirements in seconds, identifying risks and strategies with superhuman precision.
172
+ </p>
173
+ <div className="flex items-center gap-4 text-cyan-400 font-mono text-sm uppercase tracking-widest">
174
+ <span className="p-2 bg-cyan-500/20 rounded-lg">GEN-AI v2.0</span>
175
+ <span>•</span>
176
+ <span>AMD OPTIMIZED</span>
177
+ </div>
178
+ </div>
179
+ </div>
180
+ </div>
181
 
182
  {/* Agents Section */}
183
  <div className="space-y-6">
frontend/lib/avatar.ts CHANGED
The diff for this file is too large to render. See raw diff
 
frontend/lib/user_photo.ts ADDED
The diff for this file is too large to render. See raw diff
 
scratch/clean_avatar.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ file_path = r'c:\laragon\www\ANDESAI\frontend\lib\avatar.ts'
4
+
5
+ if os.path.exists(file_path):
6
+ with open(file_path, 'r', encoding='utf-8') as f:
7
+ content = f.read()
8
+
9
+ # Remove BOM (U+FEFF) if present
10
+ cleaned_content = content.replace('\ufeff', '')
11
+
12
+ with open(file_path, 'w', encoding='utf-8') as f:
13
+ f.write(cleaned_content)
14
+ print("Cleaned avatar.ts: Removed BOM/hidden characters.")
15
+ else:
16
+ print("File not found.")
scratch/convert_avatar.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import os
3
+
4
+ img_path = r'C:\Users\alvar\.gemini\antigravity\brain\7ca47da0-0002-44a0-91f1-6d45a9cee3d3\superhero_beach_avatar_v3_1778257054253.png'
5
+ out_path = r'frontend\lib\avatar.ts'
6
+
7
+ with open(img_path, 'rb') as img_file:
8
+ b64_string = base64.b64encode(img_file.read()).decode('utf-8')
9
+
10
+ with open(out_path, 'w', encoding='utf-8') as out_file:
11
+ out_file.write(f"export const avatarBase64 = 'data:image/png;base64,{b64_string}';\n")
12
+
13
+ print(f"Successfully created {out_path} with Beach Avatar v3")
scratch/convert_user_photo.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import os
3
+
4
+ photo_path = r'C:\Users\alvar\.gemini\antigravity\brain\9f5679b0-520e-4bf6-814a-3c05259885ca\media__1778287463337.jpg'
5
+ output_path = r'c:\laragon\www\ANDESAI\frontend\lib\user_photo.ts'
6
+
7
+ if os.path.exists(photo_path):
8
+ with open(photo_path, "rb") as image_file:
9
+ encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
10
+
11
+ with open(output_path, 'w', encoding='utf-8') as f:
12
+ f.write(f'export const userPhotoBase64 = "data:image/jpeg;base64,{encoded_string}";\n')
13
+ print("Generated user_photo.ts from user's image.")
14
+ else:
15
+ print(f"Photo not found at {photo_path}")
scratch/update_avatar_v5.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ # Try different encodings
4
+ encodings = ['utf-16le', 'utf-8', 'latin-1']
5
+ b64 = ""
6
+ for enc in encodings:
7
+ try:
8
+ with open('scratch/avatar_v5.txt', 'r', encoding=enc) as f:
9
+ b64 = f.read().strip()
10
+ if b64: break
11
+ except:
12
+ continue
13
+
14
+ if b64:
15
+ content = f'export const avatarBase64 = "data:image/png;base64,{b64}";\n'
16
+ with open('frontend/lib/avatar.ts', 'w', encoding='utf-8') as f:
17
+ f.write(content)
18
+ print("Success updated avatar.ts")
19
+ else:
20
+ print("Failed to read b64")
scratch/update_superhero_avatar.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import os
3
+
4
+ # The superhero image I just generated
5
+ superhero_path = r'C:\Users\alvar\.gemini\antigravity\brain\9f5679b0-520e-4bf6-814a-3c05259885ca\andesops_superhero_avatar_1778288943734.png'
6
+ output_path = r'c:\laragon\www\ANDESAI\frontend\lib\avatar.ts'
7
+
8
+ if os.path.exists(superhero_path):
9
+ with open(superhero_path, "rb") as image_file:
10
+ encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
11
+
12
+ with open(output_path, 'w', encoding='utf-8') as f:
13
+ f.write(f'export const avatarBase64 = "data:image/png;base64,{encoded_string}";\n')
14
+ print("Updated avatar.ts with the new Superhero image.")
15
+ else:
16
+ print(f"Superhero image not found at {superhero_path}")