Pen Settings



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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.


                <div class="doghnuts">
  <canvas width="350" height="350" id="cvs"></canvas>
  <div id="percent"></div>


                canvas {
  border: 1px solid #000;

#percent {
  color: green;
  position: absolute;
  left: 20px;
  bottom: 20px;

.doghnuts {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;


                let canvas = document.querySelector('#cvs');
let ctx = canvas.getContext('2d');
let levelOfKnowledge = document.querySelector('#percent');
let nameOfKnowledge = 'HTML'; //имя знания
let pi = Math.PI;
let coefficient = pi * 2 / 100;
let min = 0; //точка старта анимации
let maxPercent = 78; //процент знаний
let circleStyle = 100;
let k = 1;

//функция которая вроде как должна помочь с плавностью анимации
// t: current time/currnet step
// b: starting position
// c: amount of change (end - start)
// d: total animation time/steps
// function easeInOutQuart(t, b, c, d) {
//   if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
//   return -c/2 * ((t-=2)*t*t*t - 2) + b;
// }

function easeOutQuart(t, b, c, d) {
  return -c * ((t=t/d-1)*t*t*t - 1) + b;

let start = 0;
let frameRate = 60 / 1000;
let duration = 1000;
let currentStep = 0;
let newStep = 0;

let draw = () => {
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  newStep = easeOutQuart(currentStep, start, start - maxPercent, frameRate * duration);

  ctx.strokeStyle = "hsl(190, 100%," + circleStyle + "%" + ")";
  ctx.lineWidth = "30";
  ctx.arc(150, 150, 100, 0, min * coefficient * (1 + Math.pow(1 - min/maxPercent, 2)), false); // fix by Verdi
  levelOfKnowledge.innerHTML = `${nameOfKnowledge}  ${Math.round(min)} %`;
  if (min <= maxPercent) {
  } else {
    // alert(`Мой скилл ${nameOfKnowledge} равен ${maxPercent}% ✔`)