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,157 @@
|
||||
<script setup>
|
||||
import CloseIcon from '../assets/icons/close.svg'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="windowStyle" id="msgVisualizer" ref="msgPannel" @mousedown="$emit('focus')" @touchstart="$emit('focus')">
|
||||
<Moveable
|
||||
className="moveable"
|
||||
:target="$refs.msgPannel"
|
||||
:draggable="true"
|
||||
@drag="onDrag"
|
||||
/>
|
||||
<div class="windowTitle">
|
||||
<p>
|
||||
<b class="windowTitleLower">Message du {{selectedMsg.date}}</b>
|
||||
<br>
|
||||
{{selectedMsg.title}}
|
||||
</p>
|
||||
<!-- touchstart.capture pour passer en prio sur déplacement fenêtre/ .stop si pas de method-->
|
||||
<button type="button" class="closeBtn" @mousedown.stop @touchstart.capture="closeMsg" @click="closeMsg">
|
||||
<CloseIcon name="close" class="icon"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="windowContent">
|
||||
<div class="msgReact">
|
||||
<p class="reactStatStyle">{{selectedMsg.like}}</p>
|
||||
<button type="button" class="iconBtnStyle" :class="{reactedStyle: selectedMsg.isLiked}" @mousedown.capture="likeMsg" @touchstart.capture="likeMsg">
|
||||
<CloseIcon name="test" class="icon"/>
|
||||
</button>
|
||||
<p v-show="selectedMsg.isEvent" class="reactStatStyle">{{selectedMsg.going}}</p>
|
||||
<button v-show="selectedMsg.isEvent" type="button" class="textBtnStyle" :class="{reactedStyle: selectedMsg.isGoing}" @mousedown.capture="goingToEvent" @touchstart.capture="goingToEvent">
|
||||
JE PARTICIPE!
|
||||
</button>
|
||||
</div>
|
||||
<p id="selectedMsgText" @touchstart.stop>{{selectedMsg.content}}</p>
|
||||
</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){}
|
||||
*/
|
||||
#msgVisualizer{
|
||||
position: fixed;
|
||||
top:50%;
|
||||
left:3.33%;
|
||||
width: 333px;
|
||||
height: 333px;
|
||||
}
|
||||
/*================ PC LARGE*/
|
||||
@media(min-width:1000px){
|
||||
#msgVisualizer{
|
||||
left: 45%;
|
||||
top: 33.3%;
|
||||
}
|
||||
}
|
||||
|
||||
.windowContent .msgReact{
|
||||
margin-left: -16.1%;
|
||||
width: 77%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
font-family: 'lineal';
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
}
|
||||
.windowContent .reactStatStyle{
|
||||
text-align: center;
|
||||
width: 33px;
|
||||
padding-right: 0;
|
||||
}
|
||||
.windowContent .icon{
|
||||
height: 16.1px;
|
||||
width: auto;
|
||||
margin-top: 0;
|
||||
}
|
||||
.windowContent .iconBtnStyle{
|
||||
height: 33px;
|
||||
width: 33px;
|
||||
border-radius: 33px;
|
||||
}
|
||||
.windowContent .textBtnStyle{
|
||||
height: 33px;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
#selectedMsgText{
|
||||
white-space: pre-line;
|
||||
font-size: 16.1px;
|
||||
font-family: 'velvelyne';
|
||||
color: var(--main-color);
|
||||
font-weight: bold;
|
||||
padding-right: 16.1px;
|
||||
padding-left: 7.77px;
|
||||
margin-top: 0;
|
||||
height: 77%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.reactedStyle{
|
||||
color: var(--accent-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import Moveable from 'vue3-moveable';
|
||||
import { dataStorage } from '../dataExchange.js'
|
||||
|
||||
export default {
|
||||
name : 'MessagePannel',
|
||||
components:{
|
||||
Moveable
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
target: null
|
||||
}
|
||||
},
|
||||
emits: ['close','focus'],
|
||||
computed:{
|
||||
selectedMsg(){
|
||||
return dataStorage.selectedMsg
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onDrag({ target, transform }) {
|
||||
target.style.transform = transform;
|
||||
},
|
||||
likeMsg(){
|
||||
dataStorage.selectedMsg.isLiked = !dataStorage.selectedMsg.isLiked
|
||||
},
|
||||
goingToEvent(){
|
||||
dataStorage.selectedMsg.isGoing = !dataStorage.selectedMsg.isGoing;
|
||||
},
|
||||
closeMsg(){
|
||||
this.$emit('close');
|
||||
dataStorage.selectedMsg.isSelected = false;
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.target = this.$refs.msgPannel;
|
||||
console.log("Message pannel is loaded!");
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user