Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <script src="https://cdn.rawgit.com/SSENSE/vue-carousel/6823411d/dist/vue-carousel.min.js"></script>
<div id="app">
  <link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
  <div class="wrapper">
    <div class="screen">

      <div class="heading"><img class="status" src="https://i.postimg.cc/SsknXZ8r/bar.png" alt=""><p>Card Details</p></div>
      
      <div class="add">
      </div>
      <carousel class="cards" :per-page=1>
        <slide v-for="card in cards" @click.native="selected(card.number)">
          <div class="card-bg">
                      <div class="card" :style="{ background: banks[card.bank].color }" >
            <div class="card__wrapper">
            <div class="card__provider"><img :src="banks[card.bank].logo" alt=""></div>
            <div class="card__number mb">{{ card['card number']}}</div>
            <div class="card__exp mb">{{ card['expiry date'] }}</div>
            <div class="card__name mb">{{ card['name on card']}}</div>       
          </div>
          </div>
          </div>

          <div class="details">
            <div class="details__row" v-for="(value, key) in card"><p class="key">{{ key }}:</p><p class="value">{{ value }}</p></div>
      </div>
        </slide>
        
      </carousel>
      
      <div class="pay-now"><span>Select Card</span></div>
    </div>
  </div>
</div>
            
          
!

CSS

            
              $gradient: linear-gradient(to right, #DD2476, #FF512F); 


body {
background: #ECE9E6;  /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #FFFFFF, #ECE9E6);  /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #FFFFFF, #ECE9E6); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
margin: 0;
}

.wrapper {
  height: 100vh;
  font-family: PT Sans;
  display: flex;
}

.mb {
  margin-bottom: 10px;
}

.screen {
  width: 395px;
  background: white;
  height: 90vh;
  overflow: scroll;
  margin: auto;
  box-shadow: 0px 5px 8px 2px #888888;
}

.heading {
  text-align: center;
  background: $gradient;

  padding-bottom: 10px;
  color: white;
  font-size: 1.2em;

  p {
    margin: 0;
    padding-top: 15px;
  }
}

.cards {
  position: relative;
  //
}
.card {
  height: 190px;
  background: #f4eded;
  max-width: 300px;
  border-radius: 15px;
  margin: auto;
  display: grid;
  box-shadow: 0px 4px 8px 4px #888888;

  &__wrapper {
    padding: 10px 20px;
    color: #f4eded;
    text-shadow: -1px -1px 1px rgba(192, 192, 192, 0.6), 1px 1px 1px #000;
  }

  &__provider {
    text-align: right;

    img {
      max-width: 50%;
    }
  }

  &__number {
    text-align: center;
    margin-top: 30px;
    font-size: 1.3em;
  }
}

.card-bg {
  background: #f2efef;
  padding-top: 30px;
  padding-bottom: 30px;
}
.details {
  // width: 80%;
  margin: auto;
  margin-top: 20px;

  &__row {
    display: grid;
    grid-template-columns: 40% 60%;
    padding: 0 10%;
    text-transform: capitalize;
    border-bottom: 1px solid #d6d4d4;

    p {
      margin: 0.3em;
    }

    .key {
      color: #878484;
    }
    .value {
      font-weight: bold;

      text-align: right;
    }
  }
}

.pay-now {
  width: 80%;
  background: $gradient;

  padding: 15px;
  border-radius: 25px;
  margin: auto;
  text-align: center;
  color: white;
  margin-bottom: 30px;
  cursor: pointer;
}

li {
  margin-top: 10px !important;
  margin-bottom: 10px;
}

.status {
  max-width: 100%;
}

            
          
!

JS

            
              
new Vue({
  el: "#app",

  components: {
    carousel: VueCarousel.Carousel,
    slide: VueCarousel.Slide
  },

  data() {
    return {
      banks: {
        TSB: {
          color: "#36BCEF",
          logo:
            "https://upload.wikimedia.org/wikipedia/en/thumb/b/b9/TSB_logo_2013.svg/1024px-TSB_logo_2013.svg.png"
        },
        Natwest: {
          color: "#441B43",
          logo:
            "https://i.postimg.cc/6QvzpP0m/nagwest.png"
        },
        Barclays: {
          color: "#0289C4",
          logo: "http://weshapeideas.com/assets/img/clients/barclaycard.png"
        },
        Monzo: {
          color: "#FE4D55",
          logo:
            "https://www.moneyexpert.com/wp-content/uploads/2019/03/monzo-logo.png"
        }
      },

      cards: [
        {
          bank: `Natwest`,
          'card number': `1166 4567 2345 3456`,
          'expiry date': `08/22`,
          'name on card': `Harriet J McMahon`,
          type: `MasterCard`,
          CVC: '878',
        },
        {
          bank: `Monzo`,
          'card number': `1166 2315 2345 1234`,
          'expiry date': `12/21`,
          'name on card': `Carol T Card`,
          type: `MasterCard`,
          CVC: '123',
        },
        {
          bank: `TSB`,
          'card number': `1166 8735 0935 7392`,
          'expiry date': `06/24`,
          'name on card': `Bertie J Bank`,
          type: `Visa`,
          CVC: '654',
        }
      ],

      cardStyle: this.cardStyling
    };
  },

  methods: {
    selected(card) {
      console.log(card);
    }
  }
});

            
          
!
999px

Console