整个圣诞主题到这节都已经完全讲解完毕了,圣诞主题是基于HTML5+CSS+JS编写与实现的,同时也是七夕主题的故事延续。圣诞主题依旧延续着七夕主题设计的思路,引入了3个经典的场景页面,在每个场景中表述着不同的行为。实现上总结了之前七夕主题的一些经验与反馈,并在此之上加以优化与扩展。这个案例不算很难,但是把前端做动画的一些精髓已经讲透了。运用的技术基本就是H5+JS+CSS3,但是每个部分的实现都会有很多知识点的涉及,这里大体的总结下
具体我来归纳下改良的技术方案与涉及到的知识点:
要学的东西可不少了,学完整个课程后,你对前端是不是有更深入的理解呢?
ps:继续期待我的下一次课程吧~
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>圣诞主题</title> <link rel='stylesheet' href='http://img1.sycdn.imooc.com//down/566a38a90001f17d00000000.css' /> <script type="text/javascript" src="http://img1.sycdn.imooc.com//down/566a38f000016f0900000000.js"></script> </head> <body> <section class="container"> <!-- 第一幅画面 --> <section class="page-a bg-adaptive"> <!-- 男孩 --> <div class="chs-boy chs-boy-deer"></div> <!-- 月亮 --> <div class="moon"></div> <!-- 云 --> <div class="cloudy"></div> <!-- 圣诞树 --> <figure class="tree"></figure> <!-- 星星 --> <svg viewBox="0 0 512 486"> <defs> <linearGradient id="star" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" stop-color="#FCF0BC"></stop> <stop offset="0%" stop-color="#FCF0BC"></stop> </linearGradient> </defs> <polygon style="fill: url(#star);" points="256.814,12.705 317.205,198.566 512.631,198.566 354.529,313.435 414.918,499.295 256.814,384.427 98.713,499.295 159.102,313.435 1,198.566 196.426,198.566 "></polygon> </svg> <!-- 窗户 --> <div class="window wood"> <div class="window-bg"></div> <div class="window-content"> <div class="window-left"></div> <div class="window-right"></div> </div> </div> </section> <!-- 第二幅画面 --> <section class="page-b bg-adaptive"> <!-- 猫 --> <figure class="cat"></figure> <!-- 小女孩 --> <figure class="girl"></figure> <!-- 圣诞男孩 --> <figure class="christmas-boy-head"></figure> <figure class="christmas-boy boy-walk"> </figure> <!-- 旋转木马 --> <div id="carousel"> <figure id="spinner"></figure> </div> </section> <!-- 第三幅画面 --> <section class="page-c bg-adaptive"> <!-- 月亮 --> <div class="moon"></div> <!-- 云 --> <div class="cloudy"></div> <!-- 星星 --> <svg viewBox="0 0 512 486"> <defs> <linearGradient id="star" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" stop-color="#FCF0BC"></stop> <stop offset="0%" stop-color="#FCF0BC"></stop> </linearGradient> </defs> <polygon style="fill: url(#star);" points="256.814,12.705 317.205,198.566 512.631,198.566 354.529,313.435 414.918,499.295 256.814,384.427 98.713,499.295 159.102,313.435 1,198.566 196.426,198.566 "></polygon> </svg> <!-- 圣诞树 --> <figure class="tree treefix"></figure> <!-- 鹿 --> <figure class="deer"></figure> <!-- 窗户关闭 --> <div class="window wood"> <!-- <div class="window-bg"></div> --> <div class="window-content" data-attr="red"> <div class="window-scene-bg"></div> <div class="window-close-bg"></div> <div class="window-left hover"></div> <div class="window-right hover"></div> </div> </div> <!-- 雪花 --> <canvas id="snowflake" style="position:absolute;z-index:999;"></canvas> </section> </section> </body> </html>