This document explains how to use and customize the animated sakura background for your streaming overlay.
A gentle animated background featuring falling sakura petals and detailed blooming branches, designed to create a calming and visually appealing backdrop for your streams. This background is designed to be used as a base layer beneath other transparent overlays for a complete spring-themed streaming aesthetic.
You can adjust the animation by modifying these CSS properties in the :root
section:
For Falling Sakura Petals Animation:
--petal-count
: Number of petals (default: 60). Increase for more density, decrease for fewer petals.--petal-min-size
: Minimum petal size (default: 15px). Adjust the minimum size of the falling petals.--petal-max-size
: Maximum petal size (default: 30px). Adjust the maximum size of the falling petals.--petal-min-duration
: Minimum fall duration (default: 10s). Adjust for faster or slower falling petals.--petal-max-duration
: Maximum fall duration (default: 30s). Adjust for faster or slower falling petals.For Branch and Blossom Elements:
--branch-color-1
: Main branch color (default: #8d6e63). Adjust for different branch colors.--branch-color-2
: Secondary branch color (default: #6d4c41). Adjust for different twig colors.--accent-color
: Cherry blossom pink color (default: #ff9eb1). Adjust for different flower colors.--accent-color-2
: Soft mint green color (default: #b6e9d1). Adjust for different leaf colors.For Spring Elements Animation (Edge Decorations):
--edge-animation-duration
: Animation duration for spring elements (default: 15s for float, 8s for sway). Adjust for faster or slower floating and swaying motion of edge elements.--edge-element-opacity
: Opacity of edge elements (default: 0.6). Adjust for more or less prominent edge decorations.--edge-blur-filter
: Blur filter for edge elements (default: 1px). Adjust for softer or sharper edge decorations.This overlay uses several techniques to create a gentle and visually appealing animated background:
Branch Structures: Detailed branch structures with sub-branches and twigs are positioned around the edges of the screen. These branches serve as supports for flowers, buds, and blossom clusters.
Cherry Blossom Clusters: Multiple cherry blossom clusters are placed along the branches, each with a subtle pulsing animation to simulate blooming. These clusters vary in size and density.
Edge Decorations (Spring Elements): Around the edges of the screen, spring-themed elements like cherry blossoms and leaves are placed. These elements have subtle floating animations to add gentle motion.
Falling Sakura Petals: A layer of continuously falling sakura petals is added across the entire screen. Each petal is dynamically created with randomized properties for size, speed, rotation, and slight color variation to create a natural and varied falling effect.
Clear Middle Area: The central area of the overlay is intentionally kept mostly clear. This is to ensure that the background does not obstruct the main content of your stream, such as the game content or camera feed.
@keyframes float
and @keyframes sway
for edge elements@keyframes falling-petal
for sakura petals@keyframes gentle-pulse
for the blooming effect on cherry blossom clustersYou can adjust the animation by modifying these properties in the :root
section:
/* Primary colors */
--accent-color: #ff9eb1; /* Cherry blossom pink */
--accent-color-2: #b6e9d1; /* Soft mint green */
/* Background colors */
--bg-color-1: #d0e8cf; /* Light, serene green */
--bg-color-2: #a3c4bc; /* Soft, muted green */
/* Branch colors */
--branch-color-1: #8d6e63; /* Main branch color */
--branch-color-2: #6d4c41; /* Secondary branch color */
/* Sakura animation settings */
--petal-count: 60; /* Number of falling petals */
--petal-min-size: 15px; /* Minimum petal size */
--petal-max-size: 30px; /* Maximum petal size */
--petal-min-duration: 10s; /* Minimum fall duration */
--petal-max-duration: 30s; /* Maximum fall duration */
/* Edge decoration settings */
--edge-width: 200px; /* Width of the edge decorations */
--center-clear-zone: 1200px; /* Size of the clear zone in the middle */
To modify the color scheme of the background:
.background
CSS class and modify the background
property:
.background {
/* Change these gradient colors for a different sky effect */
background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2));
}
You can customize the following CSS variables in the :root
to change the background colors:
--bg-color-1
: Light, serene green background color.--bg-color-2
: Soft, muted green background color..cherry-blossom
CSS class and adjust the background-color
property:
.cherry-blossom {
/* Modify this color for different sakura petal colors */
background-color: var(--accent-color);
}
Customize the --accent-color
CSS variable in the :root
to change the sakura petal color.
--branch-color-1
and --branch-color-2
variables:
.branch-segment {
background-color: var(--branch-color-1);
}
.sub-branch, .twig {
background-color: var(--branch-color-2);
}
--petal-count
CSS variable.--petal-min-size
and --petal-max-size
.--petal-min-duration
and --petal-max-duration
. Shorter durations mean faster falling.@keyframes gentle-pulse
animation. You can adjust the timing in the animation declaration:
blossom.style.animation = `gentle-pulse ${3 + Math.random() * 2}s infinite ease-in-out`;
Float Animation: The floating animation of spring elements is controlled by the animation-duration
in the @keyframes float
animation applied to .spring-element
. Adjust the animation-duration
in the .spring-element
style to change the speed.
.spring-element {
/* ... other styles ... */
animation: float 15s infinite ease-in-out; /* Adjust '15s' for speed */
}
Sway Animation: The sway of leaves is controlled by the @keyframes sway
animation applied to .leaf
. Adjust the animation-duration
in the .leaf
style to change the sway speed.
.leaf {
/* ... other styles ... */
animation: float 25s infinite ease-in-out, sway 8s infinite ease-in-out; /* Adjust '8s' for sway speed */
}
Branch Count and Position: The number and position of main branches are defined in the createDetailedBranches()
function:
// Reduced number of branches - only 4 total (one on each edge)
// Top edge branch
createBranchStructure('70%', '2%', '15deg', 300);
// Bottom edge branch
createBranchStructure('15%', '94%', '-30deg', 350);
// Left edge branch
createBranchStructure('3%', '30%', '85deg', 280);
// Right edge branch
createBranchStructure('93%', '25%', '-80deg', 260);
You can add more branches by adding more createBranchStructure()
calls with different positions.
Blossom Cluster Density: The number of blossom clusters on each branch is controlled in several places:
// On main branches
const blossomClusterCount = 3 + Math.floor(Math.random() * 3); // 3-5 clusters
// On sub-branches (40% chance)
if (Math.random() > 0.4) {
const blossomClusterCount = 1 + Math.floor(Math.random() * 2);
}
// On twig ends (40% chance)
if (Math.random() > 0.6) {
createBlossomCluster(twig, 0.9);
}
Adjust these numbers and probabilities to increase or decrease the density of blossoms.
Sakura Petals: The number of sakura petals is controlled by the --petal-count
variable:
--petal-count: 60; /* Change to adjust falling petal count */
Background Blossoms: The number of background blossoms is controlled by the loop in the Javascript function createSpringElements()
:
// Create cherry blossoms - only around the edges
for (let i = 0; i < 45; i++) { // Change '45' to adjust background blossom count
// ... blossom creation code ...
}
Leaves: Similarly, the number of leaves is controlled by the loop for leaf creation in createSpringElements()
:
// Create leaves - only around the edges
for (let i = 0; i < 15; i++) { // Change '15' to adjust leaf count
// ... leaf creation code ...
}
This background is designed to work as a base layer. To use it with other overlays:
For best results, use with other overlays from this collection that have transparent backgrounds.
For more advanced customization, you can:
createDetailedBranches()
: Controls the number and position of main branchescreateBranchStructure()
: Controls the structure of each main branchcreateSubBranch()
: Controls the sub-branchescreateTwig()
: Controls the smallest branch elementscreateBlossomCluster()
: Creates and positions cherry blossom clustersIf you have any questions about customizing this overlay or encounter any issues, please open an issue in the GitHub repository.