Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
644e7b2
Revert "fix: replaced void article with existing one"
anegg0 Feb 11, 2025
ce35541
feat: add ImageZoom component for zoom feature
anegg0 Feb 11, 2025
ea9e8d5
feat: add zoom-in features for large images, along with usage insruct…
anegg0 Feb 11, 2025
feed6f4
fix: reformat
anegg0 Feb 11, 2025
4f199d6
imagezoom haw-tx-lifecycle
pete-vielhaber Feb 11, 2025
4e613d6
fix: adding file failing zoom
anegg0 Feb 11, 2025
2d53aa8
feat: Add support for local image files in ImageZoom component
anegg0 Feb 11, 2025
9350efb
feat: Update image imports to use local files with require syntax in …
anegg0 Feb 11, 2025
eb1a7c6
fix: Handle require() imports in ImageZoom component
anegg0 Feb 11, 2025
d776abe
fix: Update image import paths in transaction lifecycle document
anegg0 Feb 11, 2025
531778d
fix: fix broken image link
anegg0 Feb 11, 2025
01a1c63
Revert "fix: fix broken image link"
anegg0 Feb 11, 2025
73b916d
Revert "fix: Update image import paths in transaction lifecycle docum…
anegg0 Feb 11, 2025
e6be0c9
refactor: Update image import syntax in transaction lifecycle documen…
anegg0 Feb 11, 2025
6e3bfd8
fix: Correct image path for transaction lifecycle diagram
anegg0 Feb 11, 2025
84f1f35
fix: Normalize image paths to handle relative imports correctly
anegg0 Feb 11, 2025
cf6d70b
docs: Update transaction lifecycle diagram source path
anegg0 Feb 11, 2025
e4796e1
fix: Update image path for transaction lifecycle diagram
anegg0 Feb 11, 2025
819f561
fix: Preserve image paths while handling relative image sources
anegg0 Feb 11, 2025
fe658fa
docs: Update transaction lifecycle diagram source path
anegg0 Feb 11, 2025
1ef943d
fix: Resolve image path rendering in transaction lifecycle documentation
anegg0 Feb 11, 2025
256c7bb
docs: Update transaction lifecycle diagram source path
anegg0 Feb 11, 2025
0df3cfc
fix: Update image path for transaction lifecycle diagram
anegg0 Feb 11, 2025
03f9386
fix: Restore original image path in transaction lifecycle document
anegg0 Feb 11, 2025
78d85b6
fix: Correct image path handling in ImageZoom component
anegg0 Feb 11, 2025
62f6318
refactor: Simplify ImageZoom component's useEffect for string image s…
anegg0 Feb 11, 2025
3378480
feat: Add @browser-only tag to ImageZoom component for client-side re…
anegg0 Feb 11, 2025
c0f49dd
feat: Update image path resolution in Docusaurus MDX and ImageZoom co…
anegg0 Feb 11, 2025
488bb8d
fix: Update image paths using Docusaurus @site alias
anegg0 Feb 11, 2025
fd875d9
fix: Update image paths to resolve module resolution error
anegg0 Feb 11, 2025
8d17037
refactor: Revert ImageZoom components to standard markdown images
anegg0 Feb 11, 2025
60ae857
feat: Apply ImageZoom to transaction lifecycle image in 02-transactio…
anegg0 Feb 11, 2025
716d5bd
feat: Import SVG image for transaction lifecycle diagram in Docusaurus
anegg0 Feb 11, 2025
76c66c6
refactor: Update ImageZoom component to support Docusaurus asset imports
anegg0 Feb 11, 2025
4741ae3
docs: Update transaction lifecycle image component syntax
anegg0 Feb 11, 2025
e0ce646
fix: Update ImageZoom component to render images correctly
anegg0 Feb 11, 2025
fc041ee
refactor: Update ImageZoom component to use `sources` prop consistently
anegg0 Feb 11, 2025
ea1eee0
feat: add docusaurus-image-zoom
anegg0 Feb 12, 2025
0161546
fix: restore file to master branch state
anegg0 Feb 12, 2025
b871fc1
feat: add image-zoom package
anegg0 Feb 12, 2025
4742ca7
Revert "feat: add image-zoom package"
anegg0 Feb 12, 2025
2585cdd
Revert "feat: add docusaurus-image-zoom"
anegg0 Feb 12, 2025
46a1902
fix: re-locate file to orginal directory
anegg0 Feb 12, 2025
8b83a15
fix: resolves broken image links
anegg0 Feb 12, 2025
c457644
fix: final fixes
anegg0 Feb 12, 2025
a01900a
feat: add README
anegg0 Feb 12, 2025
6fc6cc2
Merge branch 'master' into image-zoom-in-feature
anegg0 Feb 12, 2025
f686361
fix: remove unused import
anegg0 Feb 12, 2025
086b77f
fix: correct file path
anegg0 Feb 12, 2025
b5403a9
fix: edit README for correct img files location
anegg0 Feb 12, 2025
906b1c5
Merge branch 'image-zoom-in-feature' of github.com:OffchainLabs/arbit…
pete-vielhaber Feb 12, 2025
9927769
feat: integrate img sizing css class
anegg0 Feb 12, 2025
032e4e9
fix: edit README to add css img sizing instructions
anegg0 Feb 12, 2025
e3a00ca
fix: solve img sizing at initial rendering
anegg0 Feb 12, 2025
e754092
fix: update example image
anegg0 Feb 12, 2025
1aecfa4
fix: edit README with latest usage guidance
anegg0 Feb 12, 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
8 changes: 5 additions & 3 deletions arbitrum-docs/for-devs/third-party-docs/Particle/particle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ sme: TABASCOatw
sidebar_label: 'Particle Network'
---

import { ImageZoom } from '@site/src/components/ImageZoom';

:::info Community member contribution

Shoutout to [@TABASCOatw](https://github.com/TABASCOatw) for contributing the following [third-party document](/for-devs/third-party-docs/contribute)!
Expand Down Expand Up @@ -37,7 +39,7 @@ Given its modular architecture, developers have the liberty to choose which of t

The user flow with Particle Network begins with social logins (using either a custom authentication or preset login methods provided by Particle Network), which leads to the generation of an EOA through MPC-TSS. This EOA is then used as a Signer for a smart account implementation that best fits the needs of the application in question (natively, this means a choice between SimpleAccount, Biconomy V1/V2, Light Account, and Cyber Account). A visualization of this process can be found below:

![](https://i.imgur.com/qfEpjgz.png)
<ImageZoom src="https://i.imgur.com/qfEpjgz.png" alt="Particle Network User Flow" />

---

Expand Down Expand Up @@ -126,7 +128,7 @@ export const ParticleConnectkit = ({ children }: React.PropsWithChildren) => {
};
```

This code sets up Particle Connect with a configuration for wallet authentication and blockchain interactions on Arbitrum Sepolia. It includes social logins and traditional Web3 options through WalletConnect and enables Account Abstraction (AA) with a `SimpleAccount` instance version 2.0.0. The configured `ConnectKitProvider` component then wraps the apps content, making this configuration available.
This code sets up Particle Connect with a configuration for wallet authentication and blockchain interactions on Arbitrum Sepolia. It includes social logins and traditional Web3 options through WalletConnect and enables Account Abstraction (AA) with a `SimpleAccount` instance version 2.0.0. The configured `ConnectKitProvider` component then wraps the app's content, making this configuration available.

## Integrate Particle Connect in Your App

Expand Down Expand Up @@ -164,7 +166,7 @@ export default function RootLayout({

With your project set up, dependencies installed, and Particle Connect configured, you can start building in the `page.tsx` file.

In `page.tsx`, youll define the core features: login flow, data visualization, transaction handling, and the UI.
In `page.tsx`, you'll define the core features: login flow, data visualization, transaction handling, and the UI.

### Connecting the Wallet

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"@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",
"classnames": "^2.5.1",
"clsx": "^1.2.1",
"docusaurus-lunr-search": "^3.3.2",
Expand All @@ -44,6 +47,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.66.1",
"styled-components": "^6.1.15",
"tippy.js": "^6.3.7",
"trim": "0.0.3"
},
Expand Down
188 changes: 188 additions & 0 deletions website/src/components/ImageZoom/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/**
* ImageZoom Component
*
* A React component that adds a click-to-zoom feature to images with smooth animations.
*
* Features:
* - Smooth fade and scale animations
* - Responsive sizing (max 90% of viewport)
* - Dark overlay background
* - Close on overlay click, escape key, or close button
* - Mobile-friendly
*
* Usage in MDX files:
* ```mdx
* import { ImageZoom } from '@site/src/components/ImageZoom';
*
* <ImageZoom
* src="path/to/your/image.png"
* alt="Description of the image"
* className="optional-custom-class"
* />
* ```
*
* Usage in React components:
* ```tsx
* import { ImageZoom } from '@site/src/components/ImageZoom';
*
* function YourComponent() {
* return (
* <ImageZoom
* src="/images/example.png"
* alt="Example image"
* className="optional-styling"
* />
* );
* }
* ```
*
* Props:
* @param {string} src - The source URL of the image
* @param {string} [alt] - Optional alt text for the image
* @param {string} [className] - Optional CSS class name for additional styling
*
* Dependencies:
* - @react-spring/web (for animations)
* - styled-components (for styling)
* - @radix-ui/react-dialog (for modal functionality)
*/

import React, { useState } from 'react';
import { useTransition, animated } from '@react-spring/web';
import styled from 'styled-components';
import * as Dialog from '@radix-ui/react-dialog';
import { createPortal } from 'react-dom';

interface ImageZoomProps {
src: string;
alt?: string;
className?: string;
}

export function ImageZoom({ src, alt, className }: ImageZoomProps) {
const [isOpen, setIsOpen] = useState(false);

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 },
});

return (
<>
<img
src={src}
alt={alt || ''}
className={`cursor-zoom-in ${className || ''}`}
onClick={() => setIsOpen(true)}
/>
{typeof document !== 'undefined' &&
createPortal(
<Dialog.Root open={isOpen} onOpenChange={setIsOpen}>
<Dialog.Portal>
{overlayTransitions(
(styles, item) =>
item && <OverlayBackground style={styles} onClick={() => setIsOpen(false)} />,
)}
{transitions(
(styles, item) =>
item && (
<div
style={{
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
padding: '20px',
zIndex: 10000,
pointerEvents: 'none',
}}
>
<Content
style={{
...styles,
pointerEvents: 'auto',
}}
>
<CloseButton onClick={() => setIsOpen(false)}>
<CloseIcon />
</CloseButton>
<ZoomedImage
src={src}
alt={alt || ''}
onClick={(e) => e.stopPropagation()}
/>
</Content>
</div>
),
)}
</Dialog.Portal>
</Dialog.Root>,
document.body,
)}
</>
);
}

const OverlayBackground = styled(animated(Dialog.Overlay))`
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8);
position: fixed;
inset: 0;
z-index: 9999;
cursor: zoom-out;
`;

const Content = styled(animated.div)`
position: relative;
max-width: 90vw;
max-height: 90vh;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
`;

const ZoomedImage = styled.img`
max-width: 90vw;
max-height: 90vh;
object-fit: contain;
border-radius: 4px;
`;

const CloseButton = styled.button`
position: absolute;
top: -40px;
right: 0;
background: none;
border: none;
color: white;
cursor: pointer;
padding: 8px;

&:hover {
opacity: 0.8;
}
`;

const CloseIcon = () => (
<svg width="24" height="24" 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>
);
8 changes: 8 additions & 0 deletions website/src/theme/MDXComponents/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import MDXComponents from '@theme-original/MDXComponents';
import { ImageZoom } from '@site/src/components/ImageZoom';

export default {
...MDXComponents,
ImageZoom: ImageZoom,
};
Loading