diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/DollarEffect.vue | 62 | ||||
| -rw-r--r-- | src/components/HelloWorld.vue | 57 |
2 files changed, 62 insertions, 57 deletions
diff --git a/src/components/DollarEffect.vue b/src/components/DollarEffect.vue new file mode 100644 index 0000000..a7c35b2 --- /dev/null +++ b/src/components/DollarEffect.vue @@ -0,0 +1,62 @@ +<template> + <img v-show='activated' src="../assets/bill.png" class="bill" ref="bill"> +</template> + +<script> +export default { + data() { + return { + x: 0, + y: 0, + startx: 0, + starty: 0, + targetx: 100, + targety: 100, + activated: false + } + }, + methods: { + reset(x,y) { + if(this.activated){ + return 'activated' + } + this.x = parseInt(x) + this.y = parseInt(y) + this.startx = x + 'px' + this.starty = y + 'px' + this.targetx = (this.x + Math.floor(Math.random() * 100) - 50) + 'px' + this.targety = (this.y + Math.floor(Math.random() * 100) - 50) + 'px' + this.activated = true + this.timeout = setTimeout(() => { + this.activated = false + }, (1.2 * 1000)) + //this.$refs.bill.style.animation = 'none' + //this.$refs.bill.offsetHeight /* trigger reflow */ + //this.$refs.bill.style.animation = null + }, + } +} +</script> + +<style scoped> +img { + user-select: none; + -webkit-user-select: none; + -khtml-user-select: none; + -webkit-touch-callout: none; + -moz-user-select: none; + -o-user-select: none; + width: 100px; + height: 100px; + animation-name: bill; + animation-duration: 1.3s; + animation-iteration-count: infinite; + position: absolute + +} +@keyframes bill { + 0% {opacity: 0; left: v-bind('startx'); top: v-bind('starty');} + 1% {opacity: 1; left: v-bind('startx'); top: v-bind('starty');} + 100% {opacity: 0; left: v-bind('targetx'); top: v-bind('targety');} +} +</style> diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 7fd2dc5..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,57 +0,0 @@ -<template> - <div class="hello"> - <h1>{{ msg }}</h1> - <p> - For a guide and recipes on how to configure / customize this project,<br> - check out the - <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>. - </p> - <h3>Installed CLI Plugins</h3> - <ul> - <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li> - </ul> - <h3>Essential Links</h3> - <ul> - <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li> - <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li> - <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li> - <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li> - <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li> - </ul> - <h3>Ecosystem</h3> - <ul> - <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li> - <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li> - <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li> - <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li> - <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li> - </ul> - </div> -</template> - -<script> -export default { - name: 'HelloWorld', - props: { - msg: String - } -} -</script> - -<!-- Add "scoped" attribute to limit CSS to this component only --> -<style scoped> -h3 { - margin: 40px 0 0; -} -ul { - list-style-type: none; - padding: 0; -} -li { - display: inline-block; - margin: 0 10px; -} -a { - color: #42b983; -} -</style> |
