shipshapecode/ember-3d-folding-panel

View on GitHub
addon/components/item-square/styles.scss

Summary

Maintainability
Test Coverage
// antialiasing mode font rendering

@mixin font-smoothing {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

& {
  backface-visibility: hidden;
  height: 300px;
  text-align: center;

  /* Force Hardware Acceleration */
  transform: translateZ(0);

  a {
    @include font-smoothing;

    overflow: hidden;
  }

  &:hover {
    cursor: pointer;
  }

  b {
    border-radius: 50em;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;

    letter-spacing: 1px;
    padding: 1.3em 1.3em 1em;
    text-transform: uppercase;
  }

  h2 {
    font-size: 1.4rem;
  }

  p {
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.6;
    padding: 1em 0;
  }
}

&.is-huge {
  height: 520px;

  h2 {
    font-size: 1.9rem;
  }

  p {
    font-size: 1rem;
  }

  h2,
  p,
  .extra-content * {
    transform: translateY(30px);
    transition: transform 0.3s 0.1s;
  }

  b {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s 0s, transform 0.3s 0s;
  }

  &:hover {
    h2,
    p,
    .extra-content * {
      transform: translateY(0);
      transition: transform 0.3s 0s;
    }

    b {
      opacity: 1;
      transform: translateY(0);
      transition: opacity 0.3s 0.1s, transform 0.3s 0.1s;
    }
  }

  .fold-is-open & {
    transform: translateX(-400px);

    &:nth-of-type(2n) {
      transform: translateX(400px);
    }
  }
}