Pen Settings

HTML

CSS

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

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

              
                - var color = ['#4370FA', '#1C1C1C', '#2B7173']
- var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('')
-
  var letters = {
    a: ['1', '', '2', '', 'e', '', '', '', '', '', 'e', ''],
    b: ['2', '1', '2', '', '', '3', '', '', '2', '', '4', '3'],
    c: ['1', '', '2', '', 'e', 'e', '', 'e', 'e', '4', '', '3'],
    d: ['', '', '2', '', 'e', '', '', 'e', '', '', '', '3'],
    e: ['', '', '2', '', 't', 'e', '', 'e', 'e', '', '', '3'],
    f: ['', '', '3', '', 't', 'e', '', 'e', 'e', '', 'e', 'e'],
    g: ['1', '', '2', '', 'e', 'e', '', 'e', '2', '4', '', '3'],
    h: ['', 'e', '', '', 't', '', '', 'e', '', '', 'e', ''],
    i: ['', '', '3', 'e', '', 'e', 'e', '', 'e', '1', '', ''],
    j: ['', '', '', 'e', 'e', '', '1', 'e', '', '4', '', '3'],
    k: ['', 'e', '', '', 'e', '', '', '', '3', '', 'e', '2'],
    l: ['', 'e', 'e', '', 'e', 'e', '', 'e', 'e', '', '', ''],
    m: ['2', 'e', '1', '', '', '', '', '', '', '3', '3 4', '4'],
    n: ['1', '2', '', '', '', '', '', '', '', '', '4', '3'],
    o: ['1', '', '2', '', 'e', '', '', 'e', '', '4', '', '3'],
    p: ['', '', '2', '', 'e', '', '', '', '3', '', 'e', 'e'],
    q: ['1', '', '2', '', 'e', '', '', 'e', '', '4', '', '4'],
    r: ['', '', '2', '', 'e', '', '', '', '3', '', 'e', '2'],
    s: ['1', '', '3', '4', '3', 'e', 'e', '1', '2', '1', '', '3'],
    t: ['1', '', '3', 'e', '', 'e', 'e', '', 'e', 'e', '', 'e'],
    u: ['', 'e', '', '', 'e', '', '', 'e', '', '4', '', '3'],
    v: ['', 'e', '', '', 'e', '', '4', 'e', '3', 'e', '3 4', 'e'],
    w: ['2', '1 2', '1', '', '', '', '', '', '', '4', '4', '3'],
    x: ['2', 'e', '1', '4', '', '3', '1', '', '2', '3', 'e', '4'],
    y: ['', 'e', '', '4', '', '3', 'e', '', 'e', 'e', '', 'e'],
    z: ['4', '', '2', 'e', '', '3', '1', '', 'e', '4', '', '2']};

div.container
  each letter, i in alphabet
    div.letter
      each val in letters[Object.keys(letters)[i]]
        span(style='--bg-color:'+color[Math.floor(Math.random() * 3)], class=val)

              
            
!

CSS

              
                html,
body
  min-height: 100%
  position: relative
  background-color: #fbd5c4
  font-size: 6px
  
@media screen and (min-width: 600px)
  html
    font-size: 10px
    
@media screen and (min-width: 900px)
  html
    font-size: 16px
  
body
  display: flex
  justify-content: center
  align-items: center
  height: 100vh
  
.container
  display: grid
  grid-template-columns: repeat(auto-fit, minmax(3.75rem, 1fr))
  grid-gap: 2rem
  max-width: 60rem
  width: 100%
  margin: 5rem
  
.letter
  display: grid
  grid-template-columns: 1fr 1fr 1fr
  grid-template-rows: 1fr 1fr 1fr 1fr
  height: 5rem
  width: 3.75rem
  position: relative
  span
    display: block
    position: relative
    background-color: var(--bg-color)
    &.t
      transform: translateY(50%)
    &.e
      background: none
  
[class~='1']
  border-top-left-radius: 100%
[class~='2']
  border-top-right-radius: 100%
[class~='3']
  border-bottom-right-radius: 100%
[class~='4']
  border-bottom-left-radius: 100%
  
              
            
!

JS

              
                
              
            
!
999px

Console