This commit is contained in:
uf0 2019-09-05 00:54:14 +02:00
parent 07afa7b356
commit 0508bfffc6
4 changed files with 21 additions and 3 deletions

View File

@ -12,7 +12,8 @@
"core-js": "^2.6.5",
"vue": "^2.6.10",
"vue-qrcode-reader": "^2.0.4",
"vue-router": "^3.0.3"
"vue-router": "^3.0.3",
"vue-scrollto": "^2.15.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.8.0",

View File

@ -13,7 +13,7 @@
<p v-if="isInvalid">non è un qrcode di ofo 😟</p>
<p v-if="errored">si è verificato un errore, riprova!</p>
<div v-if="loading" class="loading"></div>
<div class="decode-result">
<div class="decode-result" id="pin">
<div
class="decode-number"
v-for="letter in split(bikePin)"
@ -24,7 +24,7 @@
</div>
<p v-if="bikePin">
🔓inserisci il codice! ricordati che il codice è unico per ogni
bicicletta, riusalo 🤯
bicicletta, riusalo 😎
</p>
</div>
</template>
@ -32,6 +32,7 @@
<script>
import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from "vue-qrcode-reader";
import axios from "axios";
import VueScrollTo from "vue-scrollto";
export default {
name: "Unlock",
@ -88,6 +89,7 @@ export default {
//const pin = response.data //get pin from api response
const pin = "1234";
this.bikePin = pin;
VueScrollTo.scrollTo("#pin", 300);
})
.catch(error => {
this.errored = true;

3
vue.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/open-this-bike/" : "/"
};

View File

@ -1560,6 +1560,11 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"
bezier-easing@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/bezier-easing/-/bezier-easing-2.1.0.tgz#c04dfe8b926d6ecaca1813d69ff179b7c2025d86"
integrity sha1-wE3+i5JtbsrKGBPWn/F5t8ICXYY=
bfj@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/bfj/-/bfj-6.1.1.tgz#05a3b7784fbd72cfa3c22e56002ef99336516c48"
@ -7932,6 +7937,13 @@ vue-router@^3.0.3:
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.6.tgz#2e4f0f9cbb0b96d0205ab2690cfe588935136ac3"
integrity sha512-Ox0ciFLswtSGRTHYhGvx2L44sVbTPNS+uD2kRISuo8B39Y79rOo0Kw0hzupTmiVtftQYCZl87mwldhh2L9Aquw==
vue-scrollto@^2.15.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/vue-scrollto/-/vue-scrollto-2.15.0.tgz#e6e4645dfd2efc0d960123f607c2ab448b81670a"
integrity sha512-FmJncIrXvsqvyVAN55Trc2CQWVDyxuMgdQQp1Q9I9bhoEi7XXpvXXQonhbFBktzNggJf1rpfHpVqa8KLhPeePQ==
dependencies:
bezier-easing "2.1.0"
vue-style-loader@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"