<template>
  <div class="col">
    <button @click="show = true" class="btn btn-block btn-danger">動画の削除</button>
    <span v-if="show">
      <vue-draggable-resizable style="border: 0px solid #232629;" :drag-handle="'.drag-handle'" class-name-handle="resize-handle" class="disco" :x="-500" :y="10" :z="99999999">
        <div style="width: 100%; position: relative;">
          <div class="drag-handle-left"></div>
          <div class="drag-handle">動画の削除</div>
          <div class="drag-handle-right" @click="show = false"></div>
        </div>
        <div class="konsole_left"></div>
        <div style="text-align: center; font-size: 18px; padding-top: 10px;">本当に現在の動画を削除しますか？</div>
        <div style="text-align:right; line-height: 15; padding: 10px;">
          <button type="button" class="btn btn2 btn-popup" @click="show = false">キャンセル</button>
          <button type="button" class="btn btn2 btn-popup" @click="del">削除</button>
        </div>
        <div class="konsole_right"></div>
        <div class="konsole_bottom_left"></div>
        <div class="konsole_bottom"></div>
        <div class="konsole_bottom_right"></div>
      </vue-draggable-resizable>
    </span>
  </div>
</template>

<script>
  import VueDraggableResizable from 'vue-draggable-resizable';
  import 'vue-draggable-resizable/dist/VueDraggableResizable.css';

  Vue.component('vue-draggable-resizable', VueDraggableResizable);

  export default {
    props: { slug: '' },
    data: function () {
      return {
        show: false,
        width: 0,
        height: 0,
        x: 0,
        y: 0
      }
    },
    watch: { text (x) { localStorage.shotanote = x; } },
    methods: {
      del () { axios.post('/api/video/del', { slug: this.slug }).then(() => { window.location.href = '/'; }); },
      onResize: function (x, y, width, height) {
        this.x = x
        this.y = y
        this.width = width
        this.height = height
      },
      onDrag: function (x, y) {
        this.x = x
        this.y = y
      }
    }
  }
</script>

<style scoped>
  .konsole {
    width: 600px;
    height: 358px;
    margin: auto;
    color: #fcfcfc;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #452886; 
  }

  .drag-handle-left {
    height: 30px;
    width: 30px;
    background: url('/img/bash/discord_top_left.png') no-repeat;
    position: absolute;
    top: 0;
    left: 0;
  }

  .drag-handle {
    cursor: default;
    height: 30px;
    background: url('/img/bash/top_bg.png') repeat-x;
    width: auto;
    margin-left: 30px;
    margin-right: 28px;
    padding-top: 7px;
    padding-right: 0px;
    text-align: center;
    font-weight: bold;
  }

  .drag-handle-right {
    height: 30px;
    width: 28px;
    background: url('/img/bash/top_right.png') no-repeat;
    position: absolute;
    top: 0;
    right: 0;
  }

  .drag-handle-right:hover {
    background: url('/img/bash/top_right_hover.png') no-repeat;
    cursor: default;
  }

  .drag-handle-max {
    height: 30px;
    width: 23px;
    background: url('/img/bash/top_max.png') no-repeat;
    position: absolute;
    top: 0;
    right: 28px;
  }

  .drag-handle-max:hover { 
    background: url('/img/bash/top_max_hover.png') no-repeat;
    cursor: default;
  }

  .drag-handle-min {
    height: 30px;
    width: 23px;
    background: url('/img/bash/top_min.png') no-repeat;
    position: absolute;
    top: 0;
    right: 51px;
  }

  .drag-handle-min:hover { 
    background: url('/img/bash/top_min_hover.png') no-repeat;
    cursor: default;
  }

  .konsole_left {
    width: 2px;
    background: url('/img/bash/left_bg.png') repeat-y;
    position: absolute;
    top: 30px;
    left: 0;
    height: 167px;
  }

  .konsole_right {
    width: 2px;
    background: url('/img/bash/right_bg.png') repeat-y;
    position: absolute;
    height: 167px;
    top: 30px;
    right: 0;
  }

  .disco { background-color: #252a35; }

  .noter, .noter:active, .noter:focus {
    background: transparent;
    border: 0;
    min-height: 360px;
    width: 290px;
    resize: none;
  }

  .btn2 {
    width: 120px;
    border: 1px solid #4d4d4d;
  }

  .btn2:hover {
    cursor: default;
    border: 1px solid #3daee9;
  }

  .btn-popup {
    color: #fcfcfc;
    background-color: #252a35;
  }

  .vdr {
    background-size: cover;
    backdrop-filter: blur(17px);
    font-family: "Lucida Console", Monospace, "DejaVu Sans Mono", "Courier New", MiscFixed;
    font-size: 12px;
    /* white-space: pre; */
    color: #fcfcfc;
    overflow: hidden;
    position: absolute;
    top: 30px;
    left: 2px;
    height: 200px !important;
    width: 500px !important;
    padding: 0;
  }

  .resize-handle-mr {
    width: 2px;
    background: url('/img/bash/right_bg.png') repeat-y;
    position: absolute;
    height: 325px;
    top: 30px;
    right: 0;
  }

  .konsole_bottom_left {
    width: 3px;
    height: 3px;
    background: url('/img/bash/bottom_left.png') no-repeat;
    position: absolute;
    bottom: 0;
    left: 0;
  }

  .konsole_bottom {
    height: 2px;
    background: url('/img/bash/bottom_bg.png') repeat-x;
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 495px;
  }

  .konsole_bottom_right {
    height: 3px;
    width: 3px;
    background: url('/img/bash/bottom_right.png') no-repeat;
    position: absolute;
    right: 0;
    bottom: 0;
  }
</style>
