<script setup>
    import CloseIcon from '../assets/icons/close.svg'
</script>

<template>
    <div id="artistPannel" class="windowStyle" ref="artistPannel" @mousedown="$emit('focus')" @touchstart="$emit('focus')">
      <Moveable
          className="moveable"
          :target="target"
          :draggable="true"
          @drag="onDrag"
      />
      <div class="windowTitle">
        <p>
          <b class="windowTitleLower">À PROPOS DE</b>
          <br>
          Nos Artistes
        </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){}
  */

  #artistPannel{
    position: fixed;
    width: 333px;
    height: 500px;
    top: 16.1px;
    left: 16.1px;
  }
  /*================ PC LARGE*/
  @media(min-width:1300px){
    #artistPannel{
      height: 777px;
      width: 666px;
    }
  }
</style>

<script>
  import Moveable from 'vue3-moveable';

  export default {
    name : 'ArtistPannel',
    components:{
      Moveable
    },
    data(){
      return{
        target: null
      }
    },
    emits: ['close','focus'],
    methods:{
      onDrag({ target, transform }) {
        target.style.transform = transform;
      }
    },
    mounted(){
      this.target = this.$refs.artistPannel;
      console.log("Artist pannel is loaded!");
    }
  };
</script>
