| mode | custom |
|---|---|
| title | Welcome |
| description | Build on Stellar with guides, APIs, tools, and platform docs for apps, smart contracts, tokens, data, and network infrastructure. |
export const HeroDotBackground = () => { const canvasRef = useRef(null)
useEffect(() => { if (typeof window === "undefined") return
const canvas = canvasRef.current
if (!canvas) return
const context = canvas.getContext("2d")
if (!context) return
const desktopPoints = [
{ x: 0.06, y: 0.84 },
{ x: 0.28, y: 0.5 },
{ x: 0.56, y: 0.16 },
]
const mobilePoints = [
{ x: 0.1, y: 0.82 },
{ x: 0.32, y: 0.56 },
]
const lightDotColor = "#7D73B2"
const darkDotColor = "#FFDA00"
const clamp = (value, min, max) => Math.min(Math.max(value, min), max)
const lerp = (start, end, progress) => start + (end - start) * progress
const getBasePoints = (width) =>
width < 768 ? mobilePoints : desktopPoints
const getJitteredPoints = (points, width) => {
const spread = width < 768 ? 0.05 : 0.09
return points.map((point) => ({
x: clamp(point.x + (Math.random() - 0.5) * spread * 2, 0, 1),
y: clamp(point.y + (Math.random() - 0.5) * spread * 2, 0, 1),
}))
}
const isDarkMode = () =>
document.documentElement.classList.contains("dark") ||
document.documentElement.getAttribute("data-theme") === "dark"
let frameId = 0
let timeoutId = 0
let animationStart = 0
let width = 0
let height = 0
let currentPoints = getBasePoints(window.innerWidth)
let startPoints = currentPoints
let endPoints = currentPoints
let reducedMotion = false
const motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)")
const syncReducedMotion = () => {
reducedMotion = motionQuery.matches
}
const draw = (points) => {
if (!width || !height) return
const limitedWidth = Math.min(width, 1440)
const offsetX = (width - limitedWidth) / 2
const dropOff = width < 768 ? 260 : 500
const spacing = width < 768 ? 12 : 10
const baseRadius = width < 768 ? 3.4 : 4
context.clearRect(0, 0, width, height)
context.fillStyle = isDarkMode() ? darkDotColor : lightDotColor
context.globalAlpha = isDarkMode() ? 0.18 : 0.32
const mappedPoints = points.map((point) => ({
x: offsetX + point.x * limitedWidth,
y: point.y * height,
}))
for (let x = -20; x <= width + 20; x += spacing) {
for (let y = -20; y <= height + 20; y += spacing) {
let scale = 0
mappedPoints.forEach((point) => {
const dx = x - point.x
const dy = y - point.y
const distance = Math.sqrt(dx * dx + dy * dy)
const pointScale = Math.pow(
1 - Math.min(distance / dropOff, 1),
0.4
)
scale = Math.max(scale, pointScale)
})
if (scale <= 0.02) continue
context.beginPath()
context.arc(x, y, baseRadius * scale, 0, Math.PI * 2)
context.fill()
}
}
}
const resizeCanvas = () => {
const rect = canvas.getBoundingClientRect()
width = rect.width
height = rect.height
const dpr = window.devicePixelRatio || 1
canvas.width = Math.round(width * dpr)
canvas.height = Math.round(height * dpr)
context.setTransform(dpr, 0, 0, dpr, 0, 0)
currentPoints = getBasePoints(width).map((point) => ({ ...point }))
startPoints = currentPoints.map((point) => ({ ...point }))
endPoints = getJitteredPoints(currentPoints, width)
draw(currentPoints)
}
const animateToNextState = (timestamp) => {
if (!animationStart) animationStart = timestamp
const progress = Math.min((timestamp - animationStart) / 1200, 1)
currentPoints = startPoints.map((point, index) => ({
x: lerp(point.x, endPoints[index].x, progress),
y: lerp(point.y, endPoints[index].y, progress),
}))
draw(currentPoints)
if (progress < 1) {
frameId = window.requestAnimationFrame(animateToNextState)
return
}
animationStart = 0
startPoints = currentPoints.map((point) => ({ ...point }))
endPoints = getJitteredPoints(currentPoints, width)
timeoutId = window.setTimeout(() => {
frameId = window.requestAnimationFrame(animateToNextState)
}, 140)
}
const startAnimation = () => {
window.clearTimeout(timeoutId)
window.cancelAnimationFrame(frameId)
animationStart = 0
if (reducedMotion) {
currentPoints = getBasePoints(width).map((point) => ({ ...point }))
draw(currentPoints)
return
}
startPoints = currentPoints.map((point) => ({ ...point }))
endPoints = getJitteredPoints(currentPoints, width)
frameId = window.requestAnimationFrame(animateToNextState)
}
const handleMotionChange = () => {
syncReducedMotion()
startAnimation()
}
syncReducedMotion()
const resizeObserver = new ResizeObserver(() => {
resizeCanvas()
startAnimation()
})
resizeObserver.observe(canvas)
const themeObserver = new MutationObserver(() => {
draw(currentPoints)
})
themeObserver.observe(document.documentElement, {
attributes: true,
attributeFilter: ["class", "data-theme"],
})
if (motionQuery.addEventListener) {
motionQuery.addEventListener("change", handleMotionChange)
} else {
motionQuery.addListener(handleMotionChange)
}
resizeCanvas()
startAnimation()
return () => {
window.clearTimeout(timeoutId)
window.cancelAnimationFrame(frameId)
resizeObserver.disconnect()
themeObserver.disconnect()
if (motionQuery.removeEventListener) {
motionQuery.removeEventListener("change", handleMotionChange)
} else {
motionQuery.removeListener(handleMotionChange)
}
}
}, [])
return (
) }
Explore end-to-end guides, API references, developer tools, network docs, and production platforms for building on Stellar with confidence.
Get a working Stellar development flow in place, fund a test account, and choose the track that fits your product.
```bash
docker run --rm -it stellar/quickstart --standalone
```
</Step>
<Step title="Set up a test account">
Use [Stellar Lab](/docs/tools/lab/account) or Friendbot on [Testnet](/docs/networks) to create and fund an account before you test transactions, smart contracts, or wallet flows.
<Accordion title="Example Friendbot response">
```json
{
"successful": true,
"network": "testnet",
"account": "G..."
}
```
</Accordion>
</Step>
<Step title="Make your first call">
Choose an integration surface based on your use case: [RPC](/docs/data/apis/rpc) for real-time app and contract workflows, [Horizon](/docs/data/apis/horizon) for legacy integrations, or [SDKs](/docs/tools/sdks) if you want a language-specific developer experience.
</Step>
<Step title="Pick a build path">
Use [Smart Contract Getting Started](/docs/build/smart-contracts/getting-started), [Applications](/docs/build/apps), or [Tokens](/docs/tokens) depending on whether you are shipping onchain logic, a wallet or app, or asset issuance flows.
</Step>
</Steps>
Jump straight into the major areas of the site, from hands-on implementation to infrastructure and ecosystem services.
Start with curated entry points for common Stellar product and infrastructure workflows.
Start with a local network, walk through a first integration, and use the docs as your reference all the way to production deployment.