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

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.

HTML

              
                //
// Example

-
  let users = [
    {
      id: 1,
      name: 'Wade Warren',
      avatar: 'https://randomuser.me/api/portraits/men/32.jpg',
      employment: 'Marketing Liaison',
      skills: 'Coordinator 💪',
    },
    {
      id: 2,
      name: 'Loura Weber',
      avatar: 'https://randomuser.me/api/portraits/women/44.jpg',
      employment: 'Lead Manager',
      skills: 'Confidence',
    },
    {
      id: 3,
      name: 'Jane Cooper',
      avatar: 'https://randomuser.me/api/portraits/men/46.jpg',
      employment: 'Dog Trainer',
      skills: 'Trainer',
    },
    {
      id: 4,
      name: 'Guy Hawkins',
      avatar: 'https://randomuser.me/api/portraits/men/47.jpg',
      employment: 'Medical Assistant',
      skills: 'Assitant',
    },
    {
      id: 5,
      name: 'Robert Fox',
      avatar: 'https://randomuser.me/api/portraits/women/63.jpg',
      employment: 'Web Designer',
      skills: 'Work under pressure',
    }
  ]

body

  .toast#toats Saving...

  .content
    h1 Follow a Members
      span.day( style="display: inline-block") 😎
      span.night( style="display: none") 👀
    .toggle-theme-content
      button(type="button" class="btn toggle-theme") Dark
    .user-list
      each user, index in users
        .user-row
          .user
            .avatar-content
              img(src=user.avatar alt=user.name).avatar
            .user-body
              a(href="#/" class="title")=user.name
              .skills
                span(class="subtitle")=user.employment
                span(class="subtitle")=user.skills
          .user-option
            button(type="button" class="btn btn-follow" ) Follow
      a(href="#/" class="show-more") Show more members



    //
    // Footer

    footer.footer
      p.me-content
        | Built by
        a.me(href='https://codesandbox.io/u/frankuxui') Frank Esteban
      p(style='margin-bottom: 0.8rem')
        | Contact me on the different platforms and social networks
      .footer-social
        a.footer-social-link(href='https://www.linkedin.com/in/frankuxui/' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            circle(cx='4.983' cy='5.009' r='2.188' fill='currentColor')
            path(d='M9.237 8.855v12.139h3.769v-6.003c0-1.584.298-3.118 2.262-3.118 1.937 0 1.961 1.811 1.961 3.218v5.904H21v-6.657c0-3.27-.704-5.783-4.526-5.783-1.835 0-3.065 1.007-3.568 1.96h-.051v-1.66H9.237zm-6.142 0H6.87v12.139H3.095z' fill='currentColor')
        a.footer-social-link(href='https://www.figma.com/@frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M15.332 8.668a3.333 3.333 0 0 0 0-6.663H8.668a3.333 3.333 0 0 0 0 6.663 3.333 3.333 0 0 0 0 6.665 3.333 3.333 0 0 0 0 6.664A3.334 3.334 0 0 0 12 18.664V8.668h3.332z' fill='currentColor')
            circle(cx='15.332' cy='12' r='3.332' fill='currentColor')
        a.footer-social-link(href='https://dribbble.com/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M20.66 6.98a9.932 9.932 0 0 0-3.641-3.64C15.486 2.447 13.813 2 12 2s-3.486.447-5.02 1.34c-1.533.893-2.747 2.107-3.64 3.64S2 10.187 2 12s.446 3.487 1.34 5.02a9.924 9.924 0 0 0 3.641 3.64C8.514 21.553 10.187 22 12 22s3.486-.447 5.02-1.34a9.932 9.932 0 0 0 3.641-3.64C21.554 15.487 22 13.813 22 12s-.446-3.487-1.34-5.02zM12 3.66c2 0 3.772.64 5.32 1.919-.92 1.174-2.286 2.14-4.1 2.9-1.002-1.813-2.088-3.327-3.261-4.54A7.715 7.715 0 0 1 12 3.66zM5.51 6.8a8.116 8.116 0 0 1 2.711-2.22c1.212 1.201 2.325 2.7 3.34 4.5-2 .6-4.114.9-6.341.9-.573 0-1.006-.013-1.3-.04A8.549 8.549 0 0 1 5.51 6.8zM3.66 12c0-.054.003-.12.01-.2.007-.08.01-.146.01-.2.254.014.641.02 1.161.02 2.666 0 5.146-.367 7.439-1.1.187.373.381.793.58 1.26-1.32.293-2.674 1.006-4.061 2.14S6.4 16.247 5.76 17.5c-1.4-1.587-2.1-3.42-2.1-5.5zM12 20.34c-1.894 0-3.594-.587-5.101-1.759.601-1.187 1.524-2.322 2.771-3.401 1.246-1.08 2.483-1.753 3.71-2.02a29.441 29.441 0 0 1 1.56 6.62 8.166 8.166 0 0 1-2.94.56zm7.08-3.96a8.351 8.351 0 0 1-2.58 2.621c-.24-2.08-.7-4.107-1.379-6.081.932-.066 1.765-.1 2.5-.1.799 0 1.686.034 2.659.1a8.098 8.098 0 0 1-1.2 3.46zm-1.24-5c-1.16 0-2.233.047-3.22.14a27.053 27.053 0 0 0-.68-1.62c2.066-.906 3.532-2.006 4.399-3.3 1.2 1.414 1.854 3.027 1.96 4.84-.812-.04-1.632-.06-2.459-.06z' fill='currentColor')
        a.footer-social-link(href='https://codesandbox.io/u/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M2 6l10.455-6L22.91 6 23 17.95 12.455 24 2 18V6zm2.088 2.481v4.757l3.345 1.86v3.516l3.972 2.296v-8.272L4.088 8.481zm16.739 0l-7.317 4.157v8.272l3.972-2.296V15.1l3.345-1.861V8.48zM5.134 6.601l7.303 4.144 7.32-4.18-3.871-2.197-3.41 1.945-3.43-1.968L5.133 6.6z' fill='currentColor')
        a.footer-social-link(href='https://codepen.io/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M21.838 8.445c0-.001-.001-.001 0 0l-.003-.004-.001-.001v-.001a.809.809 0 0 0-.235-.228l-9.164-6.08a.834.834 0 0 0-.898 0L2.371 8.214A.786.786 0 0 0 2 8.897v6.16a.789.789 0 0 0 .131.448v.001l.002.002.01.015v.002h.001l.001.001.001.001c.063.088.14.16.226.215l9.165 6.082a.787.787 0 0 0 .448.139.784.784 0 0 0 .45-.139l9.165-6.082a.794.794 0 0 0 .371-.685v-6.16a.793.793 0 0 0-.133-.452zm-9.057-4.172 6.953 4.613-3.183 2.112-3.771-2.536V4.273zm-1.592 0v4.189l-3.771 2.536-3.181-2.111 6.952-4.614zm-7.595 6.098 2.395 1.59-2.395 1.611v-3.201zm7.595 9.311-6.96-4.617 3.195-2.15 3.765 2.498v4.269zm.795-5.653-3.128-2.078 3.128-2.105 3.131 2.105-3.131 2.078zm.797 5.653v-4.27l3.766-2.498 3.193 2.15-6.959 4.618zm7.597-6.11-2.396-1.611 2.396-1.59v3.201z' fill='currentColor')
        a.footer-social-link(href='https://tailwindcomponents.com/u/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M18.5 9.51a4.22 4.22 0 0 1-1.91-1.34A5.77 5.77 0 0 0 12 6a4.72 4.72 0 0 0-5 4 3.23 3.23 0 0 1 3.5-1.49 4.32 4.32 0 0 1 1.91 1.35A5.77 5.77 0 0 0 17 12a4.72 4.72 0 0 0 5-4 3.2 3.2 0 0 1-3.5 1.51zm-13 4.98a4.22 4.22 0 0 1 1.91 1.34A5.77 5.77 0 0 0 12 18a4.72 4.72 0 0 0 5-4 3.23 3.23 0 0 1-3.5 1.49 4.32 4.32 0 0 1-1.91-1.35A5.8 5.8 0 0 0 7 12a4.72 4.72 0 0 0-5 4 3.2 3.2 0 0 1 3.5-1.51z' fill='currentColor')
        a.footer-social-link(href='https://github.com/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z' fill='currentColor')
        a.footer-social-link(href='https://www.instagram.com/frankuxui/' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M7.8,2H16.2C19.4,2 22,4.6 22,7.8V16.2A5.8,5.8 0 0,1 16.2,22H7.8C4.6,22 2,19.4 2,16.2V7.8A5.8,5.8 0 0,1 7.8,2M7.6,4A3.6,3.6 0 0,0 4,7.6V16.4C4,18.39 5.61,20 7.6,20H16.4A3.6,3.6 0 0,0 20,16.4V7.6C20,5.61 18.39,4 16.4,4H7.6M17.25,5.5A1.25,1.25 0 0,1 18.5,6.75A1.25,1.25 0 0,1 17.25,8A1.25,1.25 0 0,1 16,6.75A1.25,1.25 0 0,1 17.25,5.5M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z' fill='currentColor')
        a.footer-social-link(href='https://dev.to/frankuxui' target='_blank')
          svg(width='28' height='28' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M7.73 11.93C7.73 13.65 7.71 13.76 7.5 14C7.31 14.17 7.12 14.23 6.74 14.23L6.23 14.24L6.2 11.97L6.18 9.7H6.7C7.05 9.7 7.3 9.77 7.47 9.91C7.71 10.12 7.73 10.16 7.73 11.93M22 7.5V16.5C22 17.61 21.11 18.5 20 18.5H4C2.89 18.5 2 17.61 2 16.5V7.5C2 6.39 2.89 5.5 4 5.5H20C21.11 5.5 22 6.39 22 7.5M8.93 11.73C8.9 9.89 8.88 9.74 8.64 9.34C8.24 8.66 7.79 8.5 6.28 8.5H5V15.5H6.21C7.54 15.5 8.1 15.33 8.5 14.79C8.91 14.26 9 13.81 8.93 11.73M13.12 8.5H11.64C10.15 8.5 10.14 8.5 9.93 8.78S9.7 9.21 9.7 12V14.96L9.97 15.23C10.22 15.5 10.28 15.5 11.68 15.5H13.12V14.31L12.03 14.27L10.93 14.24V12.6L11.61 12.57L12.27 12.53V11.34H10.88V9.7H13.12V8.5M19 8.56C19 8.5 18.7 8.5 18.34 8.5L17.66 8.56L17.07 10.91C16.69 12.39 16.45 13.18 16.4 13.04C16.32 12.77 15.26 8.6 15.26 8.55C15.26 8.5 14.95 8.5 14.58 8.5H13.89L14.3 10.05C14.5 10.92 14.89 12.33 15.11 13.2C15.45 14.55 15.57 14.85 15.86 15.14C16.06 15.36 16.31 15.5 16.47 15.5C16.8 15.5 17.23 15.16 17.37 14.77C17.5 14.5 19 8.69 19 8.56Z' fill='currentColor')
        a.footer-social-link(href='https://twitter.com/frankuxui' target='_blank')
          svg(width='24' height='24' viewbox='0 0 24 24' xmlns='http://www.w3.org/2000/svg')
            path(d='M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z' fill='currentColor')
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root{
  --body-bg: #eceff1;
  --body-color: #000;
  --user-list-bg: white;
  --user-list-hover: #f6f8f9;
  --subtitle-color: #747c81; 
  --toast-bg: black;
  --toast-color: white;
  --btn-bg: #6911e7;
  --btn-color: white;
  --footer-color: #000;
  --footer-hover: #d6dbdf;
}

.dark{
  --body-bg: #172024;
  --body-color: white;
  --user-list-bg: #263238;
  --user-list-hover: #303e44;
  --subtitle-color: #b0bec5;
  --title-color: white;
  --toast-bg: white;
  --toast-color: black;
  --btn-bg: white;
  --btn-color: black;
  --footer-color: white;
  --footer-hover: #243136;
}

//
// Reset

*, ::after, ::before {
  box-sizing: border-box;
}
p{
  font-size: 1rem;
  margin: 0 0 .6rem 0;
}
body{
  font-family: 'Roboto', sans-serif;
  background: var(--body-bg);
  color: var(--body-color);
  line-height: 1.5;
}

//
// Example

.content{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
}
.user-list{
  display: flex;
  flex-direction: column;
  background-color: var(--user-list-bg);
  border-radius: .8rem;
  padding: 1rem 0;
  min-width: 5rem;
  margin-bottom: 4rem;
}
.user-row{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  cursor: pointer;
  transition: all .2s ease-in-out;
  &:hover{
    background-color: var(--user-list-hover);
  }
}
.user{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  .avatar-content{
    margin-bottom: .6rem;
    .avatar{
      border-radius: 50%;
      width: 70px;
      height: 70px;
    }
  }
  .user-body{
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    .title{
      font-weight: 500;
      color: var(--title-color);
      text-decoration: none;
    }
    .subtitle{
      color: var(--subtitle-color)
    }
    .skills{
      display: flex;
      flex-direction: column;
    }
  }
}

.user-option{
  margin-left: auto;
  margin-right: auto;
}


//
// Button

.btn{
  display: inline-block;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .025rem;
  font-family: 'Roboto',sans-serif;
  color: var(--btn-color);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 0;
  background-color: var(--btn-bg);
  user-select: none;
  padding: .3rem 1rem;
  white-space: nowrap;
  font-size: 1rem;
  border-radius: 0.25rem;
  transition: color .2s ease-in-out, 
              border-color .2s ease-in-out, 
              background-color .2s ease-in-out, 
              box-shadow .2s ease-in-out;
  &.active{
    opacity: .7;
    //pointer-events: none;
  }
}

//
// Responsive

@media(min-width: 540px){
  .user-row{
    flex-direction: row;
    padding: 1rem 2rem;
  }
  .user{
    flex-direction: row;
    text-align: left;
    .avatar-content{
      margin-right: .6rem;
      margin-bottom: 0;
    }
    .user-body{
      margin-right: 1rem;
      margin-bottom: 0;
    }
  }
  .user-option{
    margin-left: auto;
    margin-right: 0;
  }
}


//
// Show more members

.show-more{
  display: block;
  width: 90%;
  margin: 0 auto;
  padding: .6rem 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: 0.25rem;
  color: var(--title-color);
  font-weight: 500;
  transition: all .2s ease-in-out;
  &:hover{
    background-color: var(--user-list-hover);
  }
}


//
// Toast

.toast{
  position: fixed;
  bottom: 10%;
  left: 10%;
  z-index: 9000;
  background-color: var(--toast-bg);
  color: var(--toast-color);
  padding: .5rem 1.5rem;
  border-radius: 0.25rem;
  visibility: hidden;
  font-weight: 500;
  text-align: center;
  font-size: 18px;
}


//
// Toggle theme

.toggle-theme-content{
  margin-bottom: 2rem;
}

              
            
!

JS

              
                let follow = document.querySelectorAll('.btn-follow')
let toast = document.querySelector('#toats')
let toggle = document.querySelector('.toggle-theme')
let body = document.body

follow.forEach((e) => {
  e.addEventListener('click', (element) => {
    let target = element.target
    toast.style.visibility = "visible";
    setTimeout(() => {
      toast.style.visibility = "hidden";
    }, 500)
    if( target.innerText === 'Follow'){
      target.innerText = 'Following'
      target.classList.add('active')
    }else{
      target.innerText = 'Follow'
      target.classList.remove('active')
    }
  })
})

// Toggle theme

let day = document.querySelector('.day')
let night = document.querySelector('.night')

toggle.addEventListener('click', (e) => {
  if( toggle.innerText === 'Dark'){
    toggle.innerText = 'Light'
    day.style.display = 'none'
    night.style.display = 'inline-block'  
  }else{
    toggle.innerText = 'Dark'
    day.style.display = 'inline-block'
    night.style.display = 'none'
  }
  body.classList.toggle('dark')
})

              
            
!
999px

Console