Give your Divi theme a festive feel this holiday with a subtle falling candy cane effect. Here's how to add falling candy canes to any Divi section, row or module. Like this:
For 200 years, the candy cane came only in one color: white. The red stripes we know today did not appear until the turn of the 20th century.
To achieve this, first add the following PHP code to your site. It's reasonably long (in part due to the embedded base64 version of the candy cane icon), but don't worry – you shouldn't have to modify it in any way:
if ( ! function_exists( 'divibooster_add_falling_candy_to_section' ) ) {
function divibooster_add_falling_candy_to_section( $output, $render_slug, $module ) {
if ( is_string( $output ) && isset( $module->props['module_class'] ) && in_array( 'falling-candy-canes', explode( ' ', $module->props['module_class'] ) ) ) {
// Inject a container to hold the falling candy canes effect that will be managed by JavaScript
$candy_container = '<div class="falling-candy-container"></div>';
// Insert our falling candy container HTML just inside the main element
$output = preg_replace( '/^(<div [^>]*>)/', '$1' . $candy_container, $output, 1 );
}
return $output;
}
add_filter( 'et_module_shortcode_output', 'divibooster_add_falling_candy_to_section', 10, 3 );
}
// CSS: Basic styles for the falling candy container and candy canes
if (!function_exists('divibooster_falling_candy_css')) {
function divibooster_falling_candy_css() {
?>
<style>
.falling-candy-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
}
.candy-cane {
position: absolute;
top: -10px;
width: 32px;
height: 32px;
background-size: contain;
background-repeat: no-repeat;
opacity: 0.8; /* Adjust opacity as needed */
will-change: transform; /* For better performance */
pointer-events: none; /* Disables events on the candy canes themselves */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALGAAACxgBiam1EAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13dFz1nf//173TJI1kybKKbQw2NYQeCAQSAgkhkwQCiBZ6b6Zmd5Nsyia7+Sa7+9uSzS7G2DTTu8EW2LSh9256dQc3FVdpJE279/eHbEJxUZl7PzNzn49zfLDl0X2/4Ij5vO6dWyz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J98WTyo2EHBAygAAAIlPVHBr6m/scMb7ORf4YltUlqX//Pz/9+uaRn48lku//JgcL6/wEjMfikJg7t8wAAAABJRU5ErkJggg==);
}
@keyframes fall-left {
from { transform: translateY(0); }
to { transform: translateY(100vh); }
}
@keyframes fall-right {
from { transform: translateY(0); }
to { transform: translateY(100vh); }
}
</style>
<?php
}
add_action( 'wp_head', 'divibooster_falling_candy_css' );
}
if (!function_exists('divibooster_falling_candy_js')) {
function divibooster_falling_candy_js() {
?>
<script>
(function() {
var candyContainers = document.querySelectorAll('.falling-candy-container');
if (candyContainers.length === 0) {
return; // Exit if there are no containers
}
// Function to create a single candy cane and animate its fall
function createCandycane(container) {
var candycane = document.createElement('div');
candycane.className = 'candy-cane';
candycane.innerHTML = ' ';
var candycaneStyle = candycane.style;
candycaneStyle.left = (Math.random() * 100) + '%';
container.appendChild(candycane);
// Randomize various style properties
candycaneStyle.opacity = Math.random();
candycaneStyle.fontSize = (Math.random() * 0.5 + 0.5) + 'em';
// Set random duration and rotation speeds for animations
var fallDuration = (Math.random() * 5 + 15) + 's';
var spinDirection = Math.random() < 0.5 ? 'left' : 'right';
candycaneStyle.animation = 'fall-' + spinDirection + ' ' + fallDuration + ' linear forwards';
// Remove the snowflake after it has fallen
setTimeout(() => {
candycane.remove();
}, parseFloat(fallDuration) * 1000); // Convert duration string to milliseconds
}
// Create new candy canes at 300ms intervals inside each container
candyContainers.forEach(function(container) {
setInterval(function() {
createCandycane(container);
}, 300);
});
})();
</script>
<?php
}
add_action( 'wp_footer', 'divibooster_falling_candy_js', 100 );
}
Related Post: Adding PHP to the Divi Theme
Now, on any section, row or module that you want to add falling snow to, just give it a CSS Class of "falling-candy-canes", like so:
0 Comments