238 行
5.4 KiB
Vue
238 行
5.4 KiB
Vue
<template>
|
|
<span>
|
|
<img src="/assets/img/bash/app_icon.png" width="50" @click="openterm = true" />
|
|
<vue-resizable
|
|
class="resizable"
|
|
ref="resizableComponent"
|
|
:dragSelector="dragSelector"
|
|
:active="handlers"
|
|
:fit-parent="fit"
|
|
:max-width="maxW | checkEmpty"
|
|
:max-height="maxH | checkEmpty"
|
|
:min-width="minW | checkEmpty"
|
|
:min-height="minH | checkEmpty"
|
|
:width="width"
|
|
:height="height"
|
|
:top="top"
|
|
:left="left"
|
|
v-show="openterm"
|
|
fit-parent
|
|
@mount="eHandler"
|
|
@resize:move="eHandler"
|
|
@resize:start="eHandler"
|
|
@resize:end="eHandler"
|
|
@drag:move="eHandler"
|
|
@drag:start="eHandler"
|
|
@drag:end="eHandler"
|
|
>
|
|
<div class="konsole" id="dragger">
|
|
<div class="draggerheader">
|
|
<div class="konsole_top_left"></div>
|
|
<div class="konsole_top"><div style="width: 540px; margin: auto;">ロリ端末</div></div>
|
|
<div class="konsole_top_min"></div>
|
|
<div class="konsole_top_max"></div>
|
|
<div class="konsole_top_right" @click="openterm = false"></div>
|
|
</div>
|
|
<div class="konsole_left"></div>
|
|
<div class="konsoleuser">
|
|
ロリコマンドラインですね〜♡<br />
|
|
shiken@technicalsuwako.jp:/$ <span style="font-stretch: condensed;">█</span>
|
|
</div>
|
|
<div class="konsole_right"></div>
|
|
<div class="konsole_bottom_left"></div>
|
|
<div class="konsole_bottom"></div>
|
|
<div class="konsole_bottom_right"></div>
|
|
</div>
|
|
</vue-resizable>
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
import VueResizable from 'vue-resizable';
|
|
|
|
export default {
|
|
components: { VueResizable },
|
|
data: function () {
|
|
const tW = 600;
|
|
const tH = 300;
|
|
return {
|
|
openterm: false,
|
|
handlers: ["r", "rb", "b", "lb", "l", "lt", "t", "rt"],
|
|
left: `calc(50% - ${tW / 2}px)`,
|
|
top: `calc(50% - ${tH / 2}px)`,
|
|
height: tH,
|
|
width: tW,
|
|
maxW: 600,
|
|
maxH: 300,
|
|
minW: 600,
|
|
minH: 300,
|
|
fit: true,
|
|
event: "",
|
|
dragSelector: ".draggerheader"
|
|
}
|
|
},
|
|
created: function () {
|
|
},
|
|
methods: {
|
|
eHandler (data) {
|
|
console.log(data);
|
|
this.width = data.width;
|
|
this.height = data.height;
|
|
this.left = data.left;
|
|
this.top = data.top;
|
|
this.event = data.eventName;
|
|
}
|
|
},
|
|
filters: {
|
|
checkEmpty (value) {
|
|
return typeof value !== "number" ? 0 : value;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
#dragger {
|
|
position: absolute;
|
|
z-index: 9;
|
|
}
|
|
|
|
#draggerheader {
|
|
cursor: move;
|
|
z-index: 10;
|
|
}
|
|
|
|
.konsole {
|
|
width: 600px;
|
|
height: 300px;
|
|
margin: auto;
|
|
color: #fcfcfc;
|
|
}
|
|
|
|
.konsole_top_left {
|
|
height: 30px;
|
|
width: 30px;
|
|
background: url('/assets/img/bash/top_left.png') no-repeat;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
}
|
|
|
|
.konsole_top {
|
|
height: 30px;
|
|
background: url('/assets/img/bash/top_bg.png') repeat-x;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 30px;
|
|
width: 496px;
|
|
padding-top: 7px;
|
|
padding-right: 30px;
|
|
text-align: center;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.konsole_top_right {
|
|
height: 30px;
|
|
width: 28px;
|
|
background: url('/assets/img/bash/top_right.png') no-repeat;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
}
|
|
|
|
.konsole_top_right:hover {
|
|
background: url('/assets/img/bash/top_right_hover.png') no-repeat;
|
|
cursor: default;
|
|
}
|
|
|
|
.konsole_top_max {
|
|
height: 30px;
|
|
width: 23px;
|
|
background: url('/assets/img/bash/top_max.png') no-repeat;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 28px;
|
|
}
|
|
|
|
.konsole_top_max:hover {
|
|
background: url('/assets/img/bash/top_max_hover.png') no-repeat;
|
|
cursor: default;
|
|
}
|
|
|
|
.konsole_top_min {
|
|
height: 30px;
|
|
width: 23px;
|
|
background: url('/assets/img/bash/top_min.png') no-repeat;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 51px;
|
|
}
|
|
|
|
.konsole_top_min:hover {
|
|
background: url('/assets/img/bash/top_min_hover.png') no-repeat;
|
|
cursor: default;
|
|
}
|
|
|
|
.konsole_left {
|
|
width: 2px;
|
|
background: url('/assets/img/bash/left_bg.png') repeat-y;
|
|
position: absolute;
|
|
top: 30px;
|
|
left: 0;
|
|
height: 267px;
|
|
}
|
|
|
|
.konsoleuser { background: url('/assets/img/bash/user_bg.png') repeat; }
|
|
.konsoleroot { background: url('/assets/img/bash/root_bg.png') repeat; }
|
|
|
|
.konsoleuser, .konsoleroot {
|
|
background-size: cover;
|
|
backdrop-filter: blur(17px);
|
|
font-family: "Lucida Console", Monospace, "DejaVu Sans Mono", "Courier New", MiscFixed;
|
|
font-size: 12px;
|
|
color: #fcfcfc;
|
|
overflow: auto;
|
|
position: absolute;
|
|
top: 30px;
|
|
left: 2px;
|
|
height: 268px;
|
|
width: 596px;
|
|
padding: 5px;
|
|
}
|
|
|
|
.konsole_right {
|
|
width: 2px;
|
|
background: url('/assets/img/bash/right_bg.png') repeat-y;
|
|
position: absolute;
|
|
height: 267px;
|
|
top: 30px;
|
|
right: 0;
|
|
}
|
|
|
|
.konsole_bottom_left {
|
|
width: 3px;
|
|
height: 3px;
|
|
background: url('/assets/img/bash/bottom_left.png') no-repeat;
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
}
|
|
|
|
.konsole_bottom {
|
|
height: 2px;
|
|
background: url('/assets/img/bash/bottom_bg.png') repeat-x;
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 2px;
|
|
width: 595px;
|
|
}
|
|
|
|
.konsole_bottom_right {
|
|
height: 3px;
|
|
width: 3px;
|
|
background: url('/assets/img/bash/bottom_right.png') no-repeat;
|
|
position: absolute;
|
|
right: 0;
|
|
bottom: 0;
|
|
}
|
|
</style> |