Commit ·
8a573f8
1
Parent(s): d9f7125
added some intro animations
Browse filesFiles changed (3)
- src/App.tsx+7-4
- src/Initialize.tsx+24-10
- src/index.css+66
52 unmodified lines5354555657585913 unmodified lines73747576777879808182838485862 unmodified lines8990919293949552 unmodified lines<span className="font-bold flex items-center justify-center gap-1"><imgsrc="hf-logo.svg"alt="Gemma Logo"className="block"style={{width: "1.2em",13 unmodified linesisInitializing={isInitializing}/>)}<footer className="p-8 pt-0 text-center text-muted-foreground text-xs md:text-sm"><p>High-quality translations across 56 languages powered by{" "}<ahref="https://blog.google/technology/developers/gemma-open-models/"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline">Google's TranslateGemma</a>{" "}2 unmodified lineshref="https://huggingface.co/docs/transformers.js"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline">Transformers.js</a>{" "}52 unmodified lines5354555657585913 unmodified lines73747576777879808182838485868788892 unmodified lines9293949596979852 unmodified lines<span className="font-bold flex items-center justify-center gap-1"><imgsrc="hf-logo.svg"alt="Transformers.js Logo"className="block"style={{width: "1.2em",13 unmodified linesisInitializing={isInitializing}/>)}<footerclassName="p-8 pt-0 text-center text-muted-foreground text-xs md:text-sm animate-fade-in"style={{ animationDelay: "0.5s", opacity: 0 }}><p>High-quality translations across 56 languages powered by{" "}<ahref="https://blog.google/technology/developers/gemma-open-models/"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline underline-offset-2 transition-all hover:underline-offset-4">Google's TranslateGemma</a>{" "}2 unmodified lineshref="https://huggingface.co/docs/transformers.js"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline underline-offset-2 transition-all hover:underline-offset-4">Transformers.js</a>{" "}
16 unmodified lines1718192021222324252627286 unmodified lines35363738394041424344454647484 unmodified lines535455565758596 unmodified lines66676869707172737475767778798081828384854 unmodified lines9091929394959616 unmodified linesclassName = "",}: InitializeProps) {return (<div className={cn("max-w-2xl mx-auto px-8", className)}><div className="bg-white rounded-lg shadow-md p-8 border border-border"><div className="flex flex-col items-center gap-6">{/* Description */}<div className="space-y-4 text-left w-full"><div><h3 className="font-semibold text-base mb-1">About TranslateGemma 4B</h3>6 unmodified lineshref="https://blog.google/innovation-and-ai/technology/developers-tools/translategemma/"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline">Learn more</a></p></div><div><h3 className="font-semibold text-base mb-1">Completely private & offline-capable</h3>4 unmodified lines</p></div><div><h3 className="font-semibold text-base mb-1">Experimental — WebGPU required</h3>6 unmodified lines{/* Initialize button or progress indicator */}{isInitializing ? (<div className="w-full space-y-2"><div className="flex justify-between items-center"><span className="text-sm font-medium text-muted-foreground">Loading model...</span><span className="text-sm font-medium text-primary">{progress}%</span></div><div className="w-full bg-muted rounded-full h-2 overflow-hidden"><divclassName="bg-primary h-full transition-all duration-300 ease-out"style={{ width: `${progress}%` }}/></div><p className="text-xs text-muted-foreground text-center">This may take a few moments. Please don't close the page.4 unmodified linesvariant="primary"onClick={onInitialize}disabled={isInitializing}className="text-lg mt-8">{isInitializing? "Initializing..."16 unmodified lines1718192021222324252627282930316 unmodified lines38394041424344454647484950515253544 unmodified lines596061626364656667686 unmodified lines757677787980818283848586878889909192939495969798994 unmodified lines10410510610710810911016 unmodified linesclassName = "",}: InitializeProps) {return (<div className={cn("max-w-2xl mx-auto px-8 animate-fade-in-up", className)}><div className="bg-white rounded-lg shadow-md p-8 border border-border"><div className="flex flex-col items-center gap-6">{/* Description */}<div className="space-y-4 text-left w-full"><divclassName="animate-fade-in-up"style={{ animationDelay: "0.1s", opacity: 0 }}><h3 className="font-semibold text-base mb-1">About TranslateGemma 4B</h3>6 unmodified lineshref="https://blog.google/innovation-and-ai/technology/developers-tools/translategemma/"target="_blank"rel="noopener noreferrer"className="text-primary hover:underline underline-offset-2 transition-all hover:underline-offset-4">Learn more</a></p></div><divclassName="animate-fade-in-up"style={{ animationDelay: "0.2s", opacity: 0 }}><h3 className="font-semibold text-base mb-1">Completely private & offline-capable</h3>4 unmodified lines</p></div><divclassName="animate-fade-in-up"style={{ animationDelay: "0.3s", opacity: 0 }}><h3 className="font-semibold text-base mb-1">Experimental — WebGPU required</h3>6 unmodified lines{/* Initialize button or progress indicator */}{isInitializing ? (<divclassName="w-full space-y-2 animate-fade-in-up"style={{ animationDelay: "0.4s", opacity: 0 }}><div className="flex justify-between items-center"><span className="text-sm font-medium text-muted-foreground">Loading model...</span><span className="text-sm font-medium text-primary animate-pulse-soft">{progress}%</span></div><div className="w-full bg-muted rounded-full h-2 overflow-hidden"><divclassName="bg-primary h-full transition-all duration-300 ease-out relative overflow-hidden"style={{ width: `${progress}%` }}><div className="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-[shimmer_2s_infinite]" /></div></div><p className="text-xs text-muted-foreground text-center">This may take a few moments. Please don't close the page.4 unmodified linesvariant="primary"onClick={onInitialize}disabled={isInitializing}className="text-lg! mt-4">{isInitializing? "Initializing..."
63 unmodified lines64656663 unmodified lines#root {min-height: 100vh;}63 unmodified lines64656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113263 unmodified lines#root {min-height: 100vh;}/* Micro-animations */@keyframes fadeInUp {from {opacity: 0;transform: translateY(20px);}to {opacity: 1;transform: translateY(0);}}@keyframes fadeIn {from {opacity: 0;}to {opacity: 1;}}@keyframes float {0%,100% {transform: translateY(0px);}50% {transform: translateY(-5px);}}@keyframes pulse-soft {0%,100% {opacity: 1;}50% {opacity: 0.8;}}@keyframes shimmer {0% {background-position: -200% center;}100% {background-position: 200% center;}}.animate-fade-in-up {animation: fadeInUp 0.6s ease-out forwards;}.animate-fade-in {animation: fadeIn 0.6s ease-out forwards;}.animate-float {animation: float 3s ease-in-out infinite;}.animate-pulse-soft {animation: pulse-soft 2s ease-in-out infinite;}
src/App.tsx+7-4
src/Initialize.tsx+24-10
src/index.css+66