<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to make this illumination effect with CSS]]></title><description><![CDATA[<p dir="auto">simulate a “scan” light that will reveal words in a box, this is my code by now:</p>
<pre><code>const e = document.getElementsByClassName('scan')[0];
document.onmousemove = function(event){
  e.style.left = `${event.clientX}px`;
};
</code></pre>
<pre><code>*{
    margin: 0;
    padding: 0;
}

html, body{
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    
    display: flex;
}

.banner{
    width: 100vw;
    height: 100vh;

    display: flex;
    flex-grow: 1;
    flex-direction: row;
    align-items: center;
    background-color: #031321;
}

.banner .scan{
    width: 7px;
    height: 80%;
    
    position: absolute;
    left: 30px;
    z-index: 3;

    transition: left 50ms ease-out 0s;
    
    border-radius: 15px;
    background-color: #fff;
    box-shadow:
        0 0 15px 5px #fff,  /* inner white */
        0 0 35px 15px #008cff, /* inner blue */
        0 0 350px 20px #0ff; /* outer cyan */
}

.banner .description{
    width: 100%;
    color: white;
    font-size: 3em;
    text-align: center;

    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
</code></pre>
<pre><code>&lt;div class="banner"&gt;
    &lt;div class="scan"&gt;&lt;/div&gt;
    &lt;div class="description"&gt;
        Just trying something
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>
<p dir="auto"><a href="/assets/uploads/files/1606914602950-1.mp4">1.mp4</a></p>
]]></description><link>https://community.secnto.com//topic/2098/how-to-make-this-illumination-effect-with-css</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 01:55:08 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/2098.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Dec 2020 13:00:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to make this illumination effect with CSS on Wed, 02 Dec 2020 13:02:50 GMT]]></title><description><![CDATA[<p dir="auto">You can increase the background-size (500px in this example) to increase transition smoothing.</p>
<pre><code>const e = document.getElementsByClassName('scan')[0];
const hidden = document.getElementsByClassName('hidden')[0];

document.onmousemove = function(event) {
  e.style.left = `${event.clientX}px`; //               ↓ background width (500px) / 2
  hidden.style.setProperty("--pos", `${event.clientX - 250}px`);
};

</code></pre>
<pre><code>* {
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

.banner {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-grow: 1;
  flex-direction: row;
  align-items: center;
  background-color: #031321;
}

.banner .scan {
  width: 7px;
  height: 80%;
  position: absolute;
  left: 30px;
  z-index: 3;
  transition: left 50ms ease-out 0s;
  border-radius: 15px;
  background-color: #fff;
  box-shadow: 0 0 15px 5px #fff, /* inner white */
  0 0 35px 15px #008cff, /* inner blue */
  0 0 350px 20px #0ff;
  /* outer cyan */
}

.banner .description {
  width: 100%;
  color: white;
  font-size: 3em;
  text-align: center;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.hidden {
  background: radial-gradient(dodgerblue 10%, #031321 50%) var(--pos) 50% / 500px 500px no-repeat fixed;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
</code></pre>
<pre><code>&lt;div class="banner"&gt;
  &lt;div class="scan"&gt;&lt;/div&gt;
  &lt;div class="description"&gt;
    Just &lt;span class="hidden"&gt;hidden&lt;/span&gt; something
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>
]]></description><link>https://community.secnto.com//post/6174</link><guid isPermaLink="true">https://community.secnto.com//post/6174</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Wed, 02 Dec 2020 13:02:50 GMT</pubDate></item></channel></rss>