CSS Trick! ⭐️
You can create this sparkly backdrop with a single element using mask-composite whilst animating the mask-position 😷
.canvas {
background: var(--gradient);
mask: var(--dots), var(--noise);
mask-composite: intersect /* source-in, xor */;
animation: flicker;
}
@keyframes flicker {
to { mask-position: 50% 50% , 0 50%; }
}
The trick is to layer the masks and then use the intersect value on the mask-composite ✨
Intersect works as it would in SVG by combining the masks and taking their intersection.
The dots mask is a basic radial-gradient that is repeated across the element:
mask: radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / 40px 40px;
The noise mask is a generated image of Perlin Noise (h/t to @JohnPhamous for finding the site for that). That becomes the second mask:
mask: url("noise.png") 50% 50% / 256px 256px;
Once they are intersected. The last piece is to animate the mask-position as shown above 👆
Have a play with the demo and see what you think!
@CodePen link below! 👇
What's new in structured data and Google Search rankings?
Check out the latest Google Search News with @JohnMu and discover the latest search updates 👉 https://t.co/VISAk9a2If
Pillar blog posts are also known as pillar pages or cornerstone content. They are in-depth articles that thoroughly explore a central topic.
Here's how to write one 👇
https://t.co/Ko91AEmSI7.
Mes clients quand ils se rendent compte qu'il y a une une big faille de sécurité sur tous les hébergements #Apache (#log4j) et qu'ils sont sur #nginx !
@semrush_fr Les gens veulent toujours écrire en pensant referencement mais Google aime bien quand on ecrit nature aussi, bien sur avec un minimum de syntaxe