cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              * {
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
}

@font-face {
  font-family: 'ogd';
  src: url('http://files.salteh.net/ogd/tsaco7.ttf');
  font-weight: 'bold';
  font-style: 'normal';
}

@font-face {
  font-family: 'ogd';
  src: url('http://files.salteh.net/ogd/tsaco5.ttf');
  font-weight: 'normal';
  font-style: 'normal';
}

@font-face {
  font-family: 'ogd';
  src: url('http://files.salteh.net/ogd/tsaco5i.ttf');
  font-weight: 'normal';
  font-style: 'italic';
}
            
          
!
            
              (function () {
    "use strict";
    const OFFSET_X = -100;
    const OFFSET_Y = -63;

    let canvas = document.getElementById('canvas');
    let context = canvas.getContext('2d');
    let position = {
      x: window.innerWidth/2.5 - OFFSET_X/2,
      y: window.innerHeight/2.2 - OFFSET_Y/2
    };
    let rotating = false;

    init();

    function resizeCanvas(oEvent) {
      canvas.width = window.innerWidth;
      canvas.height = window.innerHeight;

      position.x = window.innerWidth/2.5 - OFFSET_X/2;
      position.y = window.innerHeight/2.2 - OFFSET_Y/2;

      draw();
    }

    function draw() {
      context.clearRect(0, 0, canvas.width, canvas.height);
      context.translate(position.x, position.y);
      context.rotate((Math.PI/180)*-1);

      drawText();
      drawShapes();
      context.translate(-position.x, -position.y);
    }

    function drawText() {
      context.fillStyle = '#6C276A';

      // OGD
      context.font = 'bold 82px ogd';
      context.fillText('OGD', OFFSET_X, OFFSET_Y);

      // ict-diensten
      context.font = 'bold 30px ogd';
      context.fillText('ict-diensten', OFFSET_X + 35, OFFSET_Y + 35);

      // samen slimmer
      context.font = 'italic normal 30px ogd';
      context.fillText('samen slimmer', OFFSET_X + 35, OFFSET_Y + 80);
    }

    function drawShapes() {
      context.strokeStyle = '#EE2E24';
      context.fillStyle = '#EE2E24';

      // triangle left
      context.beginPath();
      context.moveTo(OFFSET_X - 80, OFFSET_Y - 50);
      context.lineTo(OFFSET_X - 55, OFFSET_Y - 25);
      context.lineTo(OFFSET_X - 80, OFFSET_Y);
      context.fill();

      // shape right
      context.beginPath();
      context.moveTo(OFFSET_X - 25, OFFSET_Y - 50);  // top right
      context.lineTo(OFFSET_X - 25, OFFSET_Y);        // bottom right
      context.lineTo(OFFSET_X - 63, OFFSET_Y);       // bottom left
      context.lineTo(OFFSET_X - 37, OFFSET_Y - 25);   // center
      context.lineTo(OFFSET_X - 63, OFFSET_Y - 50); // top left
      context.fill();

      // line
      context.lineWidth = 3;
      context.beginPath();
      context.moveTo(OFFSET_X + 35, OFFSET_Y + 57);
      context.lineTo(OFFSET_X + 190, OFFSET_Y + 57);
      context.stroke();
    }

    function toggleRotate(oEvent) {
      oEvent.preventDefault();
      oEvent.stopPropagation();

      if(rotating !== false) {
        clearInterval(rotating);
        rotating = false;
      } else {
        rotating = setInterval(draw, 10);
      }
    }

    function init() {
      // Add event listeners
      window.addEventListener('resize', resizeCanvas, false);
      canvas.addEventListener('click', toggleRotate, false);

      resizeCanvas();

      context.translate(position.x, position.y);
      context.rotate((Math.PI/180)*-20);
      context.translate(-position.x, -position.y);

      // Draw again after 100ms (when the font has loaded)
      setTimeout(draw, 100);
    }
  })();
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console