<!-- 物品入库-待入库 -->
<template>
<div class="content">
<button @click="onImg">图片切换</button>
<div class="cubeBox">
<ul class="cube">
<li><img class="img" :src="imgsrc"></li>
<li><img class="img" :src="imgsrc"></li>
<li><img class="img" :src="imgsrc"></li>
<li><img class="img" :src="imgsrc"></li>
<li><img class="img" :src="imgsrc"></li>
<li><img class="img" :src="imgsrc"></li>
</ul>
</div>
</div>
</template>
<script>
export default {
components: {}, // 引入的组件们
data() {
return {
imgsrc: require('./1.jpg')
}
},
computed: {},
created() {},
mounted() {},
methods: {
onImg() {
this.imgsrc = require('./2.jpg')
}
}
}
</script>
<style lang="scss" scoped>
//@import "@/styles/element-variables.scss";
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
.content {
width: 1000px;
height: 1000px;
perspective: 800;
}
.cubeBox {
width: 200px;
height: 200px;
position: absolute;
top: 50%;
left: 50%;
margin: -100px 0 0 -100px;
transform-style: preserve-3d;
}
.cube {
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
margin: -50px 0 0 -50px;
transform-style: preserve-3d;
transform: rotateX(-10deg) rotateY(45deg);
animation: move 8s linear infinite;
li {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
img {
width: 100%;
height: 100%;
}
}
li:nth-child(1) {
transform: rotateX(0deg) translateZ(50px);
}
li:nth-child(2) {
transform: rotateX(180deg) translateZ(50px);
}
li:nth-child(3) {
transform: rotateX(-90deg) translateZ(50px);
}
li:nth-child(4) {
transform: rotateX(90deg) translateZ(50px);
}
li:nth-child(5) {
transform: rotateY(-90deg) translateZ(50px);
}
li:nth-child(6) {
transform: rotateY(90deg) translateZ(50px);
}
@keyframes move {
0% {
transform: rotateX(-13deg) rotateY(0deg);
}
100% {
transform: rotateX(-13deg) rotateY(360deg);
}
}
}
</style>