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 id="container">
  <div id="row1" class="swatch horizontal row1"></div>
  <div id="col1" class="swatch vertical col1"></div>
  <div id="row2" class="swatch horizontal row2"></div>
  <div id="col2" class="swatch vertical col2"></div>
  <div id="row3" class="swatch horizontal row3"></div>
  <div id="col3" class="swatch vertical col3"></div>
  <div id="row4" class="swatch horizontal row4"></div>
  <div id="col4" class="swatch vertical col4"></div>
  <div>
    <div id="palette1" class="selections"></div>
    <div id="palette2" class="selections"></div>
    <div id="palette3" class="selections"></div>
    <div id="palette4" class="selections"></div>
  </div>
  <div id="author">
    <p id="firstname" class="featuredtext">roger</p>
    <p id="lastname" class="featuredtext">adams</p>
  </div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,500,600,700);

// color scheme from kuler.adobe.com
// https://kuler.adobe.com/Seattle-color-theme-3044702/
$swatch1: #555555;
$swatch2: #7BB38E;
$swatch3: #F4F1D7;
$swatch4: #F8AB65;
$swatch5: #F15C4C;

body { 
  margin: 0;
  padding: 0;
  background: $swatch1;
  background-size: auto auto;
}
p {
  display: inline;
  margin-before: 0;
  margin-after: 0;
  margin-start: 0;
  margin-end: 0; 
}
#container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.selections {
  position: absolute;
  width: auto;
  height: auto;
  top: 75%;
  padding: 20px;
  box-shadow: 0 5px 0 black;
  cursor: pointer;
}
.selections:hover {
  box-shadow: 0 3px 0 black;
}
.selections:active {
  box-shadow: none;
}
#palette1 {
  background: $swatch2;
  border-radius: 20px;
  left: 15%;
}
#palette2 {
  background: $swatch3;
  border-radius: 20px;
  left: 25%;
}
#palette3 {
  background: $swatch4;
  border-radius: 20px;
  left: 35%;
}
#palette4 {
  background: $swatch5;
  border-radius: 20px;
  left: 45%;
}
#author {
  position: absolute;
  top: 35%;
  left: 55%;
  padding: 20px;
  border-top-left-radius: 10px;
  border-top-right-radius: 30px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
  background: $swatch1;
  opacity: 0.85;
  box-shadow: 0 6px 0 0 $swatch2,
              0 12px 0 0 $swatch3,
              0 18px 0 0 $swatch4,
              0 24px 0 0 $swatch5;
}
/* #author:hover {
  animation: nameHover 1s linear infinite alternate;
} */
.featuredtext {
  font:400 5.9em 'Raleway', sans-serif;
}
#firstname {
  text-shadow: 0 5px 0 black;
  color: $swatch2;
  font-size: 4.2em;
}
#lastname {
  text-shadow: 0 8px 0 black;
  color: $swatch4;
  font-weight: bold;
}
.swatch { position: absolute; }
.horizontal { width: 100%; }
.vertical { height: 100%; }
.row1 {
  height: 14%;
  top: 14%;
  background-color: $swatch2;
  box-shadow: 0 0 3px 3px $swatch2;
  animation: row1movement 6s linear infinite;
}
.row2 {
  height: 24%;
  top: 43%;
  background-color: $swatch3;
  box-shadow: 0 0 3px 3px $swatch3;
  animation: row2movement 8s linear infinite;
}
.row3 {
  height: 11%;
  top: 78%;
  background-color: $swatch4;
  box-shadow: 0 0 3px 3px $swatch4;
  animation: row3movement 10s linear infinite;
}
.row4 {
  height: 11%;
  top: 22%;
  background-color: $swatch5;
  box-shadow: 0 0 3px 3px $swatch5;
  animation: row4movement 12s linear infinite;
}
.col1 {
  width: 21%;
  left: 12%;
  background-color: $swatch5;
  box-shadow: 0 0 3px 3px $swatch5;
  animation: col1movement 12s linear infinite;
}
.col2 {
  width: 13%;
  left: 44%;
  background-color: $swatch4;
  box-shadow: 0 0 3px 3px $swatch4;
  animation: col2movement 10s linear infinite;
}
.col3 {
  width: 11%;
  left: 81%;
  background-color: $swatch3;
  box-shadow: 0 0 3px 3px $swatch3;
  animation: col3movement 8s linear infinite;
}
.col4 {
  width: 8%;
  left: 63%;
  background-color: $swatch2;
  box-shadow: 0 0 3px 3px $swatch2;
  animation: col4movement 6s linear infinite;
}

@keyframes row1movement {
  0%  { top: 14%; height: 14%; opacity: 1.0; }
  20% { top: 25%; height: 22%; }
  40% { top: 75%; height: 25%; }
  60% { top: 49%; height: 17%; opacity: 0.25; }
  80% { top: 23%; height:  8%; }
}
@keyframes row2movement {
  0%  { top: 43%; height: 24%; opacity: 1.0; }
  20% { top: 32%; height: 11%; }
  40% { top: 77%; height: 14%; }
  60% { top: 82%; height: 22%; opacity: 0.5; }
  80% { top: 59%; height: 18%; }
}
@keyframes row3movement {
  0%  { top: 78%; height: 11%; opacity: 1.0; }
  20% { top: 54%; height: 13%; }
  40% { top: 66%; height: 18%; }
  60% { top: 52%; height: 11%; opacity: 0.4; }
  80% { top: 69%; height: 15%; }
}
@keyframes row4movement {
  0%  { top: 22%; height: 11%; opacity: 1.0; }
  20% { top:  9%; height: 19%; }
  40% { top: 31%; height: 13%; }
  60% { top: 58%; height: 24%; opacity: 0.25; }
  80% { top: 27%; height: 15%; }
}
@keyframes col1movement {
  0%  { left: 12%; width: 21%; opacity: 1.0; }
  20% { left: 25%; width: 22%; }
  40% { left: 75%; width: 25%; }
  60% { left: 49%; width: 17%; opacity: 0.4; }
  80% { left: 23%; width: 21%; }
}
@keyframes col2movement {
  0%  { left: 44%; width: 13%; opacity: 1.0; }
  20% { left: 32%; width: 11%; }
  40% { left: 77%; width: 14%; }
  60% { left: 82%; width: 22%; opacity: 0.6; }
  80% { left: 59%; width: 18%; }
}
@keyframes col3movement {
  0%  { left: 81%; width: 11%; opacity: 1.0; }
  20% { left: 54%; width: 13%; }
  40% { left: 66%; width: 18%; opacity: 0.3; }
  60% { left: 52%; width: 11%; }
  80% { left: 69%; width: 15%; }
}
@keyframes col4movement {
  0%  { left: 63%; width:  8%; opacity: 1.0; }
  20% { left:  9%; width: 19%; }
  40% { left: 31%; width: 13%; opacity: 0.5; }
  60% { left: 58%; width: 24%; }
  80% { left: 27%; width: 15%; }
}
@keyframes nameHover {
  0%  { box-shadow: 0 24px 0 0 black; }
  25% { box-shadow: 0 18px 0 0 black; }
  50% { box-shadow: 0 12px 0 0 black; }
  75% { box-shadow: 0 6px 0 0 black; }
 100% { box-shadow: 0 2px 0 0 black; }
}
              
            
!

JS

              
                $(document).ready(function() {
  // using an array to store some color themes.  there is probably a better way to do this.
  var colorBank = new Array()
  
  // https://kuler.adobe.com/Seattle-color-theme-3044702/
  colorBank[0] = '#72655F';
  colorBank[1] = '#F4876B';
  colorBank[2] = '#F1EAD7';
  colorBank[3] = '#F1B2A1';
  colorBank[4] = '#A0D8B5';
  // https://kuler.adobe.com/VERSUZ-2013---def-color-theme-3069671/
  colorBank[5] = '#3D3D3D';
  colorBank[6] = '#ED193A';
  colorBank[7] = '#E6E6E6';
  colorBank[8] = '#01C0EB';
  colorBank[9] = '#66EF55';
  // https://kuler.adobe.com/Copy-of-Copy-of-vintage-card-color-theme-3107075/
  colorBank[10] = '#5C4B51';
  colorBank[11] = '#8CBEB2';
  colorBank[12] = '#F2EBBF';
  colorBank[13] = '#A5C88F';
  colorBank[14] = '#EF847B';
  // https://kuler.adobe.com/Happy-Hipster-color-theme-3096435/
  colorBank[15] = '#555555';
  colorBank[16] = '#7BB38E';
  colorBank[17] = '#F4F1D7';
  colorBank[18] = '#F8AB65';
  colorBank[19] = '#F15C4C';
  //https://kuler.adobe.com/blue-delight-color-theme-3075035/
  colorBank[20] = '#004158';
  colorBank[21] = '#026675';
  colorBank[22] = '#038B8B';
  colorBank[23] = '#F1EEC9';
  colorBank[24] = '#F09979';
  //https://kuler.adobe.com/grulla-color-theme-3097821/
  colorBank[25] = '#44392E';
  colorBank[26] = '#DDD0C2';
  colorBank[27] = '#908170';
  colorBank[28] = '#708790';
  colorBank[29] = '#273B44';
  //https://kuler.adobe.com/DAB_CI_4-color-theme-3098024/
  colorBank[30] = '#288DF6';
  colorBank[31] = '#23D36D';
  colorBank[32] = '#D2EA32';
  colorBank[33] = '#EDA321';
  colorBank[34] = '#F62B19';
  //https://kuler.adobe.com/MyPoints-2-color-theme-3076242/
  colorBank[35] = '#304269';
  colorBank[36] = '#91BED4';
  colorBank[37] = '#D9E8F5';
  colorBank[38] = '#FFFFFF';
  colorBank[39] = '#FFA724';
  
  var index = 0;
  
  function swapColors() {
    $("#container").css({"background":colorBank[index]});
    $("#author").css({"background":colorBank[index],
                      "box-shadow":"0 6px 0 0 " + colorBank[index+1] +
                     ", 0 12px 0 0 " + colorBank[index+2] +
                     ", 0 18px 0 0 " + colorBank[index+3] +
                     ", 0 24px 0 0 " + colorBank[index+4] });
    index++;
    $("#row1").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#col1").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#palette1").css({"background-color":colorBank[index]});
    $("#firstname").css({"color":colorBank[index]});
    index++;
    $("#row2").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#col2").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#palette2").css({"background-color":colorBank[index]});
    index++;
    $("#row3").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#col3").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#palette3").css({"background-color":colorBank[index]});
    $("#lastname").css({"color":colorBank[index]});
    index++;
    $("#row4").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#col4").css({"background-color":colorBank[index], 
                    "box-shadow":"0 0 3px 3px " + colorBank[index]});
    $("#palette4").css({"background-color":colorBank[index]});
    if (index == (colorBank.length-1)) { index = 0; } 
    else { index++; }    
  }
  
  // when button is clicked, swap colors
  $("#palette1").click(function() { swapColors(); });
  $("#palette2").click(function() { swapColors(); });
  $("#palette3").click(function() { swapColors(); });
  $("#palette4").click(function() { swapColors(); });
});
              
            
!
999px

Console