1.5K views
CSSAdd prefixes
1.gegga { 2 width: 0; 3} 4 5.snurra { 6 filter: url(#gegga); 7} 8 9.stopp1 { 10 stop-color: #f700a8; 11} 12 13.stopp2 { 14 stop-color: #ff8000; 15} 16 17.halvan { 18 animation: Snurra1 10s infinite linear; 19 stroke-dasharray: 180 800; 20 fill: none; 21 stroke: url(#gradient); 22 stroke-width: 23; 23 stroke-linecap: round; 24} 25 26.strecken { 27 animation: Snurra1 3s infinite linear; 28 stroke-dasharray: 26 54; 29 fill: none; 30 stroke: url(#gradient); 31 stroke-width: 23; 32 stroke-linecap: round; 33} 34 35.skugga { 36 filter: blur(5px); 37 opacity: 0.3; 38 position: absolute; 39 transform: translate(3px, 3px); 40} 41 42@keyframes Snurra1 { 43 0% { 44 stroke-dashoffset: 0; 45 } 46 47 100% { 48 stroke-dashoffset: -403px; 49 } 50} 51
HTML
1<svg class="gegga"> 2 <defs> 3 <filter id="gegga"> 4 <feGaussianBlur in="SourceGraphic" stdDeviation="7" result="blur"></feGaussianBlur> 5 <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10" result="inreGegga"></feColorMatrix> 6 <feComposite in="SourceGraphic" in2="inreGegga" operator="atop"></feComposite> 7 </filter> 8 </defs> 9</svg> 10<svg class="snurra" width="200" height="200" viewBox="0 0 200 200"> 11 <defs> 12 <linearGradient id="linjärGradient"> 13 <stop class="stopp1" offset="0"></stop> 14 <stop class="stopp2" offset="1"></stop> 15 </linearGradient> 16 <linearGradient y2="160" x2="160" y1="40" x1="40" gradientUnits="userSpaceOnUse" id="gradient" xlink:href="#linjärGradient"></linearGradient> 17 </defs> 18 <path class="halvan" d="m 164,100 c 0,-35.346224 -28.65378,-64 -64,-64 -35.346224,0 -64,28.653776 -64,64 0,35.34622 28.653776,64 64,64 35.34622,0 64,-26.21502 64,-64 0,-37.784981 -26.92058,-64 -64,-64 -37.079421,0 -65.267479,26.922736 -64,64 1.267479,37.07726 26.703171,65.05317 64,64 37.29683,-1.05317 64,-64 64,-64"></path> 19 <circle class="strecken" cx="100" cy="100" r="64"></circle> 20</svg> 21<svg class="skugga" width="200" height="200" viewBox="0 0 200 200"> 22 <path class="halvan" d="m 164,100 c 0,-35.346224 -28.65378,-64 -64,-64 -35.346224,0 -64,28.653776 -64,64 0,35.34622 28.653776,64 64,64 35.34622,0 64,-26.21502 64,-64 0,-37.784981 -26.92058,-64 -64,-64 -37.079421,0 -65.267479,26.922736 -64,64 1.267479,37.07726 26.703171,65.05317 64,64 37.29683,-1.05317 64,-64 64,-64"></path> 23 <circle class="strecken" cx="100" cy="100" r="64"></circle> 24</svg>