|
@@ -2,17 +2,75 @@
|
|
|
<div
|
|
|
class="watch-comp"
|
|
|
>
|
|
|
- <!-- <video
|
|
|
+ <video
|
|
|
src=""
|
|
|
autoplay
|
|
|
controls
|
|
|
- /> -->
|
|
|
+ :style="{
|
|
|
+ left: videoLeft + 'px',
|
|
|
+ top: videoTop + 'px',
|
|
|
+ width: videoWidth + 'px',
|
|
|
+ height: videoHeight + 'px',
|
|
|
+ }"
|
|
|
+ />
|
|
|
+ <div class="bag-wrapper">
|
|
|
+ <img
|
|
|
+ class="jigsaw"
|
|
|
+ src="@/assets/images/jigsaw.png"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="bag"
|
|
|
+ src="@/assets/images/bag.png"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { onMounted, onUnmounted, watch, ref, reactive, computed } from "vue"
|
|
|
+
|
|
|
export default {
|
|
|
name: 'HomeView',
|
|
|
+ setup() {
|
|
|
+ const videoLeft = ref(0)
|
|
|
+ const videoTop = ref(0)
|
|
|
+ const videoWidth = ref(0)
|
|
|
+ const videoHeight = ref(0)
|
|
|
+
|
|
|
+ function computeVideoPos() {
|
|
|
+ const topLeft = utils.mapPosFromDraftToWindow({
|
|
|
+ x: 738,
|
|
|
+ y: 572,
|
|
|
+ })
|
|
|
+ const bottomRight = utils.mapPosFromDraftToWindow({
|
|
|
+ x: 1183,
|
|
|
+ y: 897,
|
|
|
+ })
|
|
|
+ videoLeft.value = topLeft.x
|
|
|
+ videoTop.value = topLeft.y
|
|
|
+ videoWidth.value = bottomRight.x - topLeft.x
|
|
|
+ videoHeight.value = bottomRight.y - topLeft.y
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ computeVideoPos()
|
|
|
+ window.addEventListener('resize', computeVideoPos)
|
|
|
+ })
|
|
|
+ onUnmounted(() => {
|
|
|
+ window.removeEventListener('resize', computeVideoPos)
|
|
|
+ })
|
|
|
+
|
|
|
+ return {
|
|
|
+ videoLeft,
|
|
|
+ videoTop,
|
|
|
+ videoWidth,
|
|
|
+ videoHeight,
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
}
|
|
@@ -45,7 +103,40 @@ export default {
|
|
|
background-position: center center;
|
|
|
>video {
|
|
|
position: absolute;
|
|
|
+ }
|
|
|
+ >.bag-wrapper {
|
|
|
+ position: absolute;
|
|
|
+ right: 11vw;
|
|
|
+ bottom: 41px;
|
|
|
+ >img.jigsaw {
|
|
|
+ position: absolute;
|
|
|
+ width: 60px;
|
|
|
+ height: 60px;
|
|
|
+ left: 55px;
|
|
|
+ animation-name: drop;
|
|
|
+ animation-duration: 3s;
|
|
|
+ animation-timing-function: cubic-bezier(.3,.12,.54,.32);
|
|
|
+ animation-iteration-count: infinite;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+ >img.bag {
|
|
|
+ position: relative;
|
|
|
+ height: 190px;
|
|
|
+ width: 190px;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+@keyframes drop {
|
|
|
+ 0% {
|
|
|
+ bottom: 250px;
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ bottom: 50px;
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ bottom: 50px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|