Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
<div class="center">
<div class="speedometr">
<svg class="speed" 
   width="400"
   height="342"
   viewBox="0 0 400 342">
  <defs>
    <linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
      <stop offset="0%"   stop-color="#06AFFD"/>
      
      <stop offset="100%" stop-color="#F1E50C"/>
    </linearGradient>
  </defs>
  <defs>
    <linearGradient id="linear2" x1="0%" y1="0%" x2="100%" y2="0%">
      <stop offset="50%"   stop-color="#fff"/>
      
      <stop offset="90%" stop-color="rgba(255,255,255,0)"/>
    </linearGradient>
  </defs>
<defs>
    <filter id="f4" x="0" y="0" width="200%" height="200%">
      <feOffset result="offOut" in="SourceGraphic" dx="0" dy="0" />
      
      <feGaussianBlur result="blurOut" in="matrixOut" stdDeviation="25" />
      <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
    </filter>
  </defs>
  <defs>
    <filter id="f1" x="0" y="0">
      <feGaussianBlur in="SourceGraphic" stdDeviation="7" />
    </filter>
  </defs>
  
<path  id="arc2"
       style="fill:none;fill-rule:evenodd;stroke-width:52;stroke-miterlimit:1;stroke-opacity:0.05;transform-origin:180px 180px;transform:scale(0.9 0.9)"
      transform="scale(0.9 0.9) translate(20 18)"
      stroke="url(#linear)" 
      filter="url(#f1)"
      
        d="m 66.906305,293.33748 a 160.10918,160.10918 0 0 1 10e-7,-226.428566 a 160.10918,160.10918 0 0 1 226.428574,10e-7 a 160.10918,160.10918 0 0 1 -10e-6,226.428565" />
   <path id="path"
       style="fill:none;fill-rule:evenodd;stroke-width:38;stroke-miterlimit:4;stroke:#223050;stroke-opacity:0.5;"          
        d="m 66.906305,293.33748 a 160.10918,160.10918 0 0 1 10e-7,-226.428566 a 160.10918,160.10918 0 0 1 226.428574,10e-7 a 160.10918,160.10918 0 0 1 -10e-6,226.428565" />
  <path
       style="fill:none;fill-rule:evenodd;;stroke-width:40;stroke-miterlimit:4;" stroke="url(#linear)"   
       id="arc"        
        d="m 66.906305,293.33748 a 160.10918,160.10918 0 0 1 10e-7,-226.428566 a 160.10918,160.10918 0 0 1 226.428574,10e-7 a 160.10918,160.10918 0 0 1 -10e-6,226.428565" />
  
  <!-- <line class="line" x1="53" y1="306" x2="180" y2="180" style="stroke:rgb(255,0,0);stroke-width:2;transform-origin:63px 0px"
        /> -->
  <polygon id="bigLine" class="line" fill="url(#linear2)" 
points="180,168 180,192  65,188  65,172" 
style="fill-opacity:0.9;transform-origin:59px 6px" /> 
  
  
  
  <line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(226 180 180)"
        >    
  </line>
  <line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(270 180 180)"
        >    
  </line>
  <line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(315 180 180)"
        >    
  </line>
  <line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(405 180 180)"
        >    
  </line>
<line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(450 180 180)"
        >    
  </line>  
  <line class="metka" x1="180" y1="14" x2="180" y2="26"
        transform="rotate(494 180 180)"
        >    
  </line>
  <line class="metka" x1="180" y1="14" x2="180" y2="26">    
  </line>
  
  <text x="85" y="275" class="number">0</text>
  <text x="50" y="187" class="number">5</text>
  <text x="82" y="100" class="number">10</text>
  <text x="170" y="60" class="number">15</text>
  <text x="255" y="100" class="number">20</text>
  <text x="292" y="187" class="number">25</text>
  <text x="255" y="275" class="number">30</text>
 
  
   
</svg>
  <div id="speed-number" class="speed-number">0</div>
<button id="butanim">START</button>
  <div class="mbps">
    <svg
        width="20"
   height="20"
   viewBox="0 0 20 20" 
         >
      <circle cx="10" cy="10" r="9" stroke="#6EFDF3" stroke-width="2" fill="none" />
      <line x1="10" y1="5" x2="10" y2="14" stroke="#6EFDF3" stroke-width="2"/>
      <line x1="10" y1="13" x2="6" y2="10" stroke="#6EFDF3" stroke-width="2"/>
      <line x1="10" y1="13" x2="14" y2="10" stroke="#6EFDF3" stroke-width="2"/>
    </svg>
    Mbps</div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background-color:#0A0D20;  
  height:100vh;
  background: 
    radial-gradient(
     at 25% 20%, hsla(210, 62%, 8%, 0.96), hsla(232, 52%, 8%, 1)
    );
}
.center{
position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.metka {
  stroke:#fff;
  stroke-width:5;
}
.number {
  fill:#fff;
  font-weight:700;
  font-size:16px;
  opacity:0.8;
  font-family: 'Open Sans', sans-serif;
}
.speedometr {
  position:relative;
  max-width:350px;
}
.speed-number {
  color:#fff;
  font-family: 'Tulpen One', cursive;
  font-size:82px;
  font-weight:400;
  text-align:center;
  position:absolute;
  top:240px;
  width:100%;
}
#butanim {
  width: 10rem;
  border: 2px solid #6EFDF3;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  position: absolute;
  left: calc(50% - 5rem);
  bottom: -5rem;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  line-height: 3rem;
  color: #6EFDF3;
  border-radius: 3rem;
  background-color: transparent;
  cursor: pointer;
  outline: none;
  -webkit-transition: background-color 250ms ease-out;
  transition: background-color 250ms ease-out;
}
.mbps {
  text-align:center;
  font-size:18px;
  color:#86879D; 
  width:100%;
 
}
.mbps svg {
   vertical-align:top;
}
              
            
!

JS

              
                var path = document.getElementById("path");
var pathDimensions = path.getTotalLength();



segment.draw("0%", "0%", 0.1);
segment2.draw("0%", "0%", 0.1);

var counter = { var: 0 };
var tal = document.getElementById("speed-number");


var angle = 270;

var duga = 3.14*160*angle/180;

var segm = pathDimensions/5;

TweenLite.to(".line", 0.1, {rotationZ: "-45", ease:Linear.easeNone});

$('#butanim').hover(
  function(){
  TweenLite.to(".line", 1, {rotationZ: angle - 45, ease:Linear.easeNone});
    segment.draw("0%", duga, 1);
    segment2.draw("0%", duga, 1);
    TweenMax.to(counter, 1, {
      var: 30, 
      onUpdate: function () {
          tal.innerHTML = Math.ceil(counter.var);
      },
      ease:Linear.easeNone
  });
  },
   function(){
   TweenLite.to(".line", 1, {rotationZ: "-45", ease:Linear.easeNone});
     segment.draw("0%", "0%", 1);
     segment2.draw("0%", "0%", 1);
     TweenMax.to(counter, 1, {
      var: 0, 
      onUpdate: function () {
          tal.innerHTML = Math.ceil(counter.var);
      },
      ease:Linear.easeNone
  });
   }
  
);
              
            
!
999px

Console