完整代码
<template>
<div relative>
<div absolute w-full h-full>
<div flex items-center justify-center top-0 left-0 class="wrap">
<div class="floor"></div>
</div>
</div>
<div flex items-center justify-center h-100vh w-full relative z-22 top--32>
<div flex gap-40>
<Btn2 />
<Btn3 />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import Btn2 from "@/components/btns/btn2.vue";
import Btn3 from "@/components/btns/btn3.vue";
</script>
<style scoped lang="scss">
.wrap {
perspective: 1000px; /* 设置透视点,数值越大,翻转效果越平缓 */
transform-style: preserve-3d;
overflow: hidden;
}
.floor {
background-color: rgb(202, 202, 202);
width: 72%;
height: 100vh;
transform: rotateX(80deg);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.7);
}
</style>
Btn组件的来源:
https://uiverse.io/buttons