Common input field and button moved to a component that can be reused
This commit is contained in:
@@ -22,78 +22,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
// Custom external context styling
|
||||
@import "./src/scss/variables";
|
||||
.movie__actions-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
color: rgba($c-dark, 0.5);
|
||||
transition: color 0.5s ease;
|
||||
font-size: 11px;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid rgba($c-dark, 0.05);
|
||||
&:hover{
|
||||
color: rgba($c-dark, 0.75);
|
||||
}
|
||||
&.active{
|
||||
color: $c-dark;
|
||||
}
|
||||
&.pending{
|
||||
color: #f8bd2d;
|
||||
}
|
||||
}
|
||||
.movie__actions-text {
|
||||
margin:4.4px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
// Loading placeholder styling
|
||||
@mixin nth-children($points...) {
|
||||
@each $point in $points {
|
||||
&:nth-child(#{$point}) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-input__loading {
|
||||
width: 100%;
|
||||
|
||||
&--line {
|
||||
height: 10px;
|
||||
margin: 10px;
|
||||
animation: pulse 1s infinite ease-in-out;
|
||||
}
|
||||
|
||||
div {
|
||||
@include nth-children(1, 5, 9) {
|
||||
width: 150px;
|
||||
}
|
||||
@include nth-children(2, 6, 10) {
|
||||
width: 250px;
|
||||
}
|
||||
@include nth-children(3, 7) {
|
||||
width: 120px;
|
||||
}
|
||||
@include nth-children(4, 8) {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
background-color: rgba(165, 165, 165, 0.1);
|
||||
}
|
||||
50% {
|
||||
background-color: rgba(165, 165, 165, 0.3);
|
||||
}
|
||||
100% {
|
||||
background-color: rgba(165, 165, 165, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@import "./src/scss/loading-placeholder";
|
||||
|
||||
</style>
|
||||
61
src/components/ui/SeasonedButton.vue
Normal file
61
src/components/ui/SeasonedButton.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="seasoned-button">
|
||||
<button type="button" class="button" @click="emit('click')" :class="{ active: active }"><slot></slot></button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'seasonedButton',
|
||||
props: {
|
||||
active: Boolean
|
||||
},
|
||||
methods: {
|
||||
emit() {
|
||||
console.log('emitted')
|
||||
this.$emit('click')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./src/scss/variables";
|
||||
@import "./src/scss/media-queries";
|
||||
|
||||
.button{
|
||||
display: inline-block;
|
||||
border: 1px solid $c-dark;
|
||||
text-transform: uppercase;
|
||||
background: $c-dark;
|
||||
font-weight: 300;
|
||||
font-size: 11px;
|
||||
line-height: 2;
|
||||
letter-spacing: 0.5px;
|
||||
padding: 5px 20px 4px 20px;
|
||||
cursor: pointer;
|
||||
color: $c-dark;
|
||||
background: transparent;
|
||||
outline: none;
|
||||
transition: background 0.5s ease, color 0.5s ease;
|
||||
|
||||
@include tablet-min{
|
||||
font-size: 12px;
|
||||
padding: 6px 20px 5px 20px;
|
||||
}
|
||||
&:active, &:hover{
|
||||
background: $c-dark;
|
||||
color: $c-white;
|
||||
}
|
||||
body:not(.touch) &:hover, &:focus{
|
||||
background: $c-dark;
|
||||
color: $c-white;
|
||||
}
|
||||
&.active {
|
||||
@extend .button;
|
||||
background: $c-dark;
|
||||
color: $c-white;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
103
src/components/ui/SeasonedInput.vue
Normal file
103
src/components/ui/SeasonedInput.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="group" :class="{ completed: value.length > 0 }">
|
||||
<svg class="group__input-icon"><use v-bind="{'xlink:href':'#icon' + icon}"></use></svg>
|
||||
<input class="group__input" :type="tempType || type" ref="plex_username"
|
||||
v-model="value" :placeholder="text" @input="handleInput" />
|
||||
|
||||
<i v-if="value.length > 0 && type === 'password'" @click="toggleShowPassword" class="group__input-show noselect">show</i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
text: { type: String },
|
||||
icon: { type: String },
|
||||
type: { type: String }
|
||||
},
|
||||
data() {
|
||||
return { value: '', tempType: undefined }
|
||||
},
|
||||
methods: {
|
||||
handleInput(value) {
|
||||
console.log('this.value', this.value)
|
||||
this.$emit('inputValue', this.value)
|
||||
},
|
||||
toggleShowPassword() {
|
||||
if (this.tempType === 'text') {
|
||||
this.tempType = 'password'
|
||||
} else {
|
||||
this.tempType = 'text'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./src/scss/variables";
|
||||
@import "./src/scss/media-queries";
|
||||
|
||||
.group{
|
||||
display: flex;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
&:hover, &:focus {
|
||||
.group__input {
|
||||
border-color: $c-dark;
|
||||
|
||||
&-icon {
|
||||
fill: $c-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.completed {
|
||||
.group__input {
|
||||
border-color: $c-dark;
|
||||
|
||||
&-icon {
|
||||
fill: $c-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 75%;
|
||||
max-width: 35rem;
|
||||
padding: 10px 10px 10px 45px;
|
||||
// padding: 15px 10px 15px 45px;
|
||||
outline: none;
|
||||
background-color: $c-white;
|
||||
color: $c-dark;
|
||||
font-weight: 100;
|
||||
font-size: 1.2rem;
|
||||
border: 1px solid rgba($c-dark, 0.5);
|
||||
margin-left: -2.2rem;
|
||||
// margin-bottom: 1rem;
|
||||
z-index: 3;
|
||||
transition: border-color .5s ease;
|
||||
|
||||
&-show {
|
||||
position: relative;
|
||||
left: -50px;
|
||||
z-index: 11;
|
||||
margin: auto 0;
|
||||
height: 100%;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
color: rgba($c-dark, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
&__input-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
fill: rgba($c-dark, 0.5);
|
||||
transition: fill 0.5s ease;
|
||||
pointer-events: none;
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
z-index: 8;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user