Skip to content

Commit 344ac6a

Browse files
committed
FIX cloud size
1 parent ebeb0f4 commit 344ac6a

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

docs-src/src/components/cloud.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
1010

1111
interface CloudProps {
1212
darkMode?: boolean;
13+
style?: CSSProperties;
14+
className?: string;
1315
}
1416

1517
// Old icon slides out to the RIGHT; new icon slides in from the LEFT
16-
export const Cloud: FC<CloudProps> = ({ darkMode = false }) => {
18+
export const Cloud: FC<CloudProps> = ({ darkMode = false, style, className }) => {
1719
const [, setIconIndex] = useState(0);
1820
const [currentUrl, setCurrentUrl] = useState<string>(replicationLinks[0].iconUrl);
1921
const [prevUrl, setPrevUrl] = useState<string | undefined>(undefined);
2022

2123
const prevRef = useRef<HTMLImageElement | null>(null);
2224
const currRef = useRef<HTMLImageElement | null>(null);
2325

24-
2526
// Handle "heartbeat": advance to next icon and trigger slide transition
2627
useEffect(() => {
2728
if (!ExecutionEnvironment.canUseDOM) {
@@ -74,6 +75,7 @@ export const Cloud: FC<CloudProps> = ({ darkMode = false }) => {
7475
alignItems: 'center',
7576
justifyContent: 'center',
7677
borderRadius: 12,
78+
...style, // merge custom style
7779
};
7880

7981
const badgeStyle: CSSProperties = {
@@ -87,8 +89,8 @@ export const Cloud: FC<CloudProps> = ({ darkMode = false }) => {
8789
const circleBorder: string = darkMode ? 'var(--bg-color-dark)' : 'var(--bg-color)';
8890

8991
const badgeInnerStyle: CSSProperties = {
90-
width: 'clamp(10px, 8vw, 56px)',
91-
height: 'clamp(10px, 8vw, 56px)',
92+
width: '56px',
93+
height: '56px',
9294
background: circleColor,
9395
borderRadius: '50%',
9496
display: 'flex',
@@ -109,7 +111,7 @@ export const Cloud: FC<CloudProps> = ({ darkMode = false }) => {
109111
};
110112

111113
return (
112-
<div style={wrapperStyle}>
114+
<div style={wrapperStyle} className={className}>
113115
<svg
114116
xmlns="http://www.w3.org/2000/svg"
115117
width="126"

docs-src/src/components/replication-diagram.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ export function ReplicationDiagram({ scale: scaleProp = 1 }: { scale?: number; }
5656
const centerX = 250 * scale;
5757
const centerY = 200 * scale;
5858

59-
const serverRadius = 35 * scale;
59+
const serverRadius = 60 * scale;
6060
const deviceCount = devices.length;
61-
const deviceRadius = 55 * scale;
61+
const deviceRadius = 45 * scale;
6262

6363
const deviceDistance = centerY - deviceRadius; // top-most device sits at y=0
6464
const angleOffset = -Math.PI / 2;
6565

66-
const serverMargin = 10;
67-
const deviceMargin = 0;
66+
const serverMargin = 3;
67+
const deviceMargin = 7;
6868

6969
const linesData = Array.from({ length: deviceCount }, (_, i) => {
7070
const angle = angleOffset + (2 * Math.PI * i) / deviceCount;
@@ -161,7 +161,7 @@ export function ReplicationDiagram({ scale: scaleProp = 1 }: { scale?: number; }
161161
}}
162162
>
163163
<Cloud darkMode={true} style={{
164-
width: '140%'
164+
width: '100%'
165165
}} />
166166
</div>
167167

0 commit comments

Comments
 (0)