5.13 (案例) 2d轉(zhuǎn)換課堂案例

2d轉(zhuǎn)換課堂案例.png
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="css/sty.css"/>
    </head>
    <body>
        <div class="container">
            <figure class="effect1">
                ![](img/pic1.jpg)
                <figcaption>
                    <h2>平移動(dòng)畫1</h2>
                    <p>最簡(jiǎn)單的平移動(dòng)畫</p>
                </figcaption>
            </figure>
            <figure class="effect2">
                ![](img/pic2.jpg)
                <figcaption>
                    <h2>平移動(dòng)畫2</h2>
                    <span class="span1">&nbsp;多條圖片簡(jiǎn)介文字&nbsp;</span>
                    <span class="span2">&nbsp;逐一飛入動(dòng)畫&nbsp;</span>
                    <span class="span3">&nbsp;利用動(dòng)畫延時(shí)達(dá)到效果&nbsp;</span>
                </figcaption>
            </figure>
            <figure class="effect3">
                ![](img/pic3.jpg)
                <figcaption>
                    <h2>底部滑出動(dòng)畫</h2>
                    <p>translate屬性可以制作多種動(dòng)畫,一個(gè)簡(jiǎn)單的位置移動(dòng)可以制作出多種效果,重要看制作師們能否開動(dòng)想象力。</p>
                </figcaption>
            </figure>
            <figure class="effect4">
                ![](img/pic4.jpg)
                <figcaption>
                    <h2>利用旋轉(zhuǎn)顯示額外的信息</h2>
                        <p class="info1">info1</p>
                        <p class="info2">info2</p>
                </figcaption>
                <div></div>
            </figure>
            <figure class="effect5">
                ![](img/pic5.jpg)
                <figcaption>
                    <h2>旋轉(zhuǎn)飛入飛出</h2>
                    <p>通過(guò)旋轉(zhuǎn)和位移制作飛入飛出效果</p>
                </figcaption>
                <div></div>
            </figure>
            <figure class="effect6">
                ![](img/pic6.jpg)
                <figcaption>
                    <h2>扭曲飛入飛去</h2>
                    <p>通過(guò)扭曲和位移,制作出飛入的效果。<br>扭曲屬到達(dá)90度。元素就看不見(jiàn)了</p>
                </figcaption>
            </figure>
            <figure class="effect7">
                ![](img/pic7.jpg)
                <figcaption>
                    <h2>簡(jiǎn)單的縮放效果</h2>
                    <p>通過(guò)簡(jiǎn)單的縮放達(dá)到效果</p>
                </figcaption>
                <div></div>
            </figure>
            <figure class="effect8">
                ![](img/pic8.jpg)
                <figcaption>
                    <h2>繪制線條效果</h2>
                    <p>通過(guò)縮放屬性繪制邊框線條</p>
                </figcaption>
                <div class="borW"></div>
                <div class="borH"></div>
            </figure>
            <figure class="effect9">
                ![](img/pic9.jpg)
                <figcaption>
                    <h2>作業(yè)</h2>
                    <p>自己設(shè)計(jì)一個(gè)效果</p>
                </figcaption>
            </figure>
        </div>
    </body>
</html>

@charset "utf-8";
*{
    padding: 0;
    margin: 0;
}
html{
    font-size: 62.5%;
}

figure{
    position: relative;
    float: left;
    width: 33.33%;
    height: 365px;
    transition: all .5s;
    overflow: hidden;
}
h2{
    font-size: 3.2rem;
    color:#ffffff;
    transition: all .5s;
}
p{
    color:#ffffff;
    font-size: 2.2rem;
    transition: all .5s;
}
img{
    position: absolute;
    left:0;
    top:0;
    opacity: 1;
    transition: all .5s;
}

span{
    display: block;
    color:#000;
    background-color: #ffffff;
    font-size: 1.4rem;
    line-height: 1.6rem;
    transition: all .5s;
}
figure:hover img{
    transform: translateX(-20px);
    opacity: .5;
}

div{
    transition: all .5s;
}
.effect1 h2{
    position: absolute;
    left: 30px;
    bottom:60px;
    
}
.effect1 p{
    position: absolute;
    left: 30px;
    bottom:-30px;
    
}
.effect1:hover img{
    transform: translateX(-20px);
}
.effect1:hover h2{
    transform: translateY(-10px);
}
.effect1:hover p{
    transform: translateY(-50px);
}

.effect2 h2{
    position: absolute;
    top:60px;
    left:30px;
}
.effect2:hover h2{
    transform: translateY(-15px);
}

.effect2 .span1{
    position: absolute;
    top:100px;
    left:-220px;
}
.effect2 .span1{
    position: absolute;
    top:130px;
    left:-220px;
}
.effect2 .span2{
    position: absolute;
    top:160px;
    left:-220px;
    transition-delay: .2s;
}
.effect2 .span3{
    position: absolute;
    top:190px;
    left:-220px;
    transition-delay: .3s;
}
.effect2:hover .span1{
    transform: translateX(250px);
    
}
.effect2:hover .span2{
    transform: translateX(250px);
    
}
.effect2:hover .span3{ 
    transform: translateX(250px);
}

.effect3 h2{
    position: absolute;
    top:100px;
    left:30px;
}
.effect3:hover h2{
    transform: translateY(-10px);
}

.effect3 p{
    position: absolute;
    left:0;
    bottom: -50px;
    background-color: #ffffff;
    width: 100%;
    text-indent: 2rem;
    height: 50px;
    line-height: 1.8rem;
    font-size: 1.4rem;
    color: #000;
}
.effect3:hover p{
    transform: translateY(-50px);
}

.effect4 h2{
    position: absolute;
    top:100px;
    left:30px;
    opacity: 0;
}

.effect4 div{
    position: absolute;
    bottom: -300px;
    width: 800px;
    height: 300px;
    z-index: 98;
    background-color: #ffffff;
    
}
.effect4 .info1{
    position: absolute;
    right: 120px;
    bottom:-50px;
    color:#000;
    font-weight:bold;
    z-index:99;
}
.effect4 .info2{
    position: absolute;
    right: 50px;
    bottom:-50px;
    color:#000;
    z-index:99;
    font-weight:bold;
    transition-delay: 0.05s;
}
.effect4:hover h2{
    transform: translateY(-30px);
    opacity: 1;
}
.effect4:hover .info2{
    transform:translateY(-80px);
}
.effect4:hover .info1{
    transform:translateY(-80px);
}
.effect4:hover div{
    transform-origin: 0 0;
    transform: rotate(-15deg);
}

.effect5 div{
    position: absolute;
    left:15%;
    top:15%;
    width: 70%;
    height: 70%;
    border:1px solid #000;
    transform: translateY(-400px) rotate(0deg) ;
    transform-origin: 0 0;
}
.effect5:hover div{
    transform: translateY(0px) rotate(360deg) ;
}
.effect5 h2{
    position: absolute;
    left: 30px;
    top: 60px;
}
.effect5:hover h2{
    transform: translateX(50px);
}
.effect5 p{
    position: absolute;
    font-size: 1.2rem;
    left:20%;
    top:50%;
}
.effect5:hover p{
    transform: translateY(-30px);
}

.effect6 h2{
    position: absolute;
    left:30px;
    top:30px;
    transform: skew(90deg);
}
.effect6 p{
    position: absolute;
    left:60px;
    top:80px;
    transform: skew(90deg);
}
.effect6:hover h2{
    transform: skew(0deg);
}
.effect6:hover p{
    transform: skew(0deg);
}

.effect7 h2{
    position: absolute;
    left:20%;
    top:20%;
    transform: scale(1.2);
}
.effect7 img{
    transform: scale(1.2);
}
.effect7:hover img{
    transform: scale(1);
}
.effect7 div{
    width: 70%;
    height: 70%;
    position: absolute;
    left: 15%;
    top:15%;
    transform: scale(1.2);
    border: 2px solid #ffffff;
}
.effect7 p{
    position: absolute;
    left: 35%;
    top:45%;
    transform: scale(1.2);
}
.effect7:hover h2{
    transform: scale(1);
}
.effect7:hover p{
    transform: scale(1);
}
.effect7:hover div{
    transform: scale(1);
}
.effect8 h2{
    position: absolute;
    left:12%;
    top:17%;
}
.effect8:hover h2{
    transform: translateX(30px);
}
.effect8 p{
    position: absolute;
    left:17%;
    top:33%;
    opacity: 0;
}
.effect8:hover p{
    transform: translateY(-20px);
    opacity: 1;
}
.effect8 .borW{
    width:80%;
    height: 70%;
    border: 1px solid #ffffff;
    border-left: none;
    border-right: none ;
    position: absolute;
    left: 10%;
    top: 15%;
    transform: scaleX(0);
    
}
.effect8 .borH{
    width:70%;
    height: 80%;
    border: 1px solid #ffffff;
    border-top: none;
    border-bottom: none ;
    position: absolute;
    left: 15%;
    top: 10%;
    transform: scaleY(0);
}

.effect8:hover .borH{
    transform: scaleY(1);
}
.effect8:hover .borW{
    transform: scaleY(1);
}

 

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • CSS3 2D轉(zhuǎn)換 通過(guò) 2D 轉(zhuǎn)換,我們能夠?qū)υ剡M(jìn)行移動(dòng)、縮放、轉(zhuǎn)動(dòng)、拉長(zhǎng)或拉伸。 Internet Expl...
    safiriGitHub閱讀 766評(píng)論 0 0
  • 成功的經(jīng)驗(yàn)千千萬(wàn),個(gè)體、環(huán)境等差異導(dǎo)致我們不能完全照搬,但是我們可以從眾多的經(jīng)驗(yàn)中總結(jié)歸納出成功所必須的一些條件,...
    環(huán)盈閱讀 216評(píng)論 2 3
  • 突然一下就慌了。二十三歲的自己像個(gè)傻逼一樣,畏首畏腳的過(guò)了大學(xué)到現(xiàn)在,沒(méi)好好的去一個(gè)人旅行,沒(méi)好好的談戀愛(ài),沒(méi)好好...
    a3a353c8d9da閱讀 177評(píng)論 0 0

友情鏈接更多精彩內(nèi)容