Repository navigation
Home
cael-prussian edited this page Jan 14, 2026
·
2 revisions
Welcome! This guide will help you add morphbg to your website in under 5 minutes.
Just two things:
- A basic HTML page
- An internet connection (for CDN access)
No build tools, no npm, no configuration files required.
Add a canvas element to your HTML:
<canvas id="bg-canvas"></canvas>Style it to cover the entire viewport:
#bg-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1; /* Behind your content */
}Add sections with shader attributes:
<section data-shader-system="gs1" data-shader-preset="HERO">
<h1>Welcome</h1>
<p>Your content here</p>
</section>
<section data-shader-system="gs2" data-shader-preset="AMBIENT">
<h2>About Us</h2>
<p>More content</p>
</section>Add these two script tags before the closing </body> tag:
<script src="https://cdn.jsdelivr.net/npm/three@0.152.2/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/cael-prussian/morphbg@1.0.0/dist/morphbg-all.complete.js"></script>Here's a full working example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Site with morphbg</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: system-ui, sans-serif;
}
#bg-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
section {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2rem;
color: white;
text-align: center;
}
h1 {
font-size: 4rem;
margin-bottom: 1rem;
}
p {
font-size: 1.5rem;
max-width: 600px;
}
</style>
</head>
<body>
<canvas id="bg-canvas"></canvas>
<section data-shader-system="gs1" data-shader-preset="HERO">
<h1>Welcome</h1>
<p>Beautiful animated backgrounds with zero configuration</p>
</section>
<section data-shader-system="gs2" data-shader-preset="AMBIENT">
<h1>Features</h1>
<p>GPU-accelerated WebGL shaders that run at 60fps</p>
</section>
<section data-shader-system="gs3" data-shader-preset="READ">
<h1>Get Started</h1>
<p>Just add two script tags and you're done!</p>
</section>
<script src="https://cdn.jsdelivr.net/npm/three@0.152.2/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/cael-prussian/morphbg@1.0.0/dist/morphbg-all.complete.js"></script>
</body>
</html>- The canvas appears behind your content
- The first visible shader initializes
- As you scroll, shaders transition smoothly
- Each section can use different shaders and presets
- Choose Your Installation Method → - Learn about different approaches
- Explore Shader Systems → - See available shaders and presets
- Configuration Options → - Customize behavior
- Check Troubleshooting for common issues
- See FAQ for frequently asked questions
- Open an issue on GitHub