forked from vgaNAR6ta/drags-and-nerds
edit: ajout d'une série de fenêtre flottantes déplaçable avec sytème de focus + transformation msgVisualizer en composant séparé et réglages associés
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<script setup>
|
||||
import CloseIcon from '../assets/icons/close.svg'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="instaPannel" class="windowStyle" ref="instaPannel" @mousedown="$emit('focus')" @touchstart="$emit('focus')">
|
||||
<Moveable
|
||||
className="moveable"
|
||||
:target="target"
|
||||
:draggable="true"
|
||||
@drag="onDrag"
|
||||
/>
|
||||
<div class="windowTitle">
|
||||
<p>
|
||||
ATTENTION!
|
||||
</p>
|
||||
<!-- touchstart.capture pour passer en prio sur déplacement fenêtre/ .stop si pas de method-->
|
||||
<button type="button" class="closeBtn" @mousedown.capture="$emit('close')" @touchstart.capture="$emit('close')">
|
||||
<CloseIcon name="close" class="icon"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="windowContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/*================= Mise en page:
|
||||
=> Mobile First : par défaut, moins de 500px
|
||||
=> Tablette et PC format haut : de 500 à 1000px
|
||||
=> PC large : à partir de 1000px
|
||||
*/
|
||||
|
||||
/*+++++++++++++++++ COPYBOX
|
||||
================ PC HAUT/IPAD
|
||||
@media(min-width:650px){}
|
||||
================ PC LARGE
|
||||
@media(min-width:1300px){}
|
||||
*/
|
||||
|
||||
#instaPannel{
|
||||
position: fixed;
|
||||
width: 333px;
|
||||
height: 161px;
|
||||
top: 333px;
|
||||
left: 33px;
|
||||
}
|
||||
/*================ PC LARGE*/
|
||||
@media(min-width:1300px){
|
||||
#instaPannel{
|
||||
height: 250px;
|
||||
width: 444px;
|
||||
left:333px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import Moveable from 'vue3-moveable';
|
||||
|
||||
export default {
|
||||
name : 'InstaPannel',
|
||||
components:{
|
||||
Moveable
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
target: null
|
||||
}
|
||||
},
|
||||
emits: ['close','focus'],
|
||||
methods:{
|
||||
onDrag({ target, transform }) {
|
||||
target.style.transform = transform;
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.target = this.$refs.instaPannel;
|
||||
console.log("Insta pannel is loaded!");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user