<?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>DEV Community: Samael</title>
    <description>The latest articles on DEV Community by Samael (@maximeduvey).</description>
    <link>https://dev.to/maximeduvey</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%2F890476%2Ff69b41fc-4e53-4eec-b635-f0fd01055bd5.jpeg</url>
      <title>DEV Community: Samael</title>
      <link>https://dev.to/maximeduvey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maximeduvey"/>
    <language>en</language>
    <item>
      <title>[PURE CSS] border animation without svg</title>
      <dc:creator>Samael</dc:creator>
      <pubDate>Mon, 11 Jul 2022 20:30:01 +0000</pubDate>
      <link>https://dev.to/maximeduvey/pure-css-border-animation-without-svg-2l5d</link>
      <guid>https://dev.to/maximeduvey/pure-css-border-animation-without-svg-2l5d</guid>
      <description>&lt;p&gt;I improved the code you shared with us, it now work with variable size and can be placed everywhere, maybe that will interest you :)&lt;/p&gt;

&lt;p&gt;This is the CSS you can put it in a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    --box-width: 200px;
    --box-lenght: 200px;

    --box-animation-width: calc(var(--box-width) + 20px);
    --box-animation-lenght: calc(var(--box-lenght) + 20px);
}

.animbox::before,
.animbox::after,
.animbox {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.animbox {
    width: var(--box-width);
    height: var(--box-lenght);
    margin: auto;
    color: #69ca62;
    box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5);
}

.animbox::before,
.animbox::after {
    content: "";
    z-index: -1;
    margin: -10px;
    box-shadow: inset 0 0 0 2px;
    animation: clipMe 8s linear infinite;
}

.animbox::before {
    animation-delay: -4s;
}

.animbox:hover::after,
.animbox:hover::before {
    background-color: rgba(255, 0, 0, 0.3);
}

@keyframes clipMe {
    0% {
        clip: rect(0px, var(--box-animation-width), 2px, 0px); /*  ligne du haut */
    }
    25% {
        clip: rect(0px, 2px, var(--box-animation-lenght), 0px); /* ligne de gauche */
    }
    50% {
        clip: rect(calc(var(--box-animation-lenght) - 2px), var(--box-animation-width), var(--box-animation-lenght), 0px); /*  ligne du bas */
    }
    75% {
        clip: rect(0px, var(--box-animation-width), var(--box-animation-lenght), calc(var(--box-animation-width) - 2px) ); /* ligne de droite */
    }
    100% {
        clip: rect(0px, var(--box-animation-width), 2px, 0px); /* ligne du haut */
    }
}

html,
body {
    height: 100%;
}

body {
    background-color: #0f222b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.animboxpospadding {
    padding-top: 250px;
    position: relative;
    margin: 50px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you want to use it with a relative position :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="animboxpospadding"&amp;gt;    
        &amp;lt;div&amp;gt;
            &amp;lt;div class="animbox"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How this can be useful for any of you&lt;/p&gt;




&lt;p&gt;single element animation icon~&lt;/p&gt;

&lt;p&gt;inspired by:&lt;br&gt;
&lt;a href="http://tympanus.net/Tutorials/BorderAnimationSVG/"&gt;http://tympanus.net/Tutorials/BorderAnimationSVG/&lt;/a&gt;&lt;br&gt;
&amp;amp;&lt;br&gt;
&lt;a href="http://mopcon.org/2014/news.php"&gt;http://mopcon.org/2014/news.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;brower support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://caniuse.com/#feat=css-animation"&gt;animation&lt;/a&gt;: IE10+&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clip#Browser_Compatibility"&gt;clip&lt;/a&gt;: all browser&lt;/li&gt;
&lt;/ul&gt;

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

</description>
      <category>codepen</category>
    </item>
  </channel>
</rss>
