Abdullahrasheed45 commited on
Commit
e91cb13
·
verified ·
1 Parent(s): 763440c

Create WelcomeScreen.tsx

Browse files
Files changed (1) hide show
  1. src/components/WelcomeScreen.tsx +191 -0
src/components/WelcomeScreen.tsx ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Button from "./Button";
2
+ import { useState, useEffect } from "react";
3
+ import { THEME } from "../constants";
4
+ import HfIcon from "./HfIcon";
5
+
6
+ interface WelcomeScreenProps {
7
+ onStart: () => void;
8
+ }
9
+
10
+ export default function WelcomeScreen({ onStart }: WelcomeScreenProps) {
11
+ const [mounted, setMounted] = useState(false);
12
+
13
+ useEffect(() => {
14
+ setMounted(true);
15
+ }, []);
16
+
17
+ return (
18
+ <>
19
+ <div
20
+ className="absolute inset-0 flex items-center justify-center p-6 overflow-y-auto"
21
+ style={{
22
+ backgroundColor: THEME.beigeLight,
23
+ backgroundImage: `
24
+ linear-gradient(${THEME.beigeDark} 1px, transparent 1px),
25
+ linear-gradient(90deg, ${THEME.beigeDark} 1px, transparent 1px)
26
+ `,
27
+ backgroundSize: "40px 40px",
28
+ color: THEME.textBlack,
29
+ }}
30
+ >
31
+ <div
32
+ className={`relative max-w-4xl w-full backdrop-blur-sm p-10 md:p-12 rounded-sm border shadow-2xl transition-all duration-700 ${mounted ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}`}
33
+ style={{
34
+ backgroundColor: `${THEME.beigeLight}F2`, // 95% opacity
35
+ borderColor: THEME.beigeDark,
36
+ }}
37
+ >
38
+ {/* 1. Top Right Status Indicator */}
39
+ <div className="absolute top-6 right-6 group cursor-help z-10">
40
+ <span className="absolute right-full mr-4 top-1/2 -translate-y-1/2 whitespace-nowrap text-xs font-mono uppercase tracking-widest text-gray-500 opacity-0 group-hover:opacity-100 transition-all duration-300 translate-x-2 group-hover:translate-x-0 pointer-events-none">
41
+ System Ready
42
+ </span>
43
+ <div className="relative flex h-3 w-3">
44
+ <span
45
+ className="animate-ping absolute inline-flex h-full w-full rounded-full opacity-75"
46
+ style={{ backgroundColor: THEME.mistralOrange }}
47
+ ></span>
48
+ <span
49
+ className="relative inline-flex rounded-sm h-3 w-3"
50
+ style={{ backgroundColor: THEME.mistralOrange }}
51
+ ></span>
52
+ </div>
53
+ </div>
54
+ <div className="space-y-12">
55
+ {/* Header Section */}
56
+ <div className="text-center space-y-4 animate-enter">
57
+ <div className="flex flex-col items-center justify-center space-y-5">
58
+ <div className="relative group">
59
+ <img
60
+ src="Ministral.png"
61
+ alt="Ministral Logo"
62
+ className="h-24 object-contain transition-transform duration-500 group-hover:scale-105 drop-shadow-sm"
63
+ />
64
+ </div>
65
+ <h1
66
+ className="text-6xl md:text-7xl font-semibold tracking-tighter"
67
+ style={{ color: THEME.textBlack }}
68
+ >
69
+ Ministral WebGPU
70
+ </h1>
71
+ </div>
72
+ <p className="text-xl md:text-2xl text-gray-600 max-w-2xl mx-auto font-light leading-relaxed">
73
+ Frontier multimodal AI, running entirely in your browser.
74
+ <br />
75
+ Powered by{" "}
76
+ <a
77
+ href="https://huggingface.co/mistralai/Ministral-3-3B-Instruct-2512-ONNX"
78
+ className="font-medium underline decoration-2 underline-offset-4 transition-all hover:decoration-[3px]"
79
+ style={{
80
+ color: THEME.mistralOrange,
81
+ textDecorationColor: THEME.mistralOrange,
82
+ }}
83
+ target="_blank"
84
+ rel="noopener noreferrer"
85
+ >
86
+ Ministral-3-3B
87
+ </a>
88
+ </p>
89
+ </div>
90
+ {/* Content Grid */}
91
+ <div
92
+ className="grid grid-cols-1 md:grid-cols-3 gap-8 border-t border-b py-10 animate-enter delay-100"
93
+ style={{ borderColor: THEME.beigeDark }}
94
+ >
95
+ {/* Feature 1 */}
96
+ <div className="space-y-3 group">
97
+ <div
98
+ className="w-10 h-10 flex items-center justify-center text-white font-bold text-lg shadow-sm transition-transform duration-300 group-hover:-translate-y-1"
99
+ style={{ backgroundColor: THEME.mistralOrange }}
100
+ >
101
+ 1
102
+ </div>
103
+ <h4
104
+ className="font-semibold text-xl"
105
+ style={{ color: THEME.textBlack }}
106
+ >
107
+ Load Model
108
+ </h4>
109
+ <p className="text-gray-600 leading-relaxed">
110
+ Downloads the optimized Ministral model (~3GB) directly to
111
+ your browser cache.
112
+ </p>
113
+ </div>
114
+ {/* Feature 2 */}
115
+ <div className="space-y-3 group">
116
+ <div
117
+ className="w-10 h-10 flex items-center justify-center text-white font-bold text-lg shadow-sm transition-transform duration-300 group-hover:-translate-y-1"
118
+ style={{ backgroundColor: THEME.mistralOrange }}
119
+ >
120
+ 2
121
+ </div>
122
+ <h4
123
+ className="font-semibold text-xl"
124
+ style={{ color: THEME.textBlack }}
125
+ >
126
+ Private & Local
127
+ </h4>
128
+ <p className="text-gray-600 leading-relaxed">
129
+ Your video feed is processed locally and never sent to a
130
+ server, powered by
131
+ <a href="https://github.com/huggingface/transformers.js">
132
+ <span className="font-medium underline">
133
+ <HfIcon className="size-6 ml-1 mt-[-1px] inline" />
134
+ Transformers.js
135
+ </span>
136
+ </a>
137
+ .
138
+ </p>
139
+ </div>
140
+ {/* Feature 3 */}
141
+ <div className="space-y-3 group">
142
+ <div
143
+ className="w-10 h-10 flex items-center justify-center text-white font-bold text-lg shadow-sm transition-transform duration-300 group-hover:-translate-y-1"
144
+ style={{ backgroundColor: THEME.mistralOrange }}
145
+ >
146
+ 3
147
+ </div>
148
+ <h4
149
+ className="font-semibold text-xl"
150
+ style={{ color: THEME.textBlack }}
151
+ >
152
+ Real-time Vision
153
+ </h4>
154
+ <p className="text-gray-600 leading-relaxed">
155
+ The model analyzes the current frame and responds to the
156
+ user's prompt.
157
+ </p>
158
+ </div>
159
+ </div>
160
+ {/* Action Area */}
161
+ <div className="flex flex-col items-center animate-enter delay-200">
162
+ <Button
163
+ onClick={onStart}
164
+ className="group relative px-8 py-5 text-white overflow-hidden transition-all hover:shadow-2xl hover:-translate-y-0.5"
165
+ >
166
+ <div className="absolute inset-0 bg-white/20 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-out" />
167
+ <span className="relative font-bold text-xl tracking-wide flex items-center gap-3">
168
+ START LIVE CAPTIONING
169
+ <svg
170
+ xmlns="http://www.w3.org/2000/svg"
171
+ fill="none"
172
+ viewBox="0 0 24 24"
173
+ strokeWidth={2.5}
174
+ stroke="currentColor"
175
+ className="w-5 h-5 transition-transform duration-300 group-hover:translate-x-1"
176
+ >
177
+ <path
178
+ strokeLinecap="round"
179
+ strokeLinejoin="round"
180
+ d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"
181
+ />
182
+ </svg>
183
+ </span>
184
+ </Button>
185
+ </div>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </>
190
+ );
191
+ }