LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code


  
    
      Click to Show or Hide Menu
      

    
  





CSS
body {
  background: #e9f3f0;
  max-width: 70rem;
  margin: 0 auto;
  padding: 2rem 20px 3rem;
  font-family: "ff-tisa-sans-web-pro", Trebuchet MS,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Tahoma, sans-serif;
  -webkit-transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
  transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
}

a {
  color: #4274b0;
  text-decoration: none;
  -webkit-transition: color .2s;
  transition: color .2s;
  -ms-touch-action: manipulation;
      touch-action: manipulation;
}
a:focus {
  outline: 1px dotted #4274b0;
}
a:hover, a:focus {
  color: #315581;
}

.dash-list {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-flow: row wrap;
      flex-flow: row wrap;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  list-style: none;
  margin-left: 0;
}

.dash-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -ms-flex-line-pack: end;
      align-content: flex-end;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  padding: 1.2rem 1.4rem 1rem;
  background: #fff;
  list-style: none;
  -webkit-transition: all .5s;
  transition: all .5s;
  margin: 0 0 0.8rem;
  position: relative;
  overflow: hidden;
  -webkit-transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
  transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
}
@media (min-width: 500px) {
  .dash-item {
    -ms-flex-preferred-size: 49%;
        flex-basis: 49%;
    margin: 0 2% 0.8rem 0;
  }
  .dash-item:nth-child(2n) {
    margin-right: 0;
  }
}
@media (min-width: 800px) {
  .dash-item {
    -ms-flex-preferred-size: 28%;
        flex-basis: 28%;
    margin-right: 1.25%;
  }
  .dash-item:nth-child(2n) {
    margin-right: 1.25%;
  }
  .dash-item:nth-child(3n) {
    margin-right: 0;
  }
}

.dash-item--published {
  box-shadow: inset 4px 0 0 #3bb275, 0 1px 0 rgba(0, 0, 0, 0.1);
}

.dash-item--draft {
  box-shadow: inset 4px 0 0 #92dbb6, 0 1px 0 rgba(0, 0, 0, 0.1);
}

.dash-item__header {
  position: relative;
  z-index: 99;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.dash-item__title {
  font-size: 1rem;
  padding: 0 24px 0.5rem 0;
  margin: 0;
}

.dash-item__content {
  padding: 1.8rem 0 0.375rem;
  position: relative;
  -webkit-transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
  transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
}

.dash-item__status {
  font-size: .7rem;
  font-weight: 300;
  text-transform: uppercase;
  color: #888;
  position: absolute;
}

.dash-item__nav {
  position: absolute;
  right: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-item__nav__item {
  display: inline-block;
  font-size: 0.85rem;
  margin-bottom: 0;
  padding-bottom: 0;
  margin-right: 10px;
}
.dash-item__nav__item:last-of-type {
  margin-right: 0;
}

.dash-item__nav--collapsible {
  display: none;
  position: absolute;
  background: #fff;
  bottom: auto;
  right: auto;
  top: 100%;
  margin-top: 0.2rem;
  -webkit-transform: translate3d(0, 0, 0);
          transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
  transition: all 0.2s cubic-bezier(0, 0, 0.3, 1);
}
.dash-item__nav--collapsible .dash-item__nav__item {
  padding: 0.4rem 0;
}

.dash-item__menu-action {
  background: none;
  border: none;
  color: #444;
  padding: 0;
  position: absolute;
  bottom: 0;
  right: 0;
  cursor: pointer;
}

.dash-item__menu-action__icon {
  width: 24px;
  height: 24px;
  fill: #444;
  -webkit-transition: all 0.3s cubic-bezier(0, 0, 0.3, 1);
  transition: all 0.3s cubic-bezier(0, 0, 0.3, 1);
}

.dash-item__menu-action__icon--bottom {
  position: absolute;
  left: 0;
}

.dash-list--focus-one {
  background: #bcd4ce;
}
.dash-list--focus-one .dash-item {
  opacity: 0.675;
}
.dash-list--focus-one .dash-item--menu-active {
  -webkit-transform: translate3d(0, -3px, 0);
          transform: translate3d(0, -3px, 0);
  box-shadow: inset 4px 0 0 #3bb275, 0 2px 2px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.dash-item--menu-active .dash-item__menu-action__icon--bottom {
  -webkit-transform: translateY(-15.5%);
          transform: translateY(-15.5%);
}
.dash-item--menu-active .dash-item__menu-action__icon--top {
  -webkit-transform: rotateX(-180deg) translateY(0px);
          transform: rotateX(-180deg) translateY(0px);
}
.dash-item--menu-active .dash-item__nav--collapsible {
  display: block;
  -webkit-animation: slideInTop 0.25s cubic-bezier(0, 0, 0.3, 1) forwards;
          animation: slideInTop 0.25s cubic-bezier(0, 0, 0.3, 1) forwards;
}
.dash-item--menu-active .dash-item__content {
  opacity: 0.4;
  -webkit-transform: translate3d(0, 0.675rem, 0);
          transform: translate3d(0, 0.675rem, 0);
}

.quiz-results {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

.quiz-results__item {
  margin: 0 2% 0 0;
  padding: 0;
  color: #454545;
}
@media (max-width: 280px) {
  .quiz-results__item {
    width: 100%;
    padding: 0;
    margin-bottom: 0.6rem;
  }
}

.quiz-results__number {
  font-size: 1.6rem;
  line-height: 1;
  position: relative;
}

.dash-item--draft .quiz-results__number {
  opacity: 0.5;
}

.quiz-results__number--average-score {
  color: #319461;
}
.quiz-results__number--average-score:after {
  content: '%';
  font-size: .9rem;
  position: absolute;
  top: .3rem;
  right: -0.6rem;
}

.quiz-results__label {
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 300;
  color: #888;
}

@-webkit-keyframes slideInTop {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -20px, 0);
            transform: translate3d(0, -20px, 0);
  }
  100% {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInTop {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -20px, 0);
            transform: translate3d(0, -20px, 0);
  }
  100% {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
  }
}
.twitter__username-link {
  position: relative;
  top: 2rem;
}
JS
jQuery( document ).ready( function( $ ) {
     // add our class to the action menu to set the styles if javascript is enabled
     $('.dash-item__nav').each(function() {
        
         $(this).addClass('dash-item__nav--collapsible')
         .attr('aria-hidden', true)
         .before('');
     });


    $(document).on('click', '.dash-item__menu-action', function() {
       var dashItem = $(this).closest('.dash-item');
 
        if(dashItem.hasClass('dash-item--menu-active')) {
            // remove states from the active menu item
            removeActiveMenuStates(dashItem);
            $('body').removeClass('dash-list--focus-one');

        } else {
            // remove states from any active menu item, if there is one
            var previouslyActiveMenu = $('.dash-item--menu-active');
            if(0 < previouslyActiveMenu.length ) {
                removeActiveMenuStates(previouslyActiveMenu);
            }
                
            // add in the active states to the clicked dashItem
            addActiveMenuStates(dashItem);
           
            // add a class to the body telling that there's a dashItem active
            $('body').addClass('dash-list--focus-one');
            
            // move focus to first item in newly opened menu
            $('.dash-item__nav__item:eq(0) a', dashItem).focus();
        }
    });
    
    function addActiveMenuStates(dashItem) {
        // add the new active states in 
        dashItem.addClass('dash-item--menu-active');
        // button to activate the menu
        $('.dash-item__menu-action', dashItem).attr('aria-expanded', true);
        // menu
        $('.dash-item__nav', dashItem).attr('aria-hidden', false);
    }
    
    function removeActiveMenuStates(dashItem) {
        // dash item card
        dashItem.removeClass('dash-item--menu-active');
        // button to activate the menu
        $('.dash-item__menu-action', dashItem).attr('aria-expanded', false)
        // menu
        $('.dash-item__nav', dashItem).attr('aria-hidden', true);
    }
    
});
Host Instantly Drag and Drop Website Builder

 

Description

A card pattern for a user dashboard using flexbox for grid layout. Keyboard accessible, a11y friendly, and built using Progressive Enhancement.
Term
Mon, 11/27/2017 - 21:54

Related Codes

Pen ID
Pen ID
Pen ID