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

              
                #whymakesense

%h1 Why Make Sense?

%p Due to a unique and bespoke printing technique, Hot Chip's new album “Why Make Sense?” will come in one of 501 different colors. This demo uses speech recognition to accept colors which adjust the artwork and allows us to visualize some of the varieties. Start by allowing access to your microphone near your browser's URL bar and speaking a color when your browser tab blinks red.
              
            
!

CSS

              
                @import compass

+font-face('oldsansblack', font-files('http://dominorecordco.com/whymakesense/css/font/OldSansBlack.ttf', 'http://dominorecordco.com/whymakesense/css/font/OldSansBlack.eot', 'http://dominorecordco.com/whymakesense/css/font/OldSansBlack.svg#56d0bd399bd7a9dc585ad9fb025af015', 'http://dominorecordco.com/whymakesense/css/font/OldSansBlack.woff'))

@mixin square($size)
  height: $size
  width: $size

html, body
  font: 14px "oldsansblack"
  overflow: hidden
  +square(100%)
  
a
  color: black
  +transition(1s color)
  
body
  +display-flex
  +align-items(center)
  +flex-direction(column)
  +justify-content(center)

#whymakesense
  background:
    color: gray
    image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/141041/hotchip.png)
    size: cover
  +square(380px)
  +transition(1s background)
    
h1
  font-size: 32px
  margin: 20px 0
  text-transform: uppercase
  +transition(1s color)
  
p
  line-height: 24px
  text-align: center
  width: 640px
  
@media only screen and (max-width: 479px)
  #whymakesense
    +square(260px)
  h1
    font-size: 24px
    margin: 20px 0
  p
    +box-sizing(border-box)
    font-size: 10px
    line-height: 18px
    padding: 0 15px
    width: 100%

              
            
!

JS

              
                $ ->
  if annyang
    commands =
    	'*term': (data) ->
        color = $.Color(data)
        
        $("#whymakesense").css backgroundColor: color.toHexString()
        $("h1, a").css color: color.toHexString()        
        
    annyang.addCommands(commands)    
    annyang.start()
    
  else
    $("p").append "<br><br>Please use a browser which supports speech recognition, like <a href='https://google.com/chrome'>Chrome</a>."
              
            
!
999px

Console