cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
                <div class="fi-popover-container">    
    <button class="fi-button form" onclick="showPopover()"><span>Make Appointment</span></button>
    <div class="fi-popover inactive">
      <!-- Page 1 -->
      <div class="fi-page page-1 active">
        <header class="fi-header">
          <button class="fi-button previous"></button>
          <div class="fi-month">November</div>
          <button class="fi-button next"></button>
        </header>
        <div class="fi-week">
          <div class="fi-weekday active">
            <div class="fi-date">5</div>
            <div class="fi-day">Mon</div>
          </div>
          <div class="fi-weekday">
            <div class="fi-date">6</div>
            <div class="fi-day">Tues</div>
          </div>
          <div class="fi-weekday">
            <div class="fi-date">7</div>
            <div class="fi-day">Wed</div>
          </div>
          <div class="fi-weekday">
            <div class="fi-date">8</div>
            <div class="fi-day">Thurs</div>
          </div>
          <div class="fi-weekday">
            <div class="fi-date">9</div>
            <div class="fi-day">Fri</div>
          </div>
        </div>
        <div class="fi-content">
          <button class="fi-button circle" onclick="changeHour(-1)"><i class="fa fa-angle-left"></i></button>
          <div class="fi-time">
            <div class="fi-hour">
              <div class="fi-hour-current">10</div>
              <div class="fi-hour-past"></div>
            </div>
            <div class="fi-minute">:30</div>
          </div>
          <button class="fi-button circle" onclick="changeHour(1)"><i class="fa fa-angle-right"></i></button>
        </div>
        <footer class="fi-footer">
          <button class="fi-button" onclick="nextPage()">
            <div>Next Step</div>
          </button>
        </footer>
      </div>

      <!-- Page 2 -->
      <div class="fi-page page-2 inactive">
        <header class="fi-header">
          <h3>Great, your appointment with Goat is scheduled.</h3>
        </header>
        <div class="fi-content backdrop">
          <div class="fi-date">
            <strong>November, Friday 15th</strong>
          </div>
          <div class="fi-confirmation">          
            <div class="fi-time">
              <div class="fi-hour">
                <div class="fi-hour-current">09</div>
              </div>
              <div class="fi-minute">:30</div>
            </div>
          </div>
        </div>
        <footer class="fi-footer">
          <button class="fi-button content">
            <div>Goat Mealcookies</div>
            <div class="subtext">Veterinarian</div>
          </button>
        </footer>
      </div>

      <!-- Page 3 -->
      <div class="fi-page page-3 inactive">
        <header class="fi-header">
          <h3>Share your records with Goat?</h3>
        </header>
        <div class="fi-content">            
          <ul class="fi-records">
            <li class="fi-record">
              <input type="checkbox" name="record" id="medical_history">
              <label for="medical_history">
                <i class="fa fa-clipboard"></i>
                <div>Medical History</div>
              </label>
            </li>
            <li class="fi-record">
              <input type="checkbox" name="record" id="shot_records">
              <label for="shot_records">
                <i class="fa fa-medkit"></i>
                <div>Shot Records</div>
              </label>
            </li>
            <li class="fi-record">
              <input type="checkbox" name="record" id="surgery_records">
              <label for="surgery_records">
                <i class="fa fa-user-md"></i>
                <div>Surgery Records</div>
              </label>
            </li>
            <li class="fi-record">
              <input type="checkbox" name="record" id="x_rays">
              <label for="x_rays">
                <i class="fa fa-user-times"></i>
                <div>X-Rays</div>
              </label>
            </li>
            <li class="fi-record">
              <input type="checkbox" name="record" id="medications">
              <label for="medications">
                <i class="fa fa-flask"></i>
                <div>Medications</div>
              </label>
            </li>
            <li class="fi-record">
              <input type="checkbox" name="record" id="allergies">
              <label for="allergies">
                <i class="fa fa-leaf"></i>
                <div>Allergies</div>
              </label>
            </li>
          </ul>
        </div>
        <footer class="fi-footer">
          <button class="fi-button" onclick="nextPage()">
            <div>Next Step</div>
          </button>
        </footer>
      </div>

      <!-- Page 4 -->
      <div class="fi-page page-4 inactive">
        <header class="fi-header">
          <h3>Share your records with Goat?</h3>
        </header>
        <div class="fi-content backdrop">            
          <div class="fi-date">
            <strong>November, Friday 15th</strong>
          </div>
          <div class="fi-transfer">
            <div class="fi-avatar">
              <img src="https://i.imgur.com/xg1mXL7.jpg" alt="">
            </div>
            <div class="fi-loading">
              <div class="fi-loading-dot"></div>
              <div class="fi-loading-dot"></div>
              <div class="fi-loading-dot"></div>
              <div class="fi-loading-dot"></div>
            </div>
            <div class="fi-avatar">
              <img src="https://i.imgur.com/7RDEUTW.png" alt="">
            </div>
          </div>
        </div>
        <footer class="fi-footer">
          <button class="fi-button content">
            <div>Please wait a few seconds while we <br>transfer your records to Goat.</div>
          </button>
        </footer>
      </div>

      <!-- Page 5 -->
      <div class="fi-page page-5 inactive">
        <header class="fi-header">
          <h1>You're all set.</h1>
        </header>
        <div class="fi-content">
          <div class="fi-info">
            Add your appointment to your calendar.
          </div>
          <div class="fi-iphone">
            <div class="fi-iphone-screen">
              <div class="fi-iphone-notification">
                <i class="fa fa-heartbeat"></i>
                <div>
                  <h3>Goat Health <span class="subtext">now</span></h3>
                  <div>Your appointment with Goat</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="fi-footer" onclick="closePopover()">
          <button class="fi-button">
            <div>Add to Calendar</div>
          </button>
          <button class="fi-button">
            <div>Not Now</div>
          </button>
        </div>
      </div>
    </div>
  </div>
  <div class="meta">
    <h1>F-I Motion Design Realization</h1>
    <p>
      Built by David Khourshid - <a href="https://twitter.com/davidkpiano" target="_blank">@davidkpiano</a>
    </p>
    <p>
      Based on <a href="http://casestudies.f-i.com/healthcare/" target="_blank">Fantasy Interactive's Digital Healthcare Case Study</a>
    </p>
    <p>
      Click the buttons to see the effect. <br>
      JavaScript used solely to trigger animations. <br>
      Works best in Chrome. Works decently in Firefox. Uses Flexbox.
    </p>
  </div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Lato:300,400,700);

$color-bg: #FEFEFE;
$color-primary: #4BA9D7;
$color-primary-lighter: #75C4EC;
$color-primary-tint: #227FBB;
$color-primary-dark: #2F3C43;
$color-gray: #ccc;
$color-gray-dark: #b9b9b9;
$color-gray-light: #F4F4F4;

$form-border-radius: 0.5rem;

$popover-width: 30rem;


// Animation settings
$animation-slow: 0.6s;
$animation-fast: 0.25s;
$animation-easing: cubic-bezier(0.86, 0, 0.07, 1);

// Page setup
.fi-page.active {
    z-index: 2;
    display: flex;
}

%animate-fast {
    animation-duration: $animation-fast;
    animation-easing-function: $animation-easing;
    animation-fill-mode: both;
}

%animate-slow {
    animation-duration: $animation-slow;
    animation-easing-function: $animation-easing;
    animation-fill-mode: both;
}

%transition {
    transition-property: all;
    transition-duration: $animation-fast;
}

.fi-button, .fi-record > label, .fi-weekday {
    &, &:before, &:after {
        @extend %transition;
    }
}



// Animation 1
.fi-popover {
    transform-origin: top center;
    
    &.active {
        display: block;
        @extend %animate-slow;
        animation-name: popover-active;
    }
}

@keyframes popover-active {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

// Animation 2
.page-1 {
    .fi-hour {
        &.earlier {    
            .fi-hour-current {
                @extend %animate-fast;
                animation-name: hour-earlier-active;
            }
            .fi-hour-past {
                @extend %animate-fast;
                animation-name: hour-earlier-inactive; 
            }
        }

        &.later {    
            .fi-hour-current {
                @extend %animate-fast;
                animation-name: hour-later-active; 
            }
            .fi-hour-past {
                @extend %animate-fast;
                animation-name: hour-later-inactive; 
            }
        }
    }
}

@keyframes hour-earlier-active {
    from {
        transform: translateY(-50%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes hour-earlier-inactive {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(50%);
        opacity: 0;
    }
}

@keyframes hour-later-active {
    from {
        transform: translateY(50%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes hour-later-inactive {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-50%);
        opacity: 0;
    }
}

// Animation 3
.fi-page.active {
    .fi-header > * {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
    }

    .fi-content.backdrop {
        &:before {
            @extend %animate-slow;
            animation-name: slideUpDown-active;
        }
    }
}

.fi-page.inactive {
    .fi-header > * {
        @extend %animate-fast;
        animation-name: fade-inactive;
    }

    .fi-footer > .fi-button > * {
        @extend %animate-fast;
        animation-name: shiftUpDown-inactive;
    }

    .fi-content.backdrop {
        &:before {
            @extend %animate-fast;
            animation-name: slideUpDown-inactive;
        }
    }
}

// Animation 4
.page-1.inactive {
    .fi-week {
        @extend %animate-fast;
        animation-name: fade-inactive;
    }

    .fi-content {
        @extend %animate-fast;
        animation-name: fade-inactive;
        animation-delay: $animation-slow;
    }
}

.page-2.active {
    .fi-footer > .fi-button > * {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
        animation-delay: $animation-fast;
    }

    .fi-content {

        .fi-time {
            @extend %animate-slow;
            animation-name: fade-active;
        }
    }
}

.page-3.active {
    .fi-footer > .fi-button > * {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
        animation-delay: $animation-fast;
    }

    .fi-content:before {
        @extend %animate-fast;
        animation-name: slideUp-inactive;
    }

    .fi-records {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
    }
}

.page-3.inactive {
    .fi-records {
        @extend %animate-fast;
        animation-name: fade-inactive;
    }
}

.page-4.active {
    .fi-footer > .fi-button > * {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
        animation-delay: $animation-fast;
    }

    .fi-content > * {
        @extend %animate-slow;
        animation-name: fade-active;
    }

    .fi-loading-dot {
        animation-duration: 1s;
        animation-name: pulse;
        animation-iteration-count: infinite;
    }

    @for $dot-index from 1 through 4 {
        .fi-loading-dot:nth-child(#{$dot-index}) {
            animation-delay: $dot-index * 0.25s;
        }
    }
}

.page-4.inactive {
    .fi-content > * {
        @extend %animate-fast;
        animation-name: fade-inactive;
    }
}

.page-5.active {
    .fi-info {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
    }

    .fi-iphone {
        @extend %animate-slow;
        animation-name: slideUpDown-active;
        animation-delay: $animation-slow;
    }

    .fi-iphone-notification {
        @extend %animate-slow;
        animation-name: slideDownUp-active;
        animation-delay: $animation-slow * 2;
    }

    .fi-footer > .fi-button {
        @extend %animate-slow;
        animation-name: shiftUpDown-active;
    }
}

.page-5.inactive {
    display: none;
}

@keyframes fade-active {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fade-inactive {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes shiftUpDown-active {
    from {
        transform: translateY(25%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shiftUpDown-inactive {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(25%);
        opacity: 0;
    }
}

@keyframes slideUpDown-active {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideUpDown-inactive {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

@keyframes slideDownUp-active {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDownUp-inactive {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

@keyframes pulse {
    0%, 50% {
        background-color: $color-primary-tint;
    }
    25% {
        background-color: white;
    }
}

%button {
    display: block;
    text-align: center;
    -webkit-appearance: none;
    background: none;
    border: none;
    font-size: 1rem;

    &, &:focus { outline: none; }

    &-form {
        $button-form-width: 15rem;
        background: linear-gradient(to bottom, #{$color-primary}, #459FCB);
        text-transform: uppercase;
        font-weight: bold;
        color: white;
        padding: 1rem 0;
        text-align: center;
        margin: 0 auto;
        overflow: hidden;
        width: $button-form-width;
        box-shadow: 0 1px 2px rgba(black, 0.4);
        font-size: 85%;

        &:before {
            $button-ink-width: $button-form-width + 2rem;

            content: '';
            position: absolute;
            width: $button-ink-width;
            height: $button-ink-width;
            border-radius: 50%;
            background-color: $color-primary-dark;
            z-index: 0;
            top: calc(100% - #{$button-ink-width / 2});
            left: calc(50% - #{$button-ink-width / 2});
            transform: scale(0);
        }

        &.active:before {
            transform: scale(1);
        }
    }

    &-circle {
        width: 2rem;
        height: 2rem;
        border: 1px solid $color-gray;
        border-radius: 50%;
        color: $color-gray;
        font-size: 1.5rem;

        > %icon {
            vertical-align: top;
        }

        .fi-page.active &:hover {
            background-color: $color-gray;
            color: white;
        }
    }

    &-footer {
        color: white;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex-grow: 1;
        background-color: transparent;

        &:not(.content):hover {
            background-color: rgba(white, 0.4);
        }
      
        .fi-page.inactive &:hover {
          background-color: transparent;
        }
      
        &.content {
          cursor: default;
        }
    }

    + %button {
        border-left: 1px solid $color-primary-lighter;
    }
}

%arrow {
    $arrow-width: 1rem;
    content: '';
    width: 0;
    height: 0;
    position: absolute;

    &-bottom {
        top: 100%;
        left: calc(50% - #{$arrow-width});
        border-left: 1rem solid transparent;
        border-right: 1rem solid transparent;
        border-top: 1rem solid $color-primary-dark;
    }

    &-top {
        bottom: 100%;
        left: calc(50% - #{$arrow-width});
        border-left: 1rem solid transparent;
        border-right: 1rem solid transparent;
        border-bottom: 1rem solid #fcfcfc;
    }
}

.fa {
    @extend %icon;
}

.fi-button {
    @extend %button;

    &.form {
        @extend %button-form;
    }

    &.circle {
        @extend %button-circle;
    }

    .fi-footer > & {
        @extend %button-footer;
    }
}

.fi-popover-container {
    margin: 0 auto;
    width: $popover-width;
    max-width: 100%;
    padding: 0 1rem;

    &, *, *:before, *:after {
        display: block;
        position: relative;
        box-sizing: border-box;
    }
}

.fi-popover {
    position: absolute;
    display: block;
    background: #fff;
    width: $popover-width;
    max-width: calc(100% - 2rem);
    height: 450px;
    box-shadow: 0 0 1rem rgba(black,0.2);
    margin: 0.5rem auto;

    &, & > .fi-page {
        border-radius: $form-border-radius;
    }

    &:after {
        content: '';
        position: absolute;
        display: block;
        width: 1.414rem;
        height: 1.414rem;
        left: calc(50% - #{1.414rem / 2});
        bottom: calc(100% - #{1.414rem / 2});
        box-shadow: 0 0 3px rgba(black,0.4);
        transform: rotate(45deg);
        z-index: 0;
        background-color: white;
    }
}

.fi-header {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: $form-border-radius;
    border-top-right-radius: $form-border-radius;
    overflow: hidden;
    background-color: white;
    z-index: 2;
    text-align: center;
}

.fi-footer {
    border-bottom-left-radius: $form-border-radius;
    border-bottom-right-radius: $form-border-radius;
    overflow: hidden;
    z-index: 2;

    .page-1 > & { background-color: $color-primary; }
}

.fi-week {
    display: flex;
    flex-direction: row;
    border-top: 1px solid $color-gray;
    border-bottom: 1px solid $color-gray;
}

.fi-weekday {
    & + & {
        border-left: 1px solid $color-gray;
    }

    &.active:after {
        @extend %arrow;
        @extend %arrow-bottom;
    }
}

.fi-time {
    flex-grow: 1;
    display: flex;
    flex-direction: row;

    > .fi-hour, > .fi-minute {
        flex-grow: 1;
        font-size: 800%;
      
        @media (max-width: $popover-width) {
          font-size: 500%;
        }
    }

    > .fi-hour {
        font-weight: bold;
        text-align: right;

        > .fi-hour-past {
            position: absolute;
            top: 0;
            right: 0;
        }
    }
}

.fi-records {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    z-index: 0;
    border: 1px solid $color-gray;
    border-radius: $form-border-radius;
    overflow: hidden;
}

.fi-record {
    flex-basis: percentage(1/3);
    display: flex;
    flex-direction: column;
    justify-content: center;

    &:nth-child(3n+2) {
        &, & + .fi-record {
            border-left: 1px solid $color-gray;
        }
    }

    &:nth-child(n+4) {
        border-top: 1px solid $color-gray;
    }

    > label {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        overflow: hidden;
        color: $color-gray-dark;
        text-align: center;
        padding: 0.5rem;

        > .fa {
            font-size: 300%;
        }

        &:after {
            content: '';
            position: absolute;
            width: 1.25rem;
            height: 1.25rem;
            display: block;
            top: 0.5rem;
            right: 0.5rem;
            background-color: #f6f6f8;
            color: #96C253;
            border-radius: 50%;
            box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
            line-height: 1.25rem;
            text-align: center;
        }

        &:before {
            $record-ink-width: 150%;

            transform-origin: bottom right;
            content: '';
            position: absolute;
            width: $record-ink-width;
            height: $record-ink-width;
            border-radius: 50%;
            background-color: $color-primary-dark;
            z-index: 0;
            bottom: -25%;
            right: -25%;
            transform: scale(0);
        }

        &:hover {
            background-color: $color-gray-light;
        }
    }

    input[type="checkbox"] {
        position: absolute;
        opacity: 0;

        &:checked + label {
            color: white; 

            &:after { content: '\2713'; }
            &:before { transform: scale(1); }
        }
    }
}

.fi-content {
    display: flex;
    overflow: hidden;

    &:before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: $color-primary;
        display: block;
        top: 0;
        left: 0;
        transform: translateY(100%);
    }
}

.fi-transfer {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.fi-avatar {
    height: 120px;
    width: 120px;
    border: 0.25rem solid white;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 2px rgba(black, 0.4);

    > img {
        width: 100%;
        height: 100%;
    }
}

.fi-loading {
    width: 5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.fi-loading-dot {
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 50%;
    background-color: $color-primary-tint;
}

.fi-info {
    color: gray;
}

.fi-iphone {
    height: 250px;
    width: 350px;
    background-color: white;
    border: 0.5rem solid #e5e5e5;
    border-top-left-radius: 4rem;
    border-top-right-radius: 4rem;
    border-bottom-width: 0;
  
    @media (max-width: $popover-width) {
      width: 300px;
    }

    &:before, &:after {
        content: '';
        position: absolute;
        display: block;
        background-color: #e5e5e5;
    }

    &:before {
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
        top: 1.75rem;
        left: calc(50% - 2.5rem - 3rem);
    }

    &:after {
        width: 5rem;
        height: 0.5rem;
        left: calc(50% - 2.5rem);
        top: 2rem;
        border-radius: 1rem;
    }
}

.fi-iphone-screen {
    position: absolute;
    bottom: 0;
    width: 90%;
    height: 65%;
    left: 5%;
    background: $color-primary-lighter;
    overflow: hidden;
}

.fi-iphone-notification {
    background-color: #0B1429;
    color: white;
    padding: 1rem;

    .subtext {
        opacity: 0.4;
    }

    %icon {
        margin-right: 1rem;
        color: white;
        background-color: red;
        padding: 0.25rem;
        border-radius: 3px;
    }

    %icon, %icon + div {
        float: left;
        max-width: calc(100% - 3rem);
    }

    h3 {
        margin: 0;

        > .subtext {
            display: inline-block;
            text-transform: none;
        }
    }

    &:before, &:after { content: ' '; display: table; }
    &:after { clear: both; }
}

.subtext {
    color: $color-primary-lighter;
    text-transform: uppercase;
    font-size: 85%;
    font-weight: bold;
}

.fi-page {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;

    > .fi-footer {
        display: flex;
        flex-direction: row;
        height: 4rem;
    }

    > .fi-content {
        flex-grow: 1;
    }

    &.page-1 {
        background: white;

        > .fi-header {
            flex-direction: row;
            text-transform: uppercase;
            font-weight: bold;

            > .fi-button {
                width: 2rem;
            }

            > .fi-month {
                flex-grow: 1;
                text-align: center;
                padding: 0.5rem;
            }
        }

        .fi-weekday {
            flex: 1;
            text-align: center;
            padding: 1rem 0;

            &:hover {
                background-color: rgba($color-primary-dark, 0.2);
            }

            &.active {
                background-color: $color-primary-dark;
                color: white;
            }
        }

        .fi-date {
            font-size: 200%;
        }

        .fi-day {
            font-size: 85%;
            text-transform: uppercase;
            font-weight: bold;
        }

        .fi-content {
            flex-direction: row;
            align-items: center;
            padding: 1rem;
            flex-wrap: wrap;
            align-content: center;
          
            @media (max-width: $popover-width) {
              justify-content: center;
            }

            > .fi-button {
                width: 2rem;
            }
        }
    }

    &.page-2 {
        > .fi-header {
            height: 78px;
            align-items: center;
            justify-content: center;
        }

        > .fi-content {
            flex-direction: column;
            align-items: center;
            color: white;

            &:before {
                transform: translateY(0);
            }

            > .fi-date {
                height: 2rem;
                display: flex;
                flex-direction: column;
                justify-content: flex-end;
            }

            > .fi-confirmation {
                flex-grow: 1;
                display: flex;
                flex-direction: column;
                justify-content: center;
            }

            .fi-time {
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                flex-grow: 0;
            }
        }
    }

    &.page-3 {
        > .fi-content {
            padding: 1rem;

            &:before {
                z-index: 2;
            }
        }
    }

    &.page-4 {
        > .fi-content {
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            color: white;

            &:before {
                transform: translateY(0);
            }
        }
    }

    &.page-5 {
        > .fi-content {
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
        }

        > .fi-footer {
            > .fi-button {
                flex-basis: 50%;
            }
        }
    }
}

.inactive {
    z-index: -1;
}

// BASE STYLES
html, body {
  font-family: Lato, sans-serif;
  font-weight: 300;
  line-height: 1;
  background-color: $color-bg;
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
}

body {
  padding: 10% 1rem;
  background: #f9f9f9;
  max-height: 100%;
  overflow-y: auto;
  max-width: 100%;
}

html {
  max-height: 100%;
  overflow: hidden;
}

.meta {
    text-align: center;
    color: #b6b6b6;
    line-height: 1.4;

    a {
        @extend %transition;
        color: #b6b6b6;

        &:hover { color: $color-primary; }
    }
}
            
          
!
            
                var page = 1;
  var currentHour = 10;
  var previousHour = null;
  var minute = 30;
	var popoverVisible = false;

  function showPopover() {
    if (popoverVisible) {
      return null;
    }
    
    $('.fi-popover, .page-1')
      .removeClass('inactive')
      .addClass('active');

    $('.fi-button.form')
      .addClass('active');
    
    popoverVisible = true;
  }

  function closePopover() {
    $('.fi-popover')
      .removeClass('active')
      .addClass('inactive');

    $('.fi-button.form')
      .removeClass('active');

    $('.fi-page').removeClass('active').addClass('inactive');

    page = 1;
    
    popoverVisible = false;
  }

  function nextPage() {
    $('.page-' + page++).removeClass('active').addClass('inactive');
    $('.page-' + page).removeClass('inactive').addClass('active');

    if (!(page % 2)) {
      setTimeout(nextPage, 3000);
    }
  }

  function changeHour(amount) {
    pastHour = currentHour;
    currentHour = currentHour || 24;
    currentHour += amount;
    currentHour %= 24;

    $currentHour = $('<div/>')
      .addClass('fi-hour-current')
      .html((currentHour < 10 ? '0' : '') + currentHour);

    $pastHour = $('<div/>')
      .addClass('fi-hour-past')
      .html((pastHour < 10 ? '0' : '') + pastHour);

    $('.page-1 .fi-hour').html('')
      .append($currentHour)
      .append($pastHour)
      .removeClass('earlier later')
      .addClass(pastHour < currentHour ? 'later' : 'earlier');

    $('.page-2 .fi-hour-current').html((currentHour < 10 ? '0' : '') + currentHour);
  }

  changeHour(0);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console