Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
4f7bfc1
Feat: add diagram + components + packages
anegg0 Feb 6, 2025
8a6c056
fix: diagram format fix
anegg0 Feb 6, 2025
f761f87
fix: add Winnies original auction diagram
anegg0 Feb 6, 2025
d020b73
fix: readjust modal on top of other elements
anegg0 Feb 6, 2025
c798345
fix: remove old file
anegg0 Feb 6, 2025
843b3cf
fix: remove original static image
anegg0 Feb 6, 2025
7d40d99
fix: reformat
anegg0 Feb 6, 2025
c0050ea
fix: adjust modal font color
anegg0 Feb 6, 2025
5b74aa1
fix: adjust swelling dot color
anegg0 Feb 6, 2025
71dc5c0
fix: reformat
anegg0 Feb 6, 2025
a83b815
feat: implement multiple contents for <Modal/> component
anegg0 Feb 6, 2025
0bf35f9
feat: transform the number badge as a component
anegg0 Feb 6, 2025
a0dd534
feat: replace basic <Circle/> with <Number4/> inside of <Modal/>
anegg0 Feb 6, 2025
c25fc5a
feat: add animation to number components
anegg0 Feb 6, 2025
07e4b37
Revert "feat: add animation to number components"
anegg0 Feb 6, 2025
a329e83
feat: add effect to number5 component
anegg0 Feb 6, 2025
a00047e
fix: deleted deprecated <Circle/> component
anegg0 Feb 6, 2025
3818fbc
feat: add new reusable <NumberComponent/>
anegg0 Feb 6, 2025
00d642f
fix: adjust number 1,2,3,4 paths and styles
anegg0 Feb 7, 2025
19b8169
fix: removed deprecated number elements
anegg0 Feb 7, 2025
984b4e9
Revert "fix: removed deprecated number elements"
anegg0 Feb 7, 2025
58a6740
fix: remove first batch deprecated circle elements
anegg0 Feb 7, 2025
4b08eb1
fix: removal second batch deprecated circle elements
anegg0 Feb 7, 2025
1367cdb
fix: batch 4 removal deprecated circle elements
anegg0 Feb 7, 2025
c432d52
fix: batch 4 removal deprecated elements
anegg0 Feb 7, 2025
cb57e97
fix: final batch removal deprecated elements
anegg0 Feb 7, 2025
8802f8b
feat: make Modal take its content from modalContent.json
anegg0 Feb 7, 2025
303dbe8
fix: re-add Alice component
anegg0 Feb 7, 2025
6daa791
fix: removal unneeded number 5
anegg0 Feb 7, 2025
7c447e7
fix: removal deprecated number5
anegg0 Feb 7, 2025
f67f983
fix: cleaned up, functional diagram
anegg0 Feb 7, 2025
9d342a8
Fix: re-add label
anegg0 Feb 7, 2025
26cfc17
feat: define NumbersComponent offsets based on their number
anegg0 Feb 7, 2025
e410bc0
feat: better location argument passing
anegg0 Feb 7, 2025
dce35f7
fix: number symbol location fix
anegg0 Feb 7, 2025
14ac44d
feat: add remaining numbers
anegg0 Feb 7, 2025
d61448f
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 7, 2025
c956a77
feat: add tmp OG files
anegg0 Feb 7, 2025
6fc5a41
fix: adjust modals bg color
anegg0 Feb 7, 2025
ec5c3a4
fix: realign numbers within circle
anegg0 Feb 7, 2025
81dc682
feat: add code block rendering in modals
anegg0 Feb 7, 2025
c1ef728
fix: make modals size adjust to content
anegg0 Feb 7, 2025
cf16df6
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 7, 2025
a99c839
fix: example code block for Derek
anegg0 Feb 7, 2025
d102423
feat: add dark/light modes
anegg0 Feb 7, 2025
86110a5
fix: re-add animations in light mode
anegg0 Feb 7, 2025
5ce03b4
Fix: animate both dark & light mode
anegg0 Feb 7, 2025
0164d5b
feat: refactor NumberComponent
anegg0 Feb 8, 2025
93049bc
feat: refactor Modal.tsx
anegg0 Feb 8, 2025
765b471
feat: update files
anegg0 Feb 8, 2025
a47c550
Revert "feat: update files"
anegg0 Feb 8, 2025
03dfc9d
feat: refactor modal
anegg0 Feb 8, 2025
208e773
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 8, 2025
1f19e0c
fix: remove example files
anegg0 Feb 8, 2025
d916d08
feat: better positioning for NumberComponent
anegg0 Feb 8, 2025
7020f64
Revert "feat: better positioning for NumberComponent"
anegg0 Feb 8, 2025
29277ef
fix: add screen size responsiveness for modals
anegg0 Feb 8, 2025
1836613
fix: fit modal to all screens
anegg0 Feb 8, 2025
9809deb
feat: add smooth transitions on modal opening
anegg0 Feb 8, 2025
b92adc3
fix: reformat
anegg0 Feb 8, 2025
cbb9e0c
refactor: Replace Modal with static NumberComponent for number 1
anegg0 Feb 11, 2025
518c1c4
feat: Remove animation for NumberComponent when number is 1
anegg0 Feb 11, 2025
1e55a91
refactor: Replace Modal with NumberComponent for number 5
anegg0 Feb 11, 2025
7af7352
fix: Remove animation effects for number 5 in NumberComponent
anegg0 Feb 11, 2025
d1222bb
fix: first batch modal content corrections
anegg0 Feb 11, 2025
8b8dafd
fix: correct modal content
anegg0 Feb 12, 2025
8944bee
feat: Add clickable code link in modal with new interface and styling
anegg0 Feb 12, 2025
97926ac
fix: include links to codebase in modal
anegg0 Feb 12, 2025
e775985
refactor: Update modal content for Timeboost centralized auction steps
anegg0 Feb 13, 2025
7e7a331
docs: Update modalContent.json for timeboost_submitBid step details
anegg0 Feb 13, 2025
ed41956
refactor: Simplify Timeboost auction modal content structure
anegg0 Feb 13, 2025
7f23724
feat: Update modalContent.json with detailed auction process descript…
anegg0 Feb 13, 2025
274d795
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 13, 2025
ea858e3
Revert "Merge branch 'master' into diagrams-timeboost-gentle-intro"
anegg0 Feb 13, 2025
e5de653
refactor: Optimize NumberComponent with ButtonComponent import and an…
anegg0 Feb 19, 2025
d946810
fix: squash 23 commits.
anegg0 Feb 19, 2025
fbae238
Revert "feat: Ensure numbers 3 and 4 have consistent styling with num…
anegg0 Feb 20, 2025
b7cffc3
style: Change number circle background color to orange
anegg0 Feb 20, 2025
dc4f9bb
fix: Remove uneven crossfade animation for numbers
anegg0 Feb 20, 2025
fd4fad9
refactor: Extract constants and types for Timeboost CentralizedAuctio…
anegg0 Feb 20, 2025
2e21792
fix: Correct TypeScript type import syntax in NumberComponent
anegg0 Feb 20, 2025
08d5078
fix: Remove TypeScript annotations from JSX files
anegg0 Feb 20, 2025
ad8982b
feat: Add low-frequency blinking effect to numbers 2, 3, and 4
anegg0 Feb 20, 2025
0a5364b
feat: Enhance ButtonComponent visibility with hover and scaling effects
anegg0 Feb 20, 2025
7e9d148
feat: Add ButtonComponent to numbers 3 and 4 in NumberComponent
anegg0 Feb 20, 2025
097372b
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 20, 2025
04823bb
fix: re-add ImageZoom component sources
anegg0 Feb 20, 2025
5270728
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 20, 2025
64a942e
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 20, 2025
1fb33e4
feat: Implement crossfade blinking effect for white circles in Number…
anegg0 Feb 20, 2025
3204b62
perf: Reduce blinking animation duration to 500ms for faster effect
anegg0 Feb 20, 2025
6029bb9
feat: Convert modalContent.json to modalContent.mdx with auction proc…
anegg0 Feb 21, 2025
af04d00
feat: Update Modal.tsx to import MDX content instead of JSON
anegg0 Feb 21, 2025
0b86e1c
refactor: Update Modal component to use MDX rendering with MDXProvider
anegg0 Feb 21, 2025
0d75090
feat: Add @mdx-js/react dependency to website package.json
anegg0 Feb 21, 2025
1d5595c
refactor: Update Modal component with minor formatting and syntax adj…
anegg0 Feb 21, 2025
057a753
fix: Resolve TypeScript JSX namespace and dependency conflicts
anegg0 Feb 21, 2025
4edb61b
feat: tmp changes, prolly need reverting
anegg0 Feb 21, 2025
62ea45f
feat: Add modal content for centralized auction diagram
anegg0 Feb 21, 2025
791beb2
refactor: Split modalContent.mdx into separate step-specific MDX files
anegg0 Feb 21, 2025
458c6b5
refactor: Remove redundant stepTitles and simplify Modal component re…
anegg0 Feb 21, 2025
ddf6340
feat: remove unneeded components
anegg0 Feb 21, 2025
f161dbf
fix: update steps with outlinks to relevant guide
anegg0 Feb 21, 2025
f4c2ee3
fix: update yarn
anegg0 Feb 21, 2025
e8035d8
style: Soften modal title color in dark mode
anegg0 Feb 21, 2025
573fa2f
refactor: Adjust animation duration and formatting in NumberComponent
anegg0 Feb 24, 2025
15d26bd
style: Refine number animation with smoother opacity pulse effect
anegg0 Feb 24, 2025
5209b16
refactor: Adjust opacity animation parameters for NumberComponent
anegg0 Feb 24, 2025
954bd04
refactor: Adjust number animation opacity and spring physics
anegg0 Feb 24, 2025
1fbb299
fix: reformat
anegg0 Feb 24, 2025
ebd48d0
feat: improved buttons' visibility
anegg0 Feb 25, 2025
27b8a3b
feat: Add blinking animation to interactive buttons
anegg0 Feb 25, 2025
5659791
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 25, 2025
b504539
fix: reformat
anegg0 Feb 25, 2025
a41d840
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 26, 2025
f13906f
refactor: Remove styled-components from ImageZoom component
anegg0 Feb 25, 2025
c64db1e
feat: Add image zoom styles to content body SCSS
anegg0 Feb 25, 2025
451da2c
fix: Implement ImageZoom functionality with proper modal and zoom beh…
anegg0 Feb 25, 2025
055e25b
fix: Improve ImageZoom component with accessibility and modal handling
anegg0 Feb 26, 2025
f4ec1fd
style: Format ImageZoom component with consistent whitespace
anegg0 Feb 26, 2025
dd865a2
refactor: Improve ImageZoom component with animations and accessibility
anegg0 Feb 26, 2025
0ed2040
feat: Add automatic ImageZoom wrapping for markdown images
anegg0 Feb 26, 2025
107e5e3
style: Refactor SCSS formatting and improve code readability
anegg0 Feb 26, 2025
3da3635
feat: Enhance image zoom to occupy full viewport with improved scaling
anegg0 Feb 26, 2025
1d4684f
fix: Improve image zoom animation to maintain enlarged state
anegg0 Feb 26, 2025
cfb1b95
style: Adjust zoomed image sizing to fit within viewport
anegg0 Feb 26, 2025
4c39fd9
refactor: Replace styled-components with CSS classes in Modal component
anegg0 Feb 26, 2025
3d0240f
refactor: Improve Modal component formatting and remove empty line
anegg0 Feb 26, 2025
9045a78
fix: Resolve Title component undefined error in MDX rendering
anegg0 Feb 26, 2025
d371842
style: Add backdrop filter and transparency to modal styles
anegg0 Feb 26, 2025
cadc63e
style: Remove modal blur and use solid theme-based background colors
anegg0 Feb 26, 2025
b1c5ed0
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 26, 2025
a04b5db
refactor: Reorganize modal styles into separate SCSS partial
anegg0 Feb 26, 2025
abc6366
refactor: Move NumberComponent styles to SCSS partial and update imports
anegg0 Feb 26, 2025
4215ea6
refactor: remove styles.modules.css and add its classes to website/sr…
anegg0 Feb 26, 2025
1128d01
fix: revert content changes
anegg0 Feb 26, 2025
e469c1f
refactor: relocate imgs
anegg0 Feb 26, 2025
75ef3eb
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 26, 2025
b51ee56
fix: reformat
anegg0 Feb 26, 2025
b89c660
fix: fix import
anegg0 Feb 26, 2025
b46067e
fix: Update import path for number component SCSS module
anegg0 Feb 26, 2025
74fe470
refactor: Update import path for number component styles
anegg0 Feb 26, 2025
7d33b23
fix: Resolve CSS module import issues for NumberComponent
anegg0 Feb 26, 2025
34bd6b4
refactor: Update import path for number component styles
anegg0 Feb 26, 2025
a861a15
Based on the changes, here's a concise commit message that captures t…
anegg0 Feb 26, 2025
3873d71
feat: Add Radix UI, React Spring, and MDX dependencies to project
anegg0 Feb 26, 2025
5abe611
feat: Add interactive Timeboost auction diagram component
anegg0 Feb 26, 2025
782b747
feat: Add TypeScript types to InteractiveDiagrams component
anegg0 Feb 26, 2025
ae0a75b
refactor: Configure TypeScript for React and JSX support
anegg0 Feb 26, 2025
2c00313
refactor: Update NumberComponent with theme-specific styles and imports
anegg0 Feb 26, 2025
aa141c1
refactor: Remove local styles module and use global CSS for NumberCom…
anegg0 Feb 26, 2025
4d72468
refactor: Update import path for custom CSS file
anegg0 Feb 26, 2025
a4e3c70
style: Increase blinking animation speed in NumberComponent
anegg0 Feb 26, 2025
842e10f
refactor: Relocate InteractiveDiagrams index to Timeboost/Centralized…
anegg0 Feb 26, 2025
0a16988
style: Increase blinking animation speed in NumberComponent
anegg0 Feb 26, 2025
6a61f82
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Feb 27, 2025
09129ee
feat: Enhance blinking animation for numbers 2, 3, and 4 with more ag…
anegg0 Feb 27, 2025
4a2f3ab
feat: Add color alternation between blue and orange for NumberComponent
anegg0 Feb 27, 2025
332e81d
fix: reformat
anegg0 Feb 27, 2025
bb4575c
feat: Enhance ImageZoom with styled-components, portal, and improved UX
anegg0 Feb 27, 2025
269fbf8
refactor: Replace styled-components with global CSS classes in ImageZoom
anegg0 Feb 27, 2025
05a9023
style: Update modal transparency and close button positioning
anegg0 Feb 27, 2025
b2a48b9
fix: restore functional ImageZoom component
anegg0 Feb 27, 2025
a3699a6
feat: add package.json with types/react deps
anegg0 Feb 27, 2025
d2a5d11
fix: remove all legacy imgs
anegg0 Feb 27, 2025
0dcf49d
fix: remove useless usage file
anegg0 Feb 27, 2025
992429c
fix: img links
anegg0 Feb 27, 2025
1e451bb
fix: re-add legacy img
anegg0 Feb 27, 2025
1885842
refactor: Simplify CentralizedAuction component and remove unnecessar…
anegg0 Feb 27, 2025
ab117a2
feat: Add named FlowChart export to CentralizedAuction component
anegg0 Feb 27, 2025
b92da22
refactor: remove duplicate index.jsx
anegg0 Feb 27, 2025
42ef07b
update: bump yarn.lock
anegg0 Feb 27, 2025
66c9b7a
feat: Add connection lines to CentralizedAuction diagram
anegg0 Feb 27, 2025
f02dffa
Revert "update: bump yarn.lock"
anegg0 Feb 27, 2025
b77cfc0
Revert "refactor: remove duplicate index.jsx"
anegg0 Feb 27, 2025
b2988e7
fix: reformat
anegg0 Feb 27, 2025
b981ca9
update: yarn.lock
anegg0 Feb 27, 2025
5686449
Merge branch 'master' into diagrams-timeboost-gentle-intro
anegg0 Mar 5, 2025
916f9b7
fix: delete redundant file
anegg0 Mar 5, 2025
a7960bf
refactor: Merge root package.json dependencies into website/package.json
anegg0 Mar 5, 2025
3e97041
refactor: remove unneeded package.json
anegg0 Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,3 @@ yarn serve
```shell
git submodule update --remote arbitrum-sdk
```

### Format content
Sometimes, your pull request may need to be re-formatted to pass the checks. To be safe, make sure you run the following command (from the `website` directory) before you push your commit:
```shell
yarn && yarn format
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sme: TABASCOatw
sidebar_label: 'Particle Network'
---

import ImageZoomComponent from '@site/src/components/ImageZoom';
import ImageZoom from '@site/src/components/ImageZoom';

:::info Community member contribution

Expand Down
42 changes: 21 additions & 21 deletions arbitrum-docs/how-arbitrum-works/timeboost/gentle-introduction.mdx

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed website/archive/bold/assets/9Pr_Image_1.png
Binary file not shown.
Binary file removed website/archive/bold/assets/BnF_Image_3.png
Binary file not shown.
Binary file removed website/archive/bold/assets/CRA_Image_4.png
Binary file not shown.
Binary file removed website/archive/bold/assets/csI_Image_2.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed website/archive/how-arbitrum-works/assertionTree.png
Binary file not shown.
Binary file not shown.
Binary file removed website/archive/orbit/assets/orbit_bridge.png
Binary file not shown.
Binary file removed website/archive/stylus/assets/cargo-stylus.png
Binary file not shown.
Binary file removed website/archive/stylus/assets/stylus-wallet.png
Binary file not shown.
16 changes: 12 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@
"dependencies": {
"@arbitrum/sdk": "^3.0.0",
"@cmfcmf/docusaurus-search-local": "^0.11.0",
"@mdx-js/react": "^3.0.0",
"@docusaurus/core": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@docusaurus/theme-live-codeblock": "^3.6.3",
"@docusaurus/theme-mermaid": "^3.6.3",
"@radix-ui/react-dialog": "^1.1.6",
"@react-spring/web": "^9.7.5",
"@types/styled-components": "^5.1.34",
"@radix-ui/react-dialog": "^1.0.5",
"@react-spring/web": "^9.7.3",
"@types/mdx": "^2.0.11",
"@types/prismjs": "^1.26.5",
"@types/react": "^18.2.55",
"@types/react-syntax-highlighter": "^15.5.13",
"classnames": "^2.5.1",
"clsx": "^1.2.1",
"docusaurus-lunr-search": "^3.3.2",
Expand All @@ -45,22 +49,26 @@
"posthog-docusaurus": "^2.0.0",
"posthog-js": "^1.219.6",
"prism-react-renderer": "^1.3.5",
"prismjs": "^1.29.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-syntax-highlighter": "^15.6.1",
"sass": "^1.66.1",
"styled-components": "^6.1.15",
"tippy.js": "^6.3.7",
"trim": "0.0.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.3.2",
"@offchainlabs/prettier-config": "0.2.1",
"@stitches/react": "^1.2.8",
"@tsconfig/docusaurus": "^2.0.3",
"@types/node": "^22.10.10",
"@types/react": "^19.0.10",
"docusaurus-plugin-typedoc": "^1.0.1",
"husky": "^9.1.7",
"markdown-link-extractor": "^3.1.0",
"prettier": "^2.8.3",
"styled-components": "^6.1.15",
"ts-node": "^10.9.1",
"typedoc": "^0.25.13",
"typedoc-plugin-frontmatter": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import * as React from 'react';

const ButtonComponent = ({ x, y, width, height }) => {
const [isHovered, setIsHovered] = React.useState(false);

return (
<svg
xmlns="http://www.w3.org/2000/svg"
x={x - width * 0.25}
y={y - height * 0.25}
width={width * 1.5}
height={height * 1.5}
viewBox="0 0 512 512"
style={{
cursor: 'pointer',
transition: 'transform 0.2s',
transform: isHovered ? 'scale(1.1)' : 'scale(1)',
}}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<title>Interactive Button</title>
<path
d="M448,256c0-106-86-192-192-192S64,150,64,256s86,192,192,192S448,362,448,256Z"
style={{
fill: 'none',
stroke: '#ffffff',
strokeMiterlimit: 10,
strokeWidth: '32px',
filter: 'drop-shadow(0px 0px 4px rgba(255,255,255,0.5))',
}}
/>
<circle
cx="256"
cy="256"
r="144"
style={{
fill: '#ff7f2a',
filter: isHovered ? 'brightness(1.2)' : 'none',
transition: 'filter 0.2s',
animation: 'blink 2s ease-in-out infinite',
}}
/>
</svg>
);
};

export default ButtonComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import React, { useState, useEffect } from 'react';
import { useTransition, animated } from '@react-spring/web';
import * as Dialog from '@radix-ui/react-dialog';
import step1Content from './modal-centralized-auction-step-1.mdx';
import step2Content from './modal-centralized-auction-step-2.mdx';
import step3Content from './modal-centralized-auction-step-3.mdx';
import step4Content from './modal-centralized-auction-step-4.mdx';
import step5Content from './modal-centralized-auction-step-5.mdx';
import { createPortal } from 'react-dom';
import { NumberComponent } from './NumberComponent';
import { MDXProvider } from '@mdx-js/react';
import type { MDXComponents } from '@mdx-js/react/lib';
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import { oneDark, oneLight } from 'react-syntax-highlighter/dist/cjs/styles/prism';
import javascript from 'react-syntax-highlighter/dist/cjs/languages/prism/javascript';
import solidity from 'react-syntax-highlighter/dist/cjs/languages/prism/solidity';
import { useColorMode } from '@docusaurus/theme-common';

// Define the CodeBlock interface
interface CodeBlock {
language: string;
code: string;
}

SyntaxHighlighter.registerLanguage('javascript', javascript);
SyntaxHighlighter.registerLanguage('solidity', solidity);

const components = {
h1: ({ children }) => <h1 className="modal__title">{children}</h1>,
p: ({ children }) => <p>{children}</p>,
ol: ({ children }) => <ul>{children}</ul>,
li: ({ children }) => <li>{children}</li>,
pre: ({ children }) => children,
code: ({ children, className }) => {
const language = className?.replace('language-', '') || 'text';
return (
<SyntaxHighlighter
language={language}
style={useColorMode().isDarkTheme ? oneDark : oneLight}
customStyle={{
margin: 0,
padding: '16px',
borderRadius: '4px',
backgroundColor: useColorMode().isDarkTheme ? 'rgb(41, 45, 62)' : 'rgb(246, 248, 250)',
}}
>
{children}
</SyntaxHighlighter>
);
},
};

export function Modal({ number }: { number: number }) {
const [isOpen, setIsOpen] = useState(false);
const { isDarkTheme } = useColorMode();
const stepContent = {
1: step1Content,
2: step2Content,
3: step3Content,
4: step4Content,
5: step5Content,
};
const StepContent = stepContent[number];

const transitions = useTransition(isOpen, {
from: { opacity: 0, transform: 'scale(0.95)' },
enter: { opacity: 1, transform: 'scale(1)' },
leave: { opacity: 0, transform: 'scale(0.95)' },
config: { tension: 300, friction: 20 },
});

const overlayTransitions = useTransition(isOpen, {
from: { opacity: 0 },
enter: { opacity: 1 },
leave: { opacity: 0 },
config: { duration: 200 },
});

const renderCodeBlock = (block: CodeBlock, index: number) => (
<div key={index} style={{ position: 'relative' }}>
<SyntaxHighlighter
language={block.language}
style={isDarkTheme ? oneDark : oneLight}
customStyle={{
margin: 0,
padding: '16px',
borderRadius: '4px',
backgroundColor: isDarkTheme ? 'rgb(41, 45, 62)' : 'rgb(246, 248, 250)',
}}
>
{block.code.trim()}
</SyntaxHighlighter>
</div>
);

return (
<>
<g
onClick={() => setIsOpen(true)}
style={{
cursor: 'pointer',
pointerEvents: 'all',
}}
>
<NumberComponent number={number} />
</g>
{typeof document !== 'undefined' &&
createPortal(
<Dialog.Root open={isOpen} onOpenChange={setIsOpen}>
<Dialog.Portal>
{overlayTransitions(
(styles, item) =>
item && <Dialog.Overlay className="modal__overlay" style={styles} />,
)}
{transitions(
(styles, item) =>
item && (
<div className="modal__container">
<Dialog.Content
className="modal__content"
forceMount
style={{
...styles,
pointerEvents: 'auto',
}}
>
<header className="modal__header">
<Dialog.Close
className="modal__close-button"
onClick={() => setIsOpen(false)}
>
<CloseIcon />
</Dialog.Close>
</header>
<MDXProvider components={components}>
<StepContent />
</MDXProvider>
</Dialog.Content>
</div>
),
)}
</Dialog.Portal>
</Dialog.Root>,
document.body,
)}
</>
);
}

const CloseIcon = () => (
<svg width="22" height="22" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M15.9574 14.1689L8.59651 6.75098L6.73232 8.59598L14.1313 16.071L6.71338 23.4129L8.5964 25.2769L15.9574 17.8779L23.3943 25.2769L25.2392 23.4129L17.8213 16.071L25.2202 8.59598L23.3752 6.75098L15.9574 14.1689Z"
fill="currentColor"
/>
</svg>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import * as React from 'react';
import { useSpring, animated } from '@react-spring/web';
import { useColorMode } from '@docusaurus/theme-common';
import '@site/src/css/custom.css';
import ButtonComponent from './ButtonComponent';
import { CIRCLE_RADIUS, numberPaths, coordinates } from './constants';
import { NumberComponentProps } from './types';

export const NumberComponent = ({ number }) => {
const { isDarkTheme } = useColorMode();

const animationProps =
number === 1 || number === 5
? { opacity: 1 }
: useSpring({
from: { opacity: 0, fill: '#ff7f2a' },
to: [
{ opacity: 1, fill: '#ff7f2a' },
{ opacity: 1, fill: '#3578e5' },
{ opacity: 0, fill: '#3578e5' }
],
config: { tension: 20000, friction: 10 },
loop: true,
reset: true,
immediate: false,
});

const coords = coordinates[number];
const pathData = numberPaths[number];

if (!coords || !pathData) {
return null;
}

const offsetX = coords.circle.x - coords.path.x + (coords.offset?.x || 0);
const offsetY = coords.circle.y - coords.path.y + (coords.offset?.y || 0);

const circleClassName = isDarkTheme ? 'cls-5' : 'cls-5-light';
const pathClassName = isDarkTheme ? 'cls-10' : 'cls-10-light';

return (
<g id={`number${number}`}>
{(number === 2 || number === 3 || number === 4) && (
<ButtonComponent
x={coords.circle.x - CIRCLE_RADIUS}
y={coords.circle.y - CIRCLE_RADIUS}
width={CIRCLE_RADIUS * 2}
height={CIRCLE_RADIUS * 2}
/>
)}
<animated.circle
id={`circle${number}`}
cx={coords.circle.x}
cy={coords.circle.y}
r={CIRCLE_RADIUS}
className={circleClassName}
style={{ ...animationProps }}
/>
<path
id={`path${number}`}
d={pathData}
className={pathClassName}
transform={`translate(${offsetX}, ${offsetY})`}
/>
</g>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const CIRCLE_RADIUS = 20.95;

export const numberPaths = {
1: 'M412.16 410.7v-3.06c2.5 0 3.66-.47 4.05-2.65h3.99v14.72h-4.35v-9.01h-3.68Z',
2: 'M583.04 633.46c.8-1.14 1.46-1.64 3.86-2.91 2.09-1.12 2.61-1.64 2.61-2.61 0-.84-.54-1.36-1.38-1.36-1.06 0-1.57.67-1.64 2.11h-4.42c0-3.25 2.35-5.21 6.25-5.21 3.36 0 5.62 1.68 5.62 4.18 0 2.11-.99 3.55-3.34 4.78l-.78.41c-2.05 1.08-2.67 1.55-2.84 2.48.73-.06 1.42-.11 2.2-.11h5.17v3.3h-12.52c0-2.46.37-3.86 1.21-5.06Z',
3: 'M586.28 781.21c1.06 0 1.72-.62 1.72-1.53 0-1.03-.67-1.59-2.15-1.59h-.6v-3.21h.47c1.49 0 2.05-.52 2.05-1.57 0-.82-.67-1.42-1.62-1.42-1.12 0-1.75.78-1.77 2.05h-4.29c.09-3.19 2.31-5.11 6.14-5.11s5.88 1.57 5.88 4.07c0 1.7-.91 2.93-2.76 3.34v.11c2 .39 3.02 1.64 3.02 3.51 0 2.71-2.28 4.42-6.23 4.42-3.51 0-6.23-1.42-6.23-5.3h4.35c.06 1.42.78 2.24 2 2.24Z',
4: 'M1048.97 602.13v-3.3l5.49-8.55h5.54v8.66h2.13v3.19H1060V605h-4.24v-2.87h-6.79Zm3.53-3.19h3.45c0-1.7 0-3.38.22-5.52l-.19-.06-3.47 5.58Z',
5: 'M1003.53 257.43c1.01 0 1.7-.97 1.7-2.18s-.67-2.05-1.75-2.05c-.82 0-1.36.52-1.7 1.31l-4.27-.3.86-8.73h10.43v3.3h-4.42c-.78 0-1.75-.02-2.52-.11-.09.8-.15 1.96-.45 2.76h.17c.69-.78 1.77-1.16 3.12-1.16 2.93 0 5.08 2.11 5.08 4.96 0 3.21-2.46 5.34-6.23 5.34s-6.18-1.92-6.31-4.8h4.52c.06 1.01.73 1.66 1.75 1.66Z',
};

export const coordinates = {
1: { circle: { x: 416.59, y: 412.69 }, path: { x: 412.16, y: 410.7 }, offset: { x: -4, y: -2 } },
2: { circle: { x: 588.13, y: 631.51 }, path: { x: 583.04, y: 633.46 }, offset: { x: -4, y: 1 } },
3: { circle: { x: 586.23, y: 776.88 }, path: { x: 586.28, y: 781.21 }, offset: { x: 1, y: 4 } },
4: { circle: { x: 1055.6, y: 597.98 }, path: { x: 1048.97, y: 602.13 }, offset: { x: -6, y: 3 } },
5: { circle: { x: 1003.53, y: 257.43 }, path: { x: 1003.53, y: 257.43 }, offset: { x: 1, y: 4 } },
};
Loading