PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.31
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.31
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / scripts / shared / UIComponents / UISpinner.tsx

UISpinner.tsx in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.0.31, at scripts/shared/UIComponents/UISpinner.tsx

79 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react';
2 import { styled } from '@linaria/react';
3 import { CALYPSO_MEDIUM, CALYPSO } from './colors';
4
5 const SpinnerOuter = styled.div`
6 align-items: center;
7 color: #00a4bd;
8 display: flex;
9 flex-direction: column;
10 justify-content: center;
11 width: 100%;
12 height: 100%;
13 margin: '2px';
14 `;
15
16 const SpinnerInner = styled.div`
17 align-items: center;
18 display: flex;
19 justify-content: center;
20 width: 100%;
21 height: 100%;
22 `;
23
24 interface IColorProp {
25 color: string;
26 }
27
28 const Circle = styled.circle<IColorProp>`
29 fill: none;
30 stroke: ${props => props.color};
31 stroke-width: 5;
32 stroke-linecap: round;
33 transform-origin: center;
34 `;
35
36 const AnimatedCircle = styled.circle<IColorProp>`
37 fill: none;
38 stroke: ${props => props.color};
39 stroke-width: 5;
40 stroke-linecap: round;
41 transform-origin: center;
42 animation: dashAnimation 2s ease-in-out infinite,
43 spinAnimation 2s linear infinite;
44
45 @keyframes dashAnimation {
46 0% {
47 stroke-dasharray: 1, 150;
48 stroke-dashoffset: 0;
49 }
50
51 50% {
52 stroke-dasharray: 90, 150;
53 stroke-dashoffset: -50;
54 }
55
56 100% {
57 stroke-dasharray: 90, 150;
58 stroke-dashoffset: -140;
59 }
60 }
61
62 @keyframes spinAnimation {
63 transform: rotate(360deg);
64 }
65 `;
66
67 export default function UISpinner({ size = 20 }) {
68 return (
69 <SpinnerOuter>
70 <SpinnerInner>
71 <svg height={size} width={size} viewBox="0 0 50 50">
72 <Circle color={CALYPSO_MEDIUM} cx="25" cy="25" r="22.5" />
73 <AnimatedCircle color={CALYPSO} cx="25" cy="25" r="22.5" />
74 </svg>
75 </SpinnerInner>
76 </SpinnerOuter>
77 );
78 }
79