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

              
                h1
  svg role="img"
    title.title Random Words!  
    
 
 
 
 
 
    text.word x="50%" y="50%" text-anchor="middle" fill="#222" stroke="#222" stroke-width="1.5%" dominant-baseline="central" stroke-linecap="round" Random Words1!

    text.word x="50%" y="50%" text-anchor="middle" fill="white" dominant-baseline="central" Random Words1!

              
            
!

CSS

              
                html, body, h1
  
  height: 100%
  width: 100%

body
  transition: background-color 0.3s ease-in
  font-family: 'Open Sans', sans-serif
  background-color: hsl(350, 100%, 50%)
  
  // in firefox, a transformed element causes a scroll when it extends beyond the element's size, so we'll disable it
  overflow: hidden
  
  font-size: 12px
  
  @media (min-width: 480px)
    font-size: 14px
  
  @media (min-width: 640px)
    font-size: 16px
  
.word
  font-family: 'Bangers', cursive
  
svg
  height: 100%
  width: 100%
  position: relative
  top: -1rem
  animation: pop-out 2s ease-in-out infinite
    
.word
  font-family: 'Bangers', cursive
  letter-spacing: 0.05em
  color: white
  padding: 0.5em

  font-size: 28px

  @media (min-width: 480px)
    font-size: 36px

  @media (min-width: 640px)
    font-size: 48px

  @media (min-width: 960px)
    font-size: 64px

  @media (min-width: 1280px)
    font-size: 84px
  
p
  position: fixed
  bottom: 0
  left: 0
  right: 0
  line-height: 2rem
    
  text-align: center
  color: transparentize(white, 0.25)
  background-color: transparentize(#222, 0.0)

@keyframes pop-out
  0%
    transform: scale3d(0, 0, 1)
    opacity: 1
  25%
    transform: scale3d(1, 1, 1)
    opacity: 1
  100%
    transform: scale3d(1.5, 1.5, 1)
    opacity: 0
  
a, a:visited
  color: inherit
              
            
!

JS

              
                $(document).ready(function () {
  // set the background to a random color
  var hue = 350;

  // cache the jquery elements to prevent dom queries during the animation events
  var $body = $("body");
  var $svg = $("svg");
  var $word = $(".word");

  // when the animation iterates
  $("h1").on(
    "webkitAnimationIteration oanimationiteration msAnimationIteration animationiteration ",
    function () {
      // replace the header with a random word
      var word = words[Math.floor(Math.random() * words.length)] + "!";
      $word.text(word);

      // update the background color
      hue += 47;
      $body.css("background-color", "hsl(" + hue + ", 100%, 50%)");
    }
  );
});

// the 10,000 most comment words, taken from https://goo.gl/hfjFkz
words = [
"absolutely",
"accepted",
"acclaimed",
"accomplish",
"accomplishment",
"achievement",
"action",
"active",
"admire",
"adorable",
"adventure",
"affirmative",
"agree",
"agreeable",
"amazing",
"appealing",
"approve",
"attractive",
"awesome",
"beaming",
"beautiful",
"believe",
"beneficial",
"bliss",
"bountiful",
"bounty",
"brave",
"bravo",
"brilliant",
"bubbly",
"calm",
"celebrated",
"certain",
"champ",
"champion",
"charming",
"cheery",
"choice",
"classic",
"clean",
"commend",
"composed",
"congratulation",
"constant",
"cool",
"courageous",
"creative",
"cute",
"dazzling",
"delight",
"delightful",
"divine",
"earnest",
"easy",
"ecstatic",
"effective",
"electrifying",
"elegant",
"enchanting",
"encouraging",
"energetic",
"energized",
"engaging",
"enthusiastic",
"esteemed",
"excellent",
"exciting",
"fabulous",
"fair",
"familiar",
"famous",
"fantastic",
"favorable",
"fetching",
"fine",
"flourishing",
"fortunate",
"fresh",
"friendly",
"funny",
"generous",
"genius",
"genuine",
"giving",
"glamorous",
"glowing",
"good",
"graceful",
"great",
"green",
"growing",
"happy",
"healing",
"healthy",
"hearty",
"honest",
"honorable",
"honored",
"idea",
"ideal",
"imaginative",
"imagine",
"impressive",
"independent",
"innovate",
"innovative",
"instant",
"instinctive",
"intelligent",
"intuitive",
"inventive",
"joy",
"kind",
"laugh",
"legendary",
"light",
"lively",
"lovely",
"lucid",
"lucky",
"luminous",
"marvelous",
"masterful",
"meaningful",
"merit",
"miraculous",
"motivating",
"moving",
"natural",
"nice",
"novel",
"nurturing",
"okay",
"open",
"optimistic",
"phenomenal",
"pleasurable",
"plentiful",
"polished",
"positive",
"powerful",
"prepared",
"pretty",
"principled",
"productive",
"progress",
"prominent",
"protected",
"proud",
"quality",
"quick",
"quiet",
"ready",
"reassuring",
"refined",
"refreshing",
"remarkable",
"resounding",
"respected",
"restored",
"reward",
"rewarding",
"right",
"robust",
"safe",
"satisfactory",
"seemly",
"simple",
"skilled",
"skillful",
"smile",
"sparkling",
"special",
"spirited",
"stirring",
"stupendous",
"success",
"successful",
"sunny",
"super",
"superb",
"supporting",
"surprising",
"terrific",
"thorough",
"thrilling",
"thriving",
"tops",
"tranquil",
"transformative",
"transforming",
"trusting",
"truthful",
"unwavering",
"up",
"upbeat",
"upstanding",
"valued",
"vibrant",
"victorious",
"vital",
"wealthy",
"welcome",
"well",
"whole",
"wholesome",
"willing",
"wonderful",
"wondrous",
"worthy",
  "Awesome"
  ]
              
            
!
999px

Console