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="ta-c ff-c">
   <h1>Template for codepen</h1>
 </div> 
              
            
!

CSS

              
                @charset "utf-8";

/**
* Template for codepen
*
* @author Joël Lesenne Lesenne <https://joellesenne.dev>
* @version 1.0.0
* @create 2017/12/08
* @license MIT <https://opensource.org/licenses/MIT>
*/

/* VARIABLES GLOBAL */
:root {

  /* Color for the development inspirate by <https://dribbble.com/shots/3966419-Personal-website-explorations> */
  --primary-color:#4E57A4;
  --secondary-color:#C8CDFE;
  --third-color:#B8BFFF;
  
  /* Fonts for the development */
  --basefont: calc(1em + (24 - 16) * ( (100vw - 400px) / (1600 - 400)));
  --baseline: 1.15;
  --heading-h1: 2.2em;
  --heading-h2: 1.8em;
  --listfont: 1.5em;
  --font-family-sans: Comfortaa, sans-serif;
  --font-family-cursive: 'Comfortaa', cursive;
  --fontlight: 300;
  --fontregular: 400;
  --fontmediumbold: 600;
  --fontbold: 700;
}

/* Variables for the tablet */
@media only screen and (min-width: 700px) {
    :root {
    }
}

/* Variables for the desktop */
@media only screen and (min-width: 1024px) {
    :root {
        --baseline: 1.28;
    }
}
/* RESET GLOBAL */
*,*:before,*:after{margin:0;padding:0;border:0;}

/* STYLE GLOBAL */

/* box-sizing-border-box */
html{box-sizing:border-box;}

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

/* img-max-width-100% */
img{max-width:100%;} 

/* clairfix */
.cl:after,.cl:before{content:"";display:table;}
.cl:after{clear:both;}
.cl{*zoom:1;}

/* text-size-adjust */
.tsa-100 {-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}

/* no-display */
.no-d{display: none;}

/* display-block */
.d-b{display:block;}

/* display-table */
.d-t{display: table;}

/* display-inline-block */
.d-ib{display:inline-block;}

/* display-grid in learning 
@supports (display: grid) {
  .d-g{display:grid;}
} */

/* display-flex in learning
@supports (display: flex) {
  .d-f{display:flex;}
}*/

/* position-relative */
.p-r{position:relative;}

/* position-absolute */
.p-a{position:absolute;}

/* position-fixed */
.p-f{position:fixed;}

/* available */
.t-0{top:0;}
.l-0{left:0;}
.b-0{bottom:0;}
.r-0{right:0;}

/* margin-horizontal-auto */
.mh-a{margin-left:auto;margin-right:auto;}

/* width 100% */
.w-100 {width: 100%;}

/* width 90% */
.w-90 {width: 90%;}

/* width 80% */
.w-80 {width: 80%;}

/* width 50% */
.w-50 {width: 50%;}

/* width 33.3333% */
.w-33 {width: 33.3333%;}

/* height 100% */
.h-100 {height: 100%;}

/* height 100vh */
.h-100vh{height:100vh;}

/* max-width 100% */
.max-w-100 {max-width: 100%;}

/* max-height 100% */
.max-h-100 {max-height: 100%;}

/* min-width 100% */
.min-w-100 {max-width: 100%;}

/* min-height 100% */
.min-h-100 {min-height: 100%;}

/* no-text-decoration */
.no-td{text-decoration:none;}

/* no-outline */
.no-ol{outline:none;}

/* no-list-style */
.no-ls{list-style:none;}

/* text-left */
.ta-l{text-align: left;}

/* text-align-center */
.ta-c{text-align: center;}

/* text-align-right */
.ta-r{text-align: right;}

/* font-family-sans */
.ff-s{font-family:var(--font-family-sans);}

/* font-family-cursive */
.ff-c{font-family:var(--font-family-cursive);}
/* font-size */
.f-s{font-size:var(--basefont);}

/* line-height */
.l-h{line-height:var(--baseline);}

/* text-adjustment-for-mobile */
.ta-fm{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;}

/* background-color */
.b-c{background-color: RGBA(52, 73, 94, .9);}

/* z-index */
.z-i{z-index:9999;}

/* transition-all */
.t-all{-webkit-transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);}

/* COMPORTMENT CSS */

/* <footer> */
.is-behavior-footer {
  padding: .5rem 0;
  font-size: 1.1vw;
  color:var(--secondary-color);
  background-color:var(--primary-color);
  opacity:.8;
  z-index:999;
}

/* Comportment CSS */

.is-supports-browser{
  position: fixed;
  top: 50%;
  right:2vw;
  font-size: 1vw;
  text-align: center;
  color:#C9CACC;
  border-radius:1vw;
  box-shadow: 0 1px 1px rgba(0,0,0,0.75);
  -webkid-transform: translateY(-50%);
  transform: translateY(-50%);
  z-index:999;
}

.delete {
  position: absolute;
  padding: .5vw 0 0 .5vw;
  widht:40px;
  top:1vh;
  right:1vw;
  text-decoration:none;
  color:#F9FE34;
}

.is-supports-browser::after {
  content: 'Your browser is not compatible with flexbox-css and grid-css.';
  display: block;
  width:150px;
  height:150px;
  padding: 12vh 1vw 0;
  
  background-color:#A14831; 
  border-radius:1vw;
}

@supports (display: flex) {
  .is-supports-browser::after {
    content: "Your browser is compatible with flexbox-css.";
  background-color:#9D6319;
  }
}

@supports (display: grid) {
  .is-supports-browser::after {
    content: "Your browser is compatible with grid-css.";
  background-color:#358176;
  }
}

.is-behavior-logo {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  opacity: .75;
  z-index:999;
}

.is-behavior-logo:hover {
  opacity: 1;
  -webkit-transform: scale(1.125);
  transform: scale(1.125);
  -webkit-animation: gelatine 0.5s 1;
  animation: gelatine 0.5s 1;
  -webkit-transition-timing-function: cubic-bezier(0.6, 4, 0.3, 0.8);
  transition-timing-function: cubic-bezier(0.6, 4, 0.3, 0.8);
}

.is-behavior-link {
  color:var(--third-color);
  opacity:.8;
}
.is-behavior-link:hover {
  opacity:1;
  
}

/**
 * @keyframes gelatine 
 **/
@keyframes gelatine{
  from,to{
    -webkit-transform:scale(1, 1);
    transform:scale(1, 1)
  }
  25%{
    -webkit-transform:scale(.9, 1.1);
    transform:scale(.9, 1.1)
  }
  50%{
    -webkit-transform:scale(1.1, .9);
    transform:scale(1.1, .9)
  }
  75%{
    -webkit-transform:scale(.95, 1.05);
    transform:scale(.95, 1.05)
  }
  from,to{
    -webkit-transform:scale(1, 1);
    transform:scale(1, 1)
  }
  25%{
    -webkit-transform:scale(.9, 1.1);
    transform:scale(.9, 1.1)
  }
  50%{
    -webkit-transform:scale(1.1, .9);
    transform:scale(1.1, .9)
  }75%{
    -webkit-transform:scale(.95, 1.05);
    transform:scale(.95, 1.05)
  }
}

@-webkit-keyframes gelatine{
  from,to{
    -webkit-transform:scale(1, 1);
    transform:scale(1, 1)
  }
  25%{
    -webkit-transform:scale(.9, 1.1);
    transform:scale(.9, 1.1)
  }
  50%{
    -webkit-transform:scale(1.1, .9);
    transform:scale(1.1, .9)
  }
  75%{
    -webkit-transform:scale(.95, 1.05);
    transform:scale(.95, 1.05)
  }
  from,to{
    -webkit-transform:scale(1, 1);
    transform:scale(1, 1)
  }
  25%{
    -webkit-transform:scale(.9, 1.1);
    transform:scale(.9, 1.1)
  }
  50%{
    -webkit-transform:scale(1.1, .9);
    transform:scale(1.1, .9)
  }75%{
    -webkit-transform:scale(.95, 1.05);
    transform:scale(.95, 1.05)
  }
}

              
            
!

JS

              
                /* async function head(){
  let head = '<p><meta name="viewport" content="width-device-width, initial-scale=1"></p>'
  return await 
  document.head.insertAdjacentHTML('afterend', head);
}
head() 

async function logo() {
  let logo ='<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg class="t-o" width="40" height="40" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
    <g transform="matrix(1.28115,0,0,1.30399,-102.318,-119.839)">
        <ellipse cx="392.083" cy="398.652" rx="267.337" ry="262.655" style="fill:rgb(14,15,79);stroke:rgb(235,235,235);stroke-width:23.98px;"/>
    </g>
    <g transform="matrix(1.21518,0,0,1.2478,-145.205,-84.8221)">
        <ellipse cx="448.661" cy="388.543" rx="205.73" ry="200.353" style="fill:none;stroke:rgb(235,235,235);stroke-width:25.17px;"/>
    </g>
    <g transform="matrix(1,0,0,1,3,0)">
        <path d="M542.216,146.859L405.262,526.349L672.046,500.712C678.203,484.753 682.674,468.043 685.749,450.712L438.262,490.948L583.622,175.4C568.375,163.989 560.301,157.575 542.216,146.859Z" style="fill:url(#_Linear1);"/>
    </g>
    <g transform="matrix(-1,0,0,1,796.519,0)">
        <path d="M542.216,146.859L405.262,526.349L672.046,500.712C678.203,484.753 682.674,468.043 685.749,450.712L438.262,490.948L583.622,175.4C568.375,163.989 560.301,157.575 542.216,146.859Z" style="fill:url(#_Linear2);"/>
    </g>
    <defs>
        <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(280.487,0,0,379.49,405.262,336.604)"><stop offset="0" style="stop-color:rgb(249,79,5);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(235,149,24);stop-opacity:1"/></linearGradient>
        <linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(280.487,0,0,379.49,405.262,336.604)"><stop offset="0" style="stop-color:rgb(249,79,5);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(235,149,24);stop-opacity:1"/></linearGradient>
    </defs>
</svg>'
  return await document.body.insertAdjacentHTML('afterbegin', '<a href="https://joellesenne.xyz" target="_blank" class="d-b p-f is-behavior-logo t-all">' + logo + '</a>');
}
logo()

async function supports(){
  let supports = '<div id="supports" class="is-supports-browser"><a class="delete" id="delete" href="#">X</a></div>';
  return await document.body.insertAdjacentHTML('afterbegin', supports);
}
supports()
let el = document.querySelector('#delete');
el.onclick = function () {
  let del = document.getElementById("supports");
  del.parentNode.removeChild(del);
}
*/

const footer = async () => {
  const textHTML = '<footer class="d-b p-f m-0 p-0 l-0 b-0 r-0 w-100 ta-c ff-s l-h c-777 b-c z-i is-behavior-footer" role="contentinfo"><p class="m-0 p-0">© 2017–<span id="js-current-date"></span> Script & design by <a class="no-td is-behavior-link t-all" href="https://codepen.io/joellesenne/" target="_blank alt="">@joellesenne</a> include pen <a class="no-td is-behavior-link t-all"href="https://codepen.io/joellesenne/pen/pdMPdW" target="_blank alt="">Template for codepen</a></p></footer>'
  return await      document.body.insertAdjacentHTML('beforeend', textHTML);
}
footer()

const el = document.getElementById('js-current-date');
const currentDate = new Date();
const year = currentDate.getFullYear();
el.innerHTML = year;





              
            
!
999px

Console