Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | <template> <div class="w-100"> <div class="input-label position-relative"> <label v-if="inputSpecs['label']" :for="inputSpecs['name']"> {{ this.inputSpecs['name'] }} </label> <input ref="input" class="w-100 p-2" :type="inputSpecs['type']" :name="inputSpecs['name']" v-model="getValue" :placeholder="inputSpecs['placeholder']" required/> <div v-if="this.inputSpecs['type'] === 'password'" class="position-absolute bottom-0 end-0"> <svg v-if="!this.visible" @click="this.changePassVisibility" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="rgb(154, 117, 63)" class="bi bi-eye visibility-pass" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </svg> <svg v-if="this.visible" @click="this.changePassVisibility" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="rgb(154, 117, 63)" class="bi bi-eye-slash visibility-pass" viewBox="0 0 16 16"> <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/> <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/> <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/> </svg> </div> </div> <div v-if="inputSpecs['type'] === 'password' && inputSpecs['task'] === 'login'" class="text-end mt-2"> <nuxt-link class="forgot-pass" :to="`/forgot-password`">Ai uitat parola?</nuxt-link> </div> </div> </template> <script> export default { data() { return { visible: false } }, props: ['inputSpecs'], methods: { /** * Toggles visibility of password fields * @see changePassVisibility * @returns void */ changePassVisibility() { let input = this.$refs.input; this.visible = !this.visible; if (input.type === 'password') { input.type = 'text'; } else { input.type = 'password'; } } }, computed: { /** * Returns the getter for the form specified in the task prop * @see getter * @returns object */ getter() { return this.$store.getters[this.inputSpecs['task'] + "Fields"] }, getValue: { /** * Gets the value for the current input field * @see get * @returns string */ get() { return this.getter[this.inputSpecs['index']].value; }, /** * Sets the value for the current input field * @see set * @param {string} value * @returns void */ set(value) { this.$store.commit('changeInputFields', { value, index: this.inputSpecs['index'], task: this.inputSpecs['task'] }); } }, } } </script> <style lang="scss" scoped> input { border: none; outline: none; font-size: 1rem; border-bottom: 1px solid rgb(154, 117, 63); background-color: transparent; } .forgot-pass { color: rgb(154, 117, 63); font-size: 1rem; font-style: italic; } input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active { -webkit-box-shadow: 0 0 0 30px white inset !important; } .visibility-pass { cursor: pointer; } @include media-breakpoint-up(lg) { .forgot-pass:active, .forgot-pass:hover { color: rgb(154, 117, 63); opacity: 0.5; } } @include media-breakpoint-down(lg) { input { font-size: 1.2rem; } svg { width: 2rem; height: 2rem; } .forgot-pass { font-size: 1.2rem; } } @media screen and #{$ipad-pro-landscape-breakpoint}, screen and #{$ipad-pro-portrait-breakpoint}, screen and #{$ipad-landscape-breakpoint} { input { font-size: 1.4rem; } svg { width: 2rem; height: 2rem; } .forgot-pass { font-size: 1.4rem; } } @include media-breakpoint-down(sm) { input { font-size: 1rem; } svg { width: 1.5rem; height: 1.5rem; } .forgot-pass { font-size: 1rem; } } </style> |