Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <div class="container">
  <img id="img" class="copper" src="" crossorigin="anonymous">

<div class="cards">
  <div id="darker" class="card"></div>
  <div id="dark" class="card"></div>
  <div id="light" class="card"></div>
  <div id="lighter" class="card"></div>
  <div id="cta" class="card"></div>
  <div id="main-color" class="card">
      <input id="my-color" type="text" value="#EB8A71">


                body {
    height: 100%;
    margin: 0;
    background: radial-gradient(
    circle  at 40px -80px, 
    hsl(208,33%,20%) 20%, 
    hsl(208,33%,18%) 30%,
    hsl(208,33%,14%) 46% );
    //base-color background #1E262D
    background-repeat: no-repeat;
    background-attachment: fixed;

// Make card stack spread reusable
@mixin spread($count, $angle) {
  $offset: $angle / 2;
  @for $i from 1 through $count {
    $increment: $angle / ($count + 1);
    div:nth-child(#{$i}) {
      transform: translate(-50%, -50%) rotate(-$offset + $increment * $i);

.cards {
  position: relative;
  height: 50vh;
  width: 100%;
    @include spread(6, 50deg);
  // Create color fan effect
  &:hover {
    @include spread(6, 160deg);

.card {
  height: 60%;
  max-height: 200px;
  min-height: 80px;
  width: 45%;
  max-width: 150px;
  min-width: 110px;
  border-radius: 5px;
  position: absolute;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  left: 50%;
  top: 30%;
  font-size: 20px;
  font-family: Courier;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  line-height: 80px;
  transform-origin: center 120%;
  // Spread cards on hover
  transition: transform 0.5s ease-out;

.container {
  width: 100%;
  height: 50vh;
  position: relative;
  /*background-color: #fff;*/

.copper {
  position: absolute;
  height: 92%;
  max-height: 500px;
  margin-right: auto;
  margin-left: auto;
  bottom: 0;
  left: 0;
  right: 0;
  padding-left: 10%;
  margin-bottom: -3%;


                var myColor = '#EB8A71';
var light, lighter, dark, darker, cta;


function generateColors() {
    // Generate lighter and darker versions of the main color
    light = tinycolor(myColor).lighten(10).desaturate(10).toString();
    lighter = tinycolor(myColor).lighten(20).toString();
    dark = tinycolor(myColor).darken(20).desaturate(25).toString();
    darker = tinycolor(myColor).darken(45).desaturate(55).toString();
    // Generate cta version of the main color
    cta = tinycolor(myColor).darken(8).saturate(90).toString();

    // Paint all those cards!
    document.getElementById('main-color').style.backgroundColor = myColor;
    document.getElementById('main-color').innerHTML = myColor;

    document.getElementById('light').style.backgroundColor = light;
    document.getElementById('light').innerHTML = light;
    document.getElementById('lighter').style.backgroundColor = lighter;
    document.getElementById('lighter').innerHTML = lighter;
    document.getElementById('dark').style.backgroundColor = dark;
    document.getElementById('dark').innerHTML = dark;
    document.getElementById('darker').style.backgroundColor = darker;
    document.getElementById('darker').innerHTML = darker;
    document.getElementById('cta').style.backgroundColor = cta;
    document.getElementById('cta').innerHTML = cta;