<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Spencer</title>
    <description>The latest articles on Forem by Spencer (@oobleck).</description>
    <link>https://forem.com/oobleck</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F719326%2F05a9f962-e311-4b6d-b667-a5558b0a6583.jpeg</url>
      <title>Forem: Spencer</title>
      <link>https://forem.com/oobleck</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/oobleck"/>
    <language>en</language>
    <item>
      <title>CSS Aurora effect</title>
      <dc:creator>Spencer</dc:creator>
      <pubDate>Mon, 02 Jan 2023 22:28:38 +0000</pubDate>
      <link>https://forem.com/oobleck/css-aurora-effect-569n</link>
      <guid>https://forem.com/oobleck/css-aurora-effect-569n</guid>
      <description>&lt;p&gt;I was experimenting with color for another post and was inspired by the text glow effects on &lt;a href="https://open-props.style" rel="noopener noreferrer"&gt;Open Props&lt;/a&gt;. This got me wondering if I could animate an &lt;a href="https://en.wikipedia.org/wiki/Aurora" rel="noopener noreferrer"&gt;Aurora Borealis&lt;/a&gt; affect.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fVsONlc3OUY?start=19"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  The basic aurora glow
&lt;/h2&gt;

&lt;p&gt;The simpler approach is a stack of CSS gradients (simulating a mesh gradient) and animating the background positions of each layer. See the Pen below.&lt;/p&gt;

&lt;p&gt;I think an important, though subtle part of this effect is the text glow as well. It sets the text in the environment and is affected by the aura behind it.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/oobleck/embed/VwBLbNG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Going a step farther
&lt;/h2&gt;

&lt;p&gt;The next experiment alters the text so it interacts with the background, fading in and out of focus as if it's within the aurora.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/oobleck/embed/LYBVjwb?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  The text's aurora
&lt;/h2&gt;

&lt;p&gt;In this experiment, the effect is more subtle. I think this may be the most applicable for real use-case. Even if you turn off the animations it still looks&lt;br&gt;
pretty nice.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/oobleck/embed/dyjoVXz?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  My mind's eye?
&lt;/h2&gt;

&lt;p&gt;This effect where the text appears to emit its own aurora is probably the closest to what I had originally imagined, but it may not be the most realistic in terms of achieving a natural look.&lt;/p&gt;

&lt;p&gt;To achieve this I animated 4 text shadows modifying their x &amp;amp; y offsets, blur radii, and positions in the stack.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/oobleck/embed/JjBdrdb?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Overall, this was a really fun experiment that demonstrates the creative possibilities of CSS. It's always exciting to see what can be done with a little bit of coding knowledge and a lot of imagination. Who knows, maybe a company like Apple will pick up on this effect and use it for a landing page or something similar in the future. In the meantime, why not play around with the CSS Aurora effect and see what you can create?&lt;/p&gt;

</description>
      <category>devmeme</category>
      <category>watercooler</category>
    </item>
  </channel>
</rss>
