实训项目3D旋转书本

4 篇文章 0 订阅

小组项目实现书本鼠标放上去翻页并旋转一定的角度
在这里插入图片描述
html:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D书本翻页特效</title>
    <link rel="stylesheet" href="3D书本翻页特效.css">
</head>

<body>

    <div class="shu">
        <div class="feng"></div>
        <div class="wen">
            <h3 class="title">Life of Pi</h3>
            <p class="page">
                He lives in Scarborough. He's a small, slim man – nomore than five foot five. Dark hair, dark eyes. Hair greyingat the temples. Can't be older than forty. leasingcoffee-coloured complexion1. Mild fall weather, yet puts on abig winter parka with fur-lined
                hood2 for the walk to thediner.
            </p>
        </div>
    </div>

</body>

</html>

css:

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    background-image: radial-gradient(white, black);
    display: flex;
    justify-content: center;
    align-items: center;
}

.title {
    padding-top: 50px;
    padding-left: 40px;
}

.page {
    padding-top: 20px;
    padding-left: 40px;
    padding-right: 15px;
}

.shu {
    position: relative;
    width: 300px;
    height: 400px;
    background-color: rgba(255, 255, 255, 0.774);
    transform-style: preserve-3d;
    box-shadow: 300px 0px 30px rgb(0, 0, 0, .6) inset;
    transition: 1s cubic-bezier(.79, .34, .47, .92);
}

.shu::after {
    content: '';
    position: absolute;
    height: 3px;
    width: 303px;
    left: 0px;
    bottom: -3px;
    /*  background-color: rgb(100, 96, 96); */
    background-image: linear-gradient(to right, rgb(71, 68, 68), rgba(124, 120, 120, 0.3));
    border-bottom-left-radius: 5px;
}

.shu::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 100%;
    right: -3px;
    top: 0px;
    background-color: rgb(112, 108, 108);
    background-image: linear-gradient(to top, rgb(114, 111, 111), rgba(90, 87, 87, 0.5));
    ;
    border-top-right-radius: 3px;
}

.shu:hover {
    box-shadow: 30px 0px 30px rgb(0, 0, 0, .6) inset;
    transform: rotate(-20deg);
}

.feng {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-image: url(bg.jpg);
    background-repeat: no-repeat;
    background-size: 300px 400px;
    transform-origin: left;
    transition: 1s cubic-bezier(.79, .34, .47, .92);
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.shu:hover .feng {
    transform: rotateY(-180deg);
}

.wen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'fangsong';
    text-align: left;
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值