Merge pull request #305 from langflow-ai/branding-animations
Update branding
This commit is contained in:
commit
dc0d047c88
5 changed files with 285 additions and 70 deletions
|
|
@ -3,20 +3,77 @@ interface DogIconProps extends React.SVGProps<SVGSVGElement> {
|
|||
}
|
||||
|
||||
const DogIcon = ({ disabled = false, stroke, ...props }: DogIconProps) => {
|
||||
const fillColor = disabled ? "#71717A" : (stroke || "#22A7AF");
|
||||
const fillColor = disabled ? "#71717A" : (stroke || "#773EFF");
|
||||
|
||||
// CSS for the stepped animation states
|
||||
const animationCSS = `
|
||||
.state1 { animation: showState1 600ms infinite; }
|
||||
.state2 { animation: showState2 600ms infinite; }
|
||||
.state3 { animation: showState3 600ms infinite; }
|
||||
.state4 { animation: showState4 600ms infinite; }
|
||||
|
||||
@keyframes showState1 {
|
||||
0%, 24.99% { opacity: 1; }
|
||||
25%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState2 {
|
||||
0%, 24.99% { opacity: 0; }
|
||||
25%, 49.99% { opacity: 1; }
|
||||
50%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState3 {
|
||||
0%, 49.99% { opacity: 0; }
|
||||
50%, 74.99% { opacity: 1; }
|
||||
75%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState4 {
|
||||
0%, 74.99% { opacity: 0; }
|
||||
75%, 100% { opacity: 1; }
|
||||
}
|
||||
`;
|
||||
|
||||
return (
|
||||
disabled ? (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 18" fill={fillColor}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 18" fill={fillColor} {...props}>
|
||||
<path d="M8 18H2V16H8V18Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20 2H22V6H24V10H20V14H24V16H14V14H2V16H0V8H2V6H8V10H10V12H16V6H14V10H12V8H10V2H12V0H20V2ZM18 6H20V4H18V6Z"/>
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M20 2H22V6H24V10H20V14H24V16H14V14H2V16H0V8H2V6H8V10H10V12H16V6H14V10H12V8H10V2H12V0H20V2ZM18 6H20V4H18V6Z"/>
|
||||
</svg>
|
||||
) : (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="20" viewBox="0 0 24 20" fill={fillColor}>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.0769 10.9091H16.6154V5.45455H14.7692V9.09091H12.9231V7.27273H11.0769V1.81818H12.9231V0H20.3077V1.81818H22.1538V5.45455H24V9.09091H20.3077V14.5455H18.4615V20H14.7692V16.3636H12.9231V14.5455H7.38462V16.3636H5.53846V20H1.84615V10.9091H3.69231V9.09091H11.0769V10.9091ZM18.4615 5.45455H20.3077V3.63636H18.4615V5.45455Z"/>
|
||||
<path d="M1.84615 10.9091H0V7.27273H1.84615V10.9091Z"/>
|
||||
<path d="M3.69231 7.27273H1.84615V5.45455H3.69231V7.27273Z"/>
|
||||
<path d="M5.53846 5.45455H3.69231V3.63636H5.53846V5.45455Z"/>
|
||||
<svg width="105" height="77" viewBox="0 0 105 77" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style dangerouslySetInnerHTML={{ __html: animationCSS }} />
|
||||
</defs>
|
||||
|
||||
{/* State 1 - Add 14px left padding to align with state 3 */}
|
||||
<g className="state1">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M56 42H77V21H70V35H63V28H56V7H63V0H91V7H98V21H105V35H91V56H84V77H70V63H63V56H42V63H35V77H21V42H28V35H56V42ZM84 21H91V14H84V21Z" fill={fillColor}/>
|
||||
<path d="M21 42H14V28H21V42Z" fill={fillColor}/>
|
||||
<path d="M28 28H21V21H28V28Z" fill={fillColor}/>
|
||||
<path d="M35 21H28V14H35V21Z" fill={fillColor}/>
|
||||
</g>
|
||||
|
||||
{/* State 2 - Add 14px left padding to align with state 3 */}
|
||||
<g className="state2">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M56 42H77V21H70V35H63V28H56V7H63V0H91V7H98V21H105V35H91V56H84V77H70V63H63V56H42V63H35V77H21V42H28V35H56V42ZM84 21H91V14H84V21Z" fill={fillColor}/>
|
||||
<path d="M21 42H14V14H21V42Z" fill={fillColor}/>
|
||||
</g>
|
||||
|
||||
{/* State 3 - Already properly positioned */}
|
||||
<g className="state3">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M56 42H77V21H70V35H63V28H56V7H63V0H91V7H98V21H105V35H91V56H84V77H70V63H63V56H42V63H35V77H21V42H28V35H56V42ZM84 21H91V14H84V21Z" fill={fillColor}/>
|
||||
<path d="M21 42H14V28H21V42Z" fill={fillColor}/>
|
||||
<path d="M14 28H7V21H14V28Z" fill={fillColor}/>
|
||||
<path d="M7 21H0V14H7V21Z" fill={fillColor}/>
|
||||
</g>
|
||||
|
||||
{/* State 4 - Add 14px left padding to align with state 3 */}
|
||||
<g className="state4">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M56 42H77V21H70V35H63V28H56V7H63V0H91V7H98V21H105V35H91V56H84V77H70V63H63V56H42V63H35V77H21V42H28V35H56V42ZM84 21H91V14H84V21Z" fill={fillColor}/>
|
||||
<path d="M21 42H14V14H21V42Z" fill={fillColor}/>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ interface AssistantMessageProps {
|
|||
showForkButton?: boolean;
|
||||
onFork?: (e: React.MouseEvent) => void;
|
||||
isCompleted?: boolean;
|
||||
isInactive?: boolean;
|
||||
animate?: boolean;
|
||||
delay?: number;
|
||||
}
|
||||
|
|
@ -31,6 +32,7 @@ export function AssistantMessage({
|
|||
showForkButton = false,
|
||||
onFork,
|
||||
isCompleted = false,
|
||||
isInactive = false,
|
||||
animate = true,
|
||||
delay = 0.2,
|
||||
}: AssistantMessageProps) {
|
||||
|
|
@ -47,7 +49,7 @@ export function AssistantMessage({
|
|||
<div className="w-8 h-8 rounded-lg bg-accent/20 flex items-center justify-center flex-shrink-0 select-none">
|
||||
<DogIcon
|
||||
className="h-6 w-6 transition-colors duration-300"
|
||||
disabled={isCompleted}
|
||||
disabled={isCompleted || isInactive}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1209,7 +1209,7 @@ function ChatPage() {
|
|||
className="space-y-6 group"
|
||||
>
|
||||
<UserMessage
|
||||
animate={message.source !== "langflow"}
|
||||
animate={message.source ? message.source !== "langflow" : false}
|
||||
content={message.content}
|
||||
files={
|
||||
index >= 2
|
||||
|
|
@ -1241,6 +1241,7 @@ function ChatPage() {
|
|||
showForkButton={endpoint === "chat"}
|
||||
onFork={(e) => handleForkConversation(index, e)}
|
||||
animate={false}
|
||||
isInactive={index < messages.length - 1}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -1257,6 +1258,7 @@ function ChatPage() {
|
|||
onToggle={toggleFunctionCall}
|
||||
delay={0.4}
|
||||
isStreaming
|
||||
isCompleted={false}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export function ProgressBar({ currentStep, totalSteps }: ProgressBarProps) {
|
|||
className="h-full transition-all duration-300 ease-in-out"
|
||||
style={{
|
||||
width: `${progressPercentage}%`,
|
||||
background: 'linear-gradient(to right, #818CF8, #22A7AF)'
|
||||
background: 'linear-gradient(to right, #773EFF, #22A7AF)'
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,70 +1,224 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
import { motion, easeInOut } from "framer-motion";
|
||||
|
||||
export const AnimatedProcessingIcon = ({
|
||||
const AnimatedProcessingIcon = ({
|
||||
className,
|
||||
props,
|
||||
}: {
|
||||
className?: string;
|
||||
props?: React.SVGProps<SVGSVGElement>;
|
||||
}) => {
|
||||
const createAnimationFrames = (delay: number) => ({
|
||||
opacity: [1, 1, 0.5, 0], // Opacity Steps
|
||||
transition: {
|
||||
delay,
|
||||
duration: 1,
|
||||
ease: easeInOut,
|
||||
repeat: Infinity,
|
||||
times: [0, 0.33, 0.66, 1], // Duration Percentages that Correspond to opacity Array
|
||||
},
|
||||
});
|
||||
// CSS for the stepped animation states
|
||||
const animationCSS = `
|
||||
.state-1 { opacity: 1; animation: showState1 1.5s infinite steps(1, end); }
|
||||
.state-2 { opacity: 0; animation: showState2 1.5s infinite steps(1, end); }
|
||||
.state-3 { opacity: 0; animation: showState3 1.5s infinite steps(1, end); }
|
||||
.state-4 { opacity: 0; animation: showState4 1.5s infinite steps(1, end); }
|
||||
.state-5 { opacity: 0; animation: showState5 1.5s infinite steps(1, end); }
|
||||
.state-6 { opacity: 0; animation: showState6 1.5s infinite steps(1, end); }
|
||||
|
||||
@keyframes showState1 {
|
||||
0%, 16.66% { opacity: 1; }
|
||||
16.67%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState2 {
|
||||
0%, 16.66% { opacity: 0; }
|
||||
16.67%, 33.33% { opacity: 1; }
|
||||
33.34%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState3 {
|
||||
0%, 33.33% { opacity: 0; }
|
||||
33.34%, 50% { opacity: 1; }
|
||||
50.01%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState4 {
|
||||
0%, 50% { opacity: 0; }
|
||||
50.01%, 66.66% { opacity: 1; }
|
||||
66.67%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState5 {
|
||||
0%, 66.66% { opacity: 0; }
|
||||
66.67%, 83.33% { opacity: 1; }
|
||||
83.34%, 100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes showState6 {
|
||||
0%, 83.33% { opacity: 0; }
|
||||
83.34%, 100% { opacity: 1; }
|
||||
}
|
||||
`;
|
||||
|
||||
return (
|
||||
<svg
|
||||
data-testid="rotating-dot-animation"
|
||||
className={cn("h-[10px] w-[6px]", className)}
|
||||
viewBox="0 0 6 10"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className={className}
|
||||
{...props}
|
||||
>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0)}
|
||||
fill="currentColor"
|
||||
cx="1"
|
||||
cy="1"
|
||||
r="1"
|
||||
/>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0.16)}
|
||||
fill="currentColor"
|
||||
cx="1"
|
||||
cy="5"
|
||||
r="1"
|
||||
/>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0.33)}
|
||||
fill="currentColor"
|
||||
cx="1"
|
||||
cy="9"
|
||||
r="1"
|
||||
/>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0.83)}
|
||||
fill="currentColor"
|
||||
cx="5"
|
||||
cy="1"
|
||||
r="1"
|
||||
/>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0.66)}
|
||||
fill="currentColor"
|
||||
cx="5"
|
||||
cy="5"
|
||||
r="1"
|
||||
/>
|
||||
<motion.circle
|
||||
animate={createAnimationFrames(0.5)}
|
||||
fill="currentColor"
|
||||
cx="5"
|
||||
cy="9"
|
||||
r="1"
|
||||
/>
|
||||
{/* Inject animation styles into the SVG's shadow */}
|
||||
<style dangerouslySetInnerHTML={{ __html: animationCSS }} />
|
||||
|
||||
{/* State 1 */}
|
||||
<g className="state-1">
|
||||
<rect
|
||||
x="-19.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
</g>
|
||||
|
||||
{/* State 2 */}
|
||||
<g className="state-2">
|
||||
<rect
|
||||
x="-53.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
<path
|
||||
d="M7.625 20.375H8V20.75H8.375V22.25H8V23H5V22.25H4.625V20.75H5V20.375H5.375V19.625H7.625V20.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 20H3.125V18.5H4.625V20Z" fill="currentColor" />
|
||||
<path d="M9.875 20H8.375V18.5H9.875V20Z" fill="currentColor" />
|
||||
<path d="M6.125 18.5H4.625V17H6.125V18.5Z" fill="currentColor" />
|
||||
<path d="M8.375 18.5H6.875V17H8.375V18.5Z" fill="currentColor" />
|
||||
</g>
|
||||
|
||||
{/* State 3 */}
|
||||
<g className="state-3">
|
||||
<rect
|
||||
x="-87.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
<path
|
||||
d="M7.625 20.375H8V20.75H8.375V22.25H8V23H5V22.25H4.625V20.75H5V20.375H5.375V19.625H7.625V20.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 20H3.125V18.5H4.625V20Z" fill="currentColor" />
|
||||
<path d="M9.875 20H8.375V18.5H9.875V20Z" fill="currentColor" />
|
||||
<path d="M6.125 18.5H4.625V17H6.125V18.5Z" fill="currentColor" />
|
||||
<path d="M8.375 18.5H6.875V17H8.375V18.5Z" fill="currentColor" />
|
||||
<path
|
||||
d="M18.625 12.375H19V12.75H19.375V14.25H19V15H16V14.25H15.625V12.75H16V12.375H16.375V11.625H18.625V12.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M15.625 12H14.125V10.5H15.625V12Z" fill="currentColor" />
|
||||
<path d="M20.875 12H19.375V10.5H20.875V12Z" fill="currentColor" />
|
||||
<path d="M17.125 10.5H15.625V9H17.125V10.5Z" fill="currentColor" />
|
||||
<path d="M19.375 10.5H17.875V9H19.375V10.5Z" fill="currentColor" />
|
||||
</g>
|
||||
|
||||
{/* State 4 */}
|
||||
<g className="state-4">
|
||||
<rect
|
||||
x="-122.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
<path
|
||||
d="M7.625 4.375H8V4.75H8.375V6.25H8V7H5V6.25H4.625V4.75H5V4.375H5.375V3.625H7.625V4.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 4H3.125V2.5H4.625V4Z" fill="currentColor" />
|
||||
<path d="M9.875 4H8.375V2.5H9.875V4Z" fill="currentColor" />
|
||||
<path d="M6.125 2.5H4.625V1H6.125V2.5Z" fill="currentColor" />
|
||||
<path d="M8.375 2.5H6.875V1H8.375V2.5Z" fill="currentColor" />
|
||||
<g opacity="0.25">
|
||||
<path
|
||||
d="M7.625 20.375H8V20.75H8.375V22.25H8V23H5V22.25H4.625V20.75H5V20.375H5.375V19.625H7.625V20.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 20H3.125V18.5H4.625V20Z" fill="currentColor" />
|
||||
<path d="M9.875 20H8.375V18.5H9.875V20Z" fill="currentColor" />
|
||||
<path d="M6.125 18.5H4.625V17H6.125V18.5Z" fill="currentColor" />
|
||||
<path d="M8.375 18.5H6.875V17H8.375V18.5Z" fill="currentColor" />
|
||||
</g>
|
||||
<path
|
||||
d="M18.625 12.375H19V12.75H19.375V14.25H19V15H16V14.25H15.625V12.75H16V12.375H16.375V11.625H18.625V12.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M15.625 12H14.125V10.5H15.625V12Z" fill="currentColor" />
|
||||
<path d="M20.875 12H19.375V10.5H20.875V12Z" fill="currentColor" />
|
||||
<path d="M17.125 10.5H15.625V9H17.125V10.5Z" fill="currentColor" />
|
||||
<path d="M19.375 10.5H17.875V9H19.375V10.5Z" fill="currentColor" />
|
||||
</g>
|
||||
|
||||
{/* State 5 */}
|
||||
<g className="state-5">
|
||||
<rect
|
||||
x="-156.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
<path
|
||||
d="M7.625 4.375H8V4.75H8.375V6.25H8V7H5V6.25H4.625V4.75H5V4.375H5.375V3.625H7.625V4.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 4H3.125V2.5H4.625V4Z" fill="currentColor" />
|
||||
<path d="M9.875 4H8.375V2.5H9.875V4Z" fill="currentColor" />
|
||||
<path d="M6.125 2.5H4.625V1H6.125V2.5Z" fill="currentColor" />
|
||||
<path d="M8.375 2.5H6.875V1H8.375V2.5Z" fill="currentColor" />
|
||||
<g opacity="0.25">
|
||||
<path
|
||||
d="M18.625 12.375H19V12.75H19.375V14.25H19V15H16V14.25H15.625V12.75H16V12.375H16.375V11.625H18.625V12.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M15.625 12H14.125V10.5H15.625V12Z" fill="currentColor" />
|
||||
<path d="M20.875 12H19.375V10.5H20.875V12Z" fill="currentColor" />
|
||||
<path d="M17.125 10.5H15.625V9H17.125V10.5Z" fill="currentColor" />
|
||||
<path d="M19.375 10.5H17.875V9H19.375V10.5Z" fill="currentColor" />
|
||||
</g>
|
||||
</g>
|
||||
|
||||
{/* State 6 */}
|
||||
<g className="state-6">
|
||||
<rect
|
||||
x="-190.5"
|
||||
y="-19.5"
|
||||
width="230.242"
|
||||
height="63"
|
||||
rx="4.5"
|
||||
stroke="#9747FF"
|
||||
strokeDasharray="10 5"
|
||||
/>
|
||||
<g opacity="0.25">
|
||||
<path
|
||||
d="M7.625 4.375H8V4.75H8.375V6.25H8V7H5V6.25H4.625V4.75H5V4.375H5.375V3.625H7.625V4.375Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<path d="M4.625 4H3.125V2.5H4.625V4Z" fill="currentColor" />
|
||||
<path d="M9.875 4H8.375V2.5H9.875V4Z" fill="currentColor" />
|
||||
<path d="M6.125 2.5H4.625V1H6.125V2.5Z" fill="currentColor" />
|
||||
<path d="M8.375 2.5H6.875V1H8.375V2.5Z" fill="currentColor" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
|
||||
export default AnimatedProcessingIcon;
|
||||
Loading…
Add table
Reference in a new issue