Skip to content

Commit

Permalink
refactor: general repo clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
airscripts committed Jan 21, 2023
1 parent 1bcb347 commit 421989c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import FloatingElement from './components/FloatingElement.vue'
export default {
name: 'App',
components: {
FloatingElement
}
Expand Down
17 changes: 8 additions & 9 deletions src/components/FloatingElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default {
methods: {
dragMouseDown: function (event) {
event.preventDefault();
this.coordinates.x = event.clientX;
this.coordinates.y = event.clientY;
document.onmousemove = this.elementDrag;
Expand All @@ -35,7 +34,6 @@ export default {
elementDrag: function (event) {
event.preventDefault();
let element = this.$refs.element;
this.coordinates.offsetX = this.coordinates.x - event.clientX;
Expand All @@ -45,31 +43,32 @@ export default {
this.$refs.element.style.top =
element.offsetTop - this.coordinates.offsetY + "px";
this.$refs.element.style.left =
element.offsetLeft - this.coordinates.offsetX + "px";
},
closeDragElement: function () {
document.onmousemove = null;
document.onmouseup = null;
document.onmousemove = null;
},
},
};
</script>

<style>
.element {
position: fixed;
z-index: 9998;
bottom: 25px;
right: 25px;
bottom: 25px;
z-index: 9998;
position: fixed;
}
#element-subelement.element__subelement {
z-index: 9999;
color: white;
background: #1ed392;
width: 60px;
color: white;
height: 60px;
z-index: 9999;
background: #1ed392;
}
</style>
5 changes: 1 addition & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
render: h => h(App),
}).$mount('#app')
new Vue({ render: h => h(App) }).$mount('#app')

0 comments on commit 421989c

Please sign in to comment.