Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Amex CVV on front of card #35

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,13 @@ body {
box-shadow: 0px 17px 20px -6px rgba(36, 52, 70, 0.36);
}
}
}

.card-item-cvv-amex {
color: #fff;
margin-top: -6%;
font-size: 27px;
font-weight: 500;
position: absolute;
left: 78%;
}
8 changes: 7 additions & 1 deletion src/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
</transition>
</div>
</div>
<!-- CVV on front of card for Amex -->
<div v-if="cardType === 'amex'">
<div class="card-item-cvv-amex">
<span v-for="(n, $index) in labels.cardCvv" :key="$index">*</span>
</div>
</div>
<label :for="fields.cardNumber" class="card-item__number" :ref="fields.cardNumber">
<template>
<span v-for="(n, $index) in currentPlaceholder" :key="$index">
Expand Down Expand Up @@ -164,7 +170,7 @@ export default {
} else {
this.currentFocus = element.id
}
this.isCardFlipped = element.id === this.fields.cardCvv
if (this.cardType !== 'amex') this.isCardFlipped = element.id === this.fields.cardCvv
})
element.addEventListener('blur', () => {
this.isCardFlipped = !element.id === this.fields.cardCvv
Expand Down