威尼斯手机平台登陆-官方网站登录

威尼斯手机平台登陆为您带来世界三大博彩公司最新相关资讯,威尼斯官方网站登录充分考虑到不同地域网民的不同需求,威尼斯手机平台登陆良好的用户界面,人性化的操作,实用的功能设计使其广泛受到欢迎,推动实体出版、影视、动漫、游戏等相关文化产业的发展。

您的位置:威尼斯手机平台登陆 > 前端资源 > 付费投稿计划,我们需要不断学习

付费投稿计划,我们需要不断学习

发布时间:2020-04-21 17:03编辑:前端资源浏览(179)

    本文由码农网 – 小峰原创,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划!

    这段时间我已经为大家分享了不少关于HTML5应用和jQuery插件了,先来回顾一下:

    也许在5年前,HTML5还是一种很前卫的技术,大家还只是将它当做实验来看待,更别说产品应用了。但是现在HTML5已经非常流行,无论从PC端还是移动端,HTML5都扮演着非常重要的角色。今天我们要分享的一些应用就是基于HTML5和jQuery的,加上源代码的下载,你一定会觉得很受用的,赶紧分享吧。

    这是一款基于HTML5和CSS3的3D动画特效,与之前的3D特效不同的是,这款是完全用HTML5特性实现的,而并非用多张图片叠加起来。这款3D动画还有一个特点是可以无限的旋转,从而可以从多个视角来观察HTML5 Logo。

    • 炫酷霸气的HTML5/jQuery应用及源码
    • 干货分享 超炫丽的HTML5/jQuery应用及代码
    • 绚丽而实用的jQuery/CSS3应用及源码

    HTML5线性图表 图表数据区域可着色

    这是一款基于Canvas的HTML5图表应用,在图表数据初始化的时候伴随动画效果。

    核心jQuery代码:

    图片 1图片 2

    var myData = {    labels : ["Mo","Di","Mi","Do","Fr","Sa","So"],    datasets : [      {        fillColor : "rgba(220,220,220,.5)",        strokeColor : "rgba(220,220,220,1)",        pointColor : "rgba(220,220,220,1)",        pointStrokeColor : "#fff",        data : [65,59,90,81,56,55,40]      },      {        fillColor : "rgba(90,190,90,.5)",        strokeColor : "rgba(90,190,90,1)",        pointColor : "rgba(90,190,90,1)",        pointStrokeColor : "#fff",        data : [40,48,40,40,90,27,90]      }    ]  }    new Chart(document.getElementById("canvas").getContext("2d")).Line(myData)
    

    View Code

    图片 3

    在线演示        源码下载

    图片 4

    今天我们继续来介绍一些新鲜的HTML5/CSS3应用及源码,希望大家会喜欢。HTML5是WEB的未来,我们需要不断学习。

    HTML5/CSS3仿Facebook登录表单

    这是一款利用CSS3实现的创意表单,它的外观是模仿Facebook的。

    核心CSS代码:

    图片 5图片 6

    .login-form-wrap {    background: #5170ad;    background: -moz-radial-gradient(center, ellipse cover, #5170ad 0%, #355493 100%);    background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #5170ad), color-stop(100%, #355493));    background: -webkit-radial-gradient(center, ellipse cover, #5170ad 0%, #355493 100%);    background: -o-radial-gradient(center, ellipse cover, #5170ad 0%, #355493 100%);    background: -ms-radial-gradient(center, ellipse cover, #5170ad 0%, #355493 100%);    background: radial-gradient(ellipse at center, #5170ad 0%, #355493 100%);    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5170ad', endColorstr='#355493',GradientType=1 );    border: 1px solid #2d416d;    box-shadow: 0 1px #5670a4 inset, 0 0 10px 5px rgba(0, 0, 0, 0.1);    border-radius: 5px;    position: relative;    width: 360px;    height: 380px;    margin: 10px auto 20px auto;    padding: 50px 30px 0 30px;    text-align: center;  }  .login-form-wrap:before {    background: url(http://i.imgur.com/0vLxyVB.png);    display: block;    content: '';    width: 58px;    height: 19px;    top: 10px;    left: 10px;    position: absolute;  }  .login-form-wrap > h1 {    margin: 0 0 50px 0;    padding: 0;    font-size: 26px;    color: #fff;  }  .login-form-wrap > h5 {    margin-top: 40px;  }  .login-form-wrap > h5 > a {    font-size: 14px;    color: #fff;    text-decoration: none;    font-weight: 400;  }    .login-form input[type="email"], .login-form input[type="password"] {    width: 100%;    border: 1px solid #314d89;    outline: none;    padding: 12px 20px;    color: #afafaf;    font-weight: 400;    font-family: 'Lato', sans-serif;    cursor: pointer;  }  .login-form input[type="email"] {    border-bottom: none;    border-radius: 4px 4px 0 0;    padding-bottom: 13px;    box-shadow: 0 -1px 0 #e0e0e0 inset, 0 1px 2px rgba(0, 0, 0, 0.23) inset;  }  .login-form input[type="password"] {    border-top: none;    border-radius: 0 0 4px 4px;    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.23) inset, 0 1px 2px rgba(255, 255, 255, 0.1);  }  .login-form input[type="submit"] {    font-family: 'Lato', sans-serif;    font-weight: 400;    background: #e0e0e0;    background: -moz-linear-gradient(top, #e0e0e0 0%, #cecece 100%);    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #e0e0e0), color-stop(100%, #cecece));    background: -webkit-linear-gradient(top, #e0e0e0 0%, #cecece 100%);    background: -o-linear-gradient(top, #e0e0e0 0%, #cecece 100%);    background: -ms-linear-gradient(top, #e0e0e0 0%, #cecece 100%);    background: linear-gradient(to bottom, #e0e0e0 0%, #cecece 100%);    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e0e0e0', endColorstr='#cecece',GradientType=0 );    display: block;    margin: 20px auto 0 auto;    width: 100%;    border: none;    border-radius: 3px;    padding: 8px;    font-size: 17px;    color: #636363;    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);    font-weight: 700;    box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.17), 0 1px 0 rgba(255, 255, 255, 0.36) inset;  }  .login-form input[type="submit"]:hover {    background: #DDD;  }  .login-form input[type="submit"]:active {    padding-top: 9px;    padding-bottom: 7px;    background: #C9C9C9;  }
    

    View Code

    图片 7

    在线演示        源码下载

    在线演示源码下载

    HTML5 3D骨牌图片特效

    很不错的HTML5 3D图片动画特效,图片也不再是平面的了。

    核心CSS代码:

    图片 8图片 9

    figure { 
      margin: 0;
      width: 100%;
      height: 29.5vw;
      background: url("winter-hat.jpg");
        background-size: 100%; 
        transform-origin: center bottom;
        transform-style: preserve-3d;
        transition: 1s transform;
     }
    figure figcaption { 
      width: 100%;
      background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
            url("winter-hat.jpg");
        background-size: 100%; height: 50px;
        background-repeat: no-repeat;
      background-position: bottom;
      color: #fff; 
        position: relative; top: 29.5vw;
        transform-origin: center top;
        transform: rotateX(-89.9deg);
        font-size: 1.2vw;
      font-family: Montserrat, Arial, sans-serif;
      text-align: center;
        line-height: 3;
    }
    figure:before {
      content: '';
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
        box-shadow: 0 0 100px 50px rgba(0, 0, 0, 0.1), inset 0 0 250px 250px rgba(0, 0, 0, 0.1);
        transition: 1s;
        transform: rotateX(95deg) translateZ(-80px) scale(0.75);
        transform-origin: inherit;
    }
    div:hover figure { 
      transform: rotateX(75deg) translateZ(5vw); 
    }
    div:hover figure:before {
        box-shadow: 0 0 25px 25px rgba(0, 0, 0, 0.5), inset 0 0 250px 250px rgba(0, 0, 0, 0.5);
        transform: rotateX(-5deg) translateZ(-80px) scale(1);
        }
    
    @media screen and (max-width: 800px) {
      div { width: 50%; } 
      figure { height: 45vw; } 
      figure figcaption { 
        top: 45vw;
        font-size: 2vw;
      } 
    }
    
    @media screen and (max-width: 500px) {
      div { 
        width: 80%; 
        margin-top: 1rem; 
      } 
      figure { 
        height: 70vw;
      } 
      figure figcaption { 
        top: 70vw;
        font-size: 3vw;
      } 
    }
    

    View Code

    图片 10

    在线演示        源码下载

    HTML5/CSS3超酷进度条 不同进度多种颜色

    这是一款很酷的HTML5进度条插件,有不错的动画效果。

    核心jQuery代码:

    图片 11图片 12

    var Loader = function () {        var loader = document.querySelector('.loader-container'),        meter = document.querySelector('.meter'),        k, i = 1,        counter = function () {          if (i <= 100) {               meter.innerHTML = i.toString();            i++;          } else {            window.clearInterval(k);          }        };        return {        init: function (options) {        options = options || {};        var time = options.time ? options.time : 0,              interval = time/100;                  loader.classList.add('run');        k = window.setInterval(counter, interval);         setTimeout(function () {                    loader.classList.add('done');        }, time);      },    }  }();    Loader.init({        // If you have changed the @time in LESS, update this number to the corresponding value. Measured in miliseconds.        time: 10000  });
    

    View Code

    图片 13

    在线演示        源码下载

    HTML代码

    <div class="link-overlay">
    
    </div>
    <canvas id="canvas" style="background-color:#ddd"></canvas>
    

    jQuery UI滑杆插件 可Tooltip提示

    这又是一款相当实用的jQuery插件,基于jQuery UI的,所以外观非常漂亮。

    核心jQuery代码:

    图片 14图片 15

    var points = 20;
    
    /* jquery slider pips plugin, version 0.1 */
    
        (function($) {
    
            var extensionMethods = {
    
                pips: function( settings ) {
    
                    options = {
    
                        first:     "number",     // "pip" , false
                        last:     "number",     // "pip" , false
                        rest:     "pip"         // "number" , false
    
                    };
    
                    $.extend( options, settings );
    
                    // get rid of all pips that might already exist.
                    this.element.addClass('ui-slider-pips').find( '.ui-slider-pip' ).remove();
    
                    // we need teh amount of pips to create.
                    var pips = this.options.max - this.options.min;                    
    
                        // for every stop in the slider, we create a pip.
                        for( i=0; i<=pips; i++ ) {
    
                            // hold a span element for the pip
                            var s = $(''+i+'');
    
                            // add a class so css can handle the display
                            // we'll hide numbers by default in CSS, and show them if set.
                            // we'll also use CSS to hide the pip altogether.
                            if( 0 == i ) {
                                s.addClass('ui-slider-pip-first');
                                if( "number" == options.first ) { s.addClass('ui-slider-pip-number'); }
                                if( false == options.first ) { s.addClass('ui-slider-pip-hide'); }
                            } else if ( pips == i ) {
                                s.addClass('ui-slider-pip-last');
                                if( "number" == options.last ) { s.addClass('ui-slider-pip-number'); }
                                if( false == options.last ) { s.addClass('ui-slider-pip-hide'); }
                            } else {
                                if( "number" == options.rest ) { s.addClass('ui-slider-pip-number'); }
                                if( false == options.rest ) { s.addClass('ui-slider-pip-hide'); }
                            }
    
    
                            // if it's a horizontal slider we'll set the left offset,
                            // and the top if it's vertical.
                            if( this.options.orientation == "horizontal" ) 
                                s.css({ left: '' + (100/pips)*i + '%'  });
                            else
                                s.css({ top: '' + (100/pips)*i + '%'  });
    
    
                            // append the span to the slider.
                            this.element.append( s );
    
                        }
    
                }
    
    
            };
    
            $.extend(true, $['ui']['slider'].prototype, extensionMethods);
    
    
        })(jQuery);
    
    
    
    
    (function($) {
    
            var extensionMethods = {
    
                float: function( settings ) {
    
                    options = {};
                    $.extend( options, settings );
    
                    // add a class for the CSS
                    this.element.addClass('ui-slider-float');
    
    
            // if this is a range slider
            if( this.options.values ) {
    
              var $tip = [
                $(''+ this.options.values[0]+''),
                $(''+ this.options.values[1]+'')
              ];
    
    
            // else if its just a normal slider
            } else {
    
              // create a tip element
              var $tip = $(''+ this.options.value+'');
    
            }
    
            // now we append it to all the handles
            this.element.find('.ui-slider-handle').each( function(k,v) {
              $(v).append($tip[k]);
            })
    
            // if this slider also has numbers, we'll make those into tips, too; by cloning and changing class.
            this.element.find('.ui-slider-number').each(function(k,v) {
              var $e = $(v).clone().removeClass('ui-slider-number').addClass('ui-slider-tip-number');
              $e.insertAfter($(v));
            });
    
            // when slider changes, update handle tip value.
            this.element.on('slidechange slide', function(e,ui) {
              $(ui.handle).find('.ui-slider-tip').text( ui.value );
            });
    
                }
    
    
            };
    
            $.extend(true, $['ui']['slider'].prototype, extensionMethods);
    
    
        })(jQuery);
    
    
    
    
    
    /* ------------------------- */
    /* demo stuff */
    
    $(document).ready(function() {
      $('.slider, .slider2').slider({min:0,max:points,animate:true, value:3});
      $('.slider3').slider({min:0,max:points,animate:true,range:true, values:[2,18]});
      $('.slider').slider('pips');
      $('.slider2').slider('pips', {rest:'number'});
      $('.slider3').slider('pips', {first:'pip', last: 'pip'});
    
      $('.slider4').slider({min:0,max:points,animate:true,value:4});
      $('.slider6').slider({min:0,max:points,animate:true,range: true,values:[3,6] });
    
      $('.slider4').slider('pips');
      $('.slider4, .slider6').slider('float');
    });
    

    View Code

    图片 16

    在线演示        源码下载

    CSS3 3D发光切换按钮 模拟效果很逼真

    这款CSS3 3D开关切换按钮效果还是很不错的。

    核心CSS代码:

    图片 17图片 18

    .switch input {    top: 0;     right: 0;     bottom: 0;     left: 0;    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";    filter: alpha(opacity=0);    -moz-opacity: 0;    opacity: 0;    z-index: 100;    position: absolute;    width: 100%;    height: 100%;    cursor: pointer;  }    .switch {      width: 180px;      height: 55px;      position: relative;      margin: 100px auto;  }    .switch label {      display: block;      width: 80%;      height: 100%;      position: relative;      background: #1F2736; /*#121823*/      background: linear-gradient(#121823, #161d2b);      border-radius: 30px 30px 30px 30px;      box-shadow:          inset 0 3px 8px 1px rgba(0,0,0,0.5),          inset 0 1px 0 rgba(0,0,0,0.5),          0 1px 0 rgba(255,255,255,0.2);          -webkit-transition: all .5s ease;  transition: all .5s ease;    }    .switch input ~ label i {      display: block;      height: 51px;      width: 51px;      position: absolute;      left: 2px;      top: 2px;      z-index: 2;      border-radius: inherit;      background: #283446; /* Fallback */      background: linear-gradient(#36455b, #283446);      box-shadow:          inset 0 1px 0 rgba(255,255,255,0.2),          0 0 8px rgba(0,0,0,0.3),          0 12px 12px rgba(0,0,0,0.4);      -webkit-transition: all .5s ease;  transition: all .5s ease;  }      .switch label + span {      content: "";      display: inline-block;      position: absolute;      right: 0px;      top: 17px;      width: 18px;      height: 18px;      border-radius: 10px;      background: #283446;   background: gradient-gradient(#36455b, #283446);  box-shadow:            inset 0 1px 0 rgba(0,0,0,0.2),            0 1px 0 rgba(255,255,255,0.1),            0 0 10px rgba(185,231,253,0),    inset 0 0 8px rgba(0,0,0,0.9),    inset 0 -2px 5px rgba(0,0,0,0.3),    inset 0 -5px 5px rgba(0,0,0,0.5);       -webkit-transition: all .5s ease;      transition: all .5s ease;      z-index: 2;  }     /* Toggle */  .switch input:checked ~ label + span {       content: "";      display: inline-block;      position: absolute;      width: 18px;      height: 18px;      border-radius: 10px;      -webkit-transition: all .5s ease;      transition: all .5s ease;      z-index: 2;      background: #b9f3fe;   background: gradient-gradient(#ffffff, #77a1b9);  box-shadow:                    inset 0 1px 0 rgba(0,0,0,0.1),            0 1px 0 rgba(255,255,255,0.1),            0 0 10px rgba(100,231,253,1),            inset 0 0 8px rgba( 61,157,247,0.8),    inset 0 -2px 5px rgba(185,231,253,0.3),    inset 0 -3px 8px rgba(185,231,253,0.5);     }    .switch input:checked ~ label i {      left: auto;      left: 63%;      box-shadow:          inset 0 1px 0 rgba(255,255,255,0.2),          0 0 8px rgba(0,0,0,0.3),          0 8px 8px rgba(0,0,0,0.3),          inset -1px 0 1px #b9f3fe;        -webkit-transition: all .5s ease;  transition: all .5s ease;  }
    

    View Code

    图片 19

    在线演示        源码下载

    JavaScript代码

    // bind to window onload handler
    window.addEventListener('load', onloadHandler, false);
    
    /**
     * Window onload handler
     */
    function onloadHandler()
    {
       var canvas = document.getElementById('canvas');
       canvas.width = window.innerWidth;
       canvas.height = window.innerHeight;
       var k3dmain = new K3D.Controller(canvas, true);
    
       // generate 3D objects
    
       var obj1 = new K3D.K3DObject();
       with (obj1)
       {
          drawmode = "solid";
          shademode = "lightsource";
          sortmode = "unsorted";
          addphi = -0.5;
          abouty = -90;
          perslevel = 1000;
          init(
             [{x:-80,y:180,z:0},{x:0,y:180,z:-80},{x:0,y:0,z:-80},{x:-80,y:20,z:0},{x:-50,y:150,z:-30},{x:0,y:150,z:-80},{x:0,y:130,z:-80},{x:-30,y:130,z:-50},{x:-28,y:110,z:-52},{x:0,y:110,z:-80},{x:0,y:90,z:-80},{x:-45,y:90,z:-35},{x:-44,y:80,z:-36},{x:-25,y:80,z:-55},{x:-22,y:66,z:-58},{x:0,y:60,z:-80},{x:0,y:40,z:-80},{x:-40,y:50,z:-40}],
             [],
             [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[235,235,235],vertices:[4,5,6,7,8,9,10,11,4]},{color:[235,235,235],vertices:[12,13,14,15,16,17,12]}]
          );
       }
       k3dmain.addK3DObject(obj1);
    
       var obj2 = new K3D.K3DObject();
       with (obj2)
       {
          drawmode = "solid";
          shademode = "lightsource";
          sortmode = "unsorted";
          addphi = -0.5;
          abouty = -90;
          perslevel = 1000;
          init(
             [{x:0,y:180,z:-80},{x:80,y:180,z:0},{x:80,y:20,z:0},{x:0,y:0,z:-80},{x:0,y:165,z:-80},{x:68,y:165,z:-12},{x:55,y:35,z:-25},{x:0,y:20,z:-80},{x:0,y:150,z:-80},{x:50,y:150,z:-30},{x:47,y:130,z:-33},{x:0,y:130,z:-80},{x:0,y:110,z:-80},{x:45,y:110,z:-35},{x:40,y:50,z:-40},{x:0,y:40,z:-80},{x:0,y:60,z:-80},{x:20,y:66,z:-60},{x:23,y:90,z:-57},{x:0,y:90,z:-80}],
             [],
             [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[240,101,41],vertices:[4,5,6,7,4]},{color:[235,235,235],vertices:[8,9,10,11,8]},{color:[235,235,235],vertices:[12,13,14,15,16,17,18,19,12]}]
          );
       }
       k3dmain.addK3DObject(obj2);
    
       var obj3 = new K3D.K3DObject();
       with (obj3)
       {
          drawmode = "solid";
          shademode = "lightsource";
          sortmode = "unsorted";
          addphi = -0.5;
          abouty = -90;
          perslevel = 1000;
          init(
             [{x:80,y:180,z:0},{x:0,y:180,z:80},{x:0,y:0,z:80},{x:80,y:20,z:0},{x:50,y:150,z:30},{x:0,y:150,z:80},{x:0,y:130,z:80},{x:30,y:130,z:50},{x:28,y:110,z:52},{x:0,y:110,z:80},{x:0,y:90,z:80},{x:45,y:90,z:35},{x:44,y:80,z:36},{x:25,y:80,z:55},{x:22,y:66,z:58},{x:0,y:60,z:80},{x:0,y:40,z:80},{x:40,y:50,z:40}],
             [],
             [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[235,235,235],vertices:[4,5,6,7,8,9,10,11,4]},{color:[235,235,235],vertices:[12,13,14,15,16,17,12]}]
          );
       }
       k3dmain.addK3DObject(obj3);
    
       var obj4 = new K3D.K3DObject();
       with (obj4)
       {
          drawmode = "solid";
          shademode = "lightsource";
          sortmode = "unsorted";
          addphi = -0.5;
          abouty = -90;
          perslevel = 1000;
          init(
             [{x:0,y:180,z:80},{x:-80,y:180,z:0},{x:-80,y:20,z:0},{x:0,y:0,z:80},{x:0,y:165,z:80},{x:-68,y:165,z:12},{x:-55,y:35,z:25},{x:0,y:20,z:80},{x:0,y:150,z:80},{x:-50,y:150,z:30},{x:-47,y:130,z:33},{x:0,y:130,z:80},{x:0,y:110,z:80},{x:-45,y:110,z:35},{x:-40,y:50,z:40},{x:0,y:40,z:80},{x:0,y:60,z:80},{x:-20,y:66,z:60},{x:-23,y:90,z:57},{x:0,y:90,z:80}],
             [],
             [{color:[227,76,38],vertices:[0,1,2,3,0]},{color:[240,101,41],vertices:[4,5,6,7,4]},{color:[235,235,235],vertices:[8,9,10,11,8]},{color:[235,235,235],vertices:[12,13,14,15,16,17,18,19,12]}]
          );
       }
       k3dmain.addK3DObject(obj4);
    
       var objBase = new K3D.K3DObject();
       with (objBase)
       {
          drawmode = "solid";
          shademode = "lightsource";
          sortmode = "unsorted";
          addphi = -0.5;
          abouty = -90;
          perslevel = 1000;
          init(
             [{x:0,y:0,z:-80},{x:-80,y:20,z:0},{x:0,y:0,z:80},{x:80,y:20,z:0}],
             [],
             [{color:[227,76,38],vertices:[0,2,1,0]},{color:[227,76,38],vertices:[0,3,2,0]}]
          );
       }
       k3dmain.addK3DObject(objBase);
    
       var objHtml = new K3D.K3DObject();
       with (objHtml)
       {
          drawmode = "solid";
          shademode = "lightsource";
          //sortmode = "unsorted";
          color = [64,64,64];
          doublesided = true;
          addphi = -0.5;
          abouty = 100;
          scale = 0.75;
          perslevel = 1000;
          init(
             [{x:-80,y:40,z:0},{x:-70,y:40,z:0},{x:-70,y:30,z:0},{x:-60,y:30,z:0},{x:-60,y:40,z:0},{x:-50,y:40,z:0},{x:-50,y:10,z:0},{x:-60,y:10,z:0},{x:-60,y:20,z:0},{x:-70,y:20,z:0},{x:-70,y:10,z:0},{x:-80,y:10,z:0},{x:-40,y:40,z:0},{x:-10,y:40,z:0},{x:-10,y:30,z:0},{x:-20,y:30,z:0},{x:-20,y:10,z:0},{x:-30,y:10,z:0},{x:-30,y:30,z:0},{x:-40,y:30,z:0},{x:0,y:40,z:0},{x:10,y:40,z:0},{x:20,y:30,z:0},{x:30,y:40,z:0},{x:40,y:40,z:0},{x:40,y:10,z:0},{x:30,y:10,z:0},{x:30,y:30,z:0},{x:20,y:20,z:0},{x:10,y:30,z:0},{x:10,y:10,z:0},{x:0,y:10,z:0},{x:50,y:40,z:0},{x:60,y:40,z:0},{x:60,y:20,z:0},{x:80,y:20,z:0},{x:80,y:10,z:0},{x:50,y:10,z:0}],
             [],
             [{vertices:[0,1,2,3,4,5,6,7,8,9,10,11,0]},{vertices:[12,13,14,15,16,17,18,19,12]},{vertices:[20,21,22,23,24,25,26,27,28,29,30,31,20]},{vertices:[32,33,34,35,36,37,32]}]
          );
       }
       k3dmain.addK3DObject(objHtml);
    
       // add render loop callback
       var ctx = canvas.getContext('2d');
       var rotationOffset = 0;
       var len = (canvas.height > canvas.width ? canvas.height : canvas.width) * 0.7;
       k3dmain.clearBackground = false;
       k3dmain.callback = function()
       {
          // manually clear bg - as we want to render some extra goodies
          ctx.clearRect(0, 0, canvas.width, canvas.height);
    
          // draw bg effect before K3D does its 3D rendering
          ctx.save();
          ctx.translate(canvas.width/2, canvas.height/2);
          ctx.rotate(rotationOffset);
    
          // first fill pass - outer rays
          var RAYCOUNT = 24;
          ctx.fillStyle = "#eee";
          ctx.beginPath();
          for (var i=0; i<RAYCOUNT; i++)
          {
             // rotate context
             ctx.rotate(TWOPI / RAYCOUNT);
             ctx.moveTo(0, 0);
             ctx.lineTo(-20, len);
             ctx.lineTo(20, len);
          }
          ctx.closePath();
          ctx.fill();
          // second fill pass - inner rays
          ctx.fillStyle = "#fff";
          ctx.beginPath();
          for (var i=0; i<RAYCOUNT; i++)
          {
             // rotate context
             ctx.rotate(TWOPI / RAYCOUNT);
             ctx.moveTo(0, 0);
             ctx.lineTo(-15, len);
             ctx.lineTo(15, len);
          }
          ctx.closePath();
          ctx.fill();
          ctx.restore();
          rotationOffset += 0.005;
    
          // apply user interaction to rotation
          for (var i=0, objs=k3dmain.objects; i<objs.length; i++)
          {
             objs[i].ophi += targetRotationX;
          }
    
          if (targetRotationX > -0.5) targetRotationX -= 0.05;
          else if (targetRotationX < -0.55) targetRotationX += 0.05;
          if (targetRotationX > -0.55 && targetRotationX < -0.5) targetRotationX = -0.5;
       };
    
       // start demo loop
       k3dmain.paused = true;
       setInterval(function(){k3dmain.tick()}, 1000/60);
    }
    
    // nifty drag/touch event capture code borrowed from Mr Doob http://mrdoob.com/
    var targetRotationX = 0;
    var targetRotationOnMouseDownX = 0;
    var mouseX = 0;
    var mouseXOnMouseDown = 0;
    var targetRotationY = 0;
    var targetRotationOnMouseDownY = 0;
    var mouseY = 0;
    var mouseYOnMouseDown = 0;
    
    var windowHalfX = window.innerWidth / 2;
    var windowHalfY = window.innerHeight / 2;
    
    document.addEventListener('mousedown', onDocumentMouseDown, false);
    document.addEventListener('touchstart', onDocumentTouchStart, false);
    document.addEventListener('touchmove', onDocumentTouchMove, false);
    
    function onDocumentMouseDown( event ) {
    
        event.preventDefault();
    
        document.addEventListener('mousemove', onDocumentMouseMove, false);
        document.addEventListener('mouseup', onDocumentMouseUp, false);
        document.addEventListener('mouseout', onDocumentMouseOut, false);
    
        mouseXOnMouseDown = event.clientX - windowHalfX;
        targetRotationOnMouseDownX = targetRotationX;
        mouseYOnMouseDown = event.clientY - windowHalfY;
        targetRotationOnMouseDownY = targetRotationY;
    }
    
    function onDocumentMouseMove( event )
    {
        mouseX = event.clientX - windowHalfX;
        targetRotationX = targetRotationOnMouseDownX + (mouseX - mouseXOnMouseDown) * 0.02;
        mouseY = event.clientY - windowHalfY;
        targetRotationY = targetRotationOnMouseDownY + (mouseY - mouseYOnMouseDown) * 0.02;
    }
    
    function onDocumentMouseUp( event )
    {
        document.removeEventListener('mousemove', onDocumentMouseMove, false);
        document.removeEventListener('mouseup', onDocumentMouseUp, false);
        document.removeEventListener('mouseout', onDocumentMouseOut, false);
    }
    
    function onDocumentMouseOut( event )
    {
        document.removeEventListener('mousemove', onDocumentMouseMove, false);
        document.removeEventListener('mouseup', onDocumentMouseUp, false);
        document.removeEventListener('mouseout', onDocumentMouseOut, false);
    }
    
    function onDocumentTouchStart( event )
    {
        if (event.touches.length == 1)
        {
            event.preventDefault();
    
            mouseXOnMouseDown = event.touches[0].pageX - windowHalfX;
            targetRotationOnMouseDownX = targetRotationX;
            mouseYOnMouseDown = event.touches[0].pageY - windowHalfY;
            targetRotationOnMouseDownY = targetRotationY;
        }
    }
    
    function onDocumentTouchMove( event )
    {
        if (event.touches.length == 1)
        {
            event.preventDefault();
    
            mouseX = event.touches[0].pageX - windowHalfX;
            targetRotationX = targetRotationOnMouseDownX + (mouseX - mouseXOnMouseDown) * 0.05;
            mouseY = event.touches[0].pageY - windowHalfY;
            targetRotationY = targetRotationOnMouseDownY + (mouseX - mouseYOnMouseDown) * 0.05;
        }
    }
    

    在线演示源码下载

    CSS3个人资料表单 分两步骤表单

    一款基于CSS3的表单应用,可以分步骤填写。

    核心jQuery代码:

    图片 20图片 21

    jQuery(document).ready(function(){
      function doStep(){
        // Next Button
        $('a.next-step').click(function(event){
          event.preventDefault();
          // Part 1
          if($('.alpha').hasClass("in")) {
            $('.alpha').removeClass("in");
          }
          $('.alpha').addClass("out");
          // Part 2
          if($('.beta').hasClass("out")) {
            $('.beta').removeClass("out");
          }
          $('.beta').addClass("in");
        });
    
        // Previous Button
        $('a.prev-step').click(function(event){
          event.preventDefault(); 
          $('.alpha').removeClass("out").addClass("in");
          $('.beta').removeClass("in").addClass("out");
        });
    
        // Submit & Complete
        $('.submit').click(function(event){
          event.preventDefault();
          // Part 1
          if($('.beta').hasClass("in")) {
            $('.beta').removeClass("in");
          }
          $('.beta').addClass("out");
          // Part 2
          if($('.charlie').hasClass("out")) {
            $('.charlie').removeClass("out");
          }
          $('.charlie').addClass("in");
        });
      }
      // Active Functions
      doStep();
    });
    

    View Code

    核心CSS代码:

    图片 22图片 23

    form {
      float: left;
      display: block;
      width: 100%;
      position: relative;
    }
    form fieldset {
      float: left;
      position: absolute;
      width: 100%;
      padding: 20px;
      border: none;
      border-radius: 5px;
      box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
      background: #fff;
      background: whitesmoke;
      background: -webkit-linear-gradient(0deg, #eeeeee 0%, whitesmoke 100%);
      background: -moz-linear-gradient(0deg, #eeeeee 0%, whitesmoke 100%);
      background: -o-linear-gradient(0deg, #eeeeee 0%, whitesmoke 100%);
      background: linear-gradient(0deg, #eeeeee 0%, whitesmoke 100%);
      /* W3C */
    }
    form fieldset legend {
      float: left;
      display: block;
      width: 100%;
      position: relative;
      border-bottom: 1px solid #dfdfdf;
      top: 0;
      left: 0;
      clear: both;
      margin-bottom: 20px;
      padding-bottom: 10px;
      line-height: 30px;
      color: #444;
      text-shadow: 0 1px 0 #fff;
    }
    form fieldset.beta, form fieldset.charlie {
      display: none;
    }
    form fieldset .frow {
      float: left;
      display: block;
      width: 100%;
      margin-bottom: 10px;
    }
    form fieldset .frow:last-child {
      margin-bottom: 0px;
    }
    form fieldset input {
      float: left;
      width: 100%;
      padding: 12px 6px;
      font-size: 14px;
      font-weight: 400;
      font-family: "Open Sans", sans-serif;
      border: 1px solid #dedede;
      border-radius: 5px;
      box-shadow: 0 0 0 transparent, inset 0 0 5px #eee;
      -webkit-transition: all 0.2s ease-in-out;
    }
    form fieldset input::-webkit-input-placeholder {
      color: #ccc;
      opacity: 1;
      -webkit-transition: opacity 0.2s ease-in-out;
    }
    form fieldset input:focus {
      outline: none;
      border: 1px solid #27c1bf;
      box-shadow: 0 0 10px #27c1bf;
      -webkit-transition: all 0.2s ease-in-out;
    }
    form fieldset input:focus::-webkit-input-placeholder {
      opacity: 0.5;
    }
    form fieldset a.next-step,
    form fieldset a.prev-step,
    form fieldset input[type="submit"] {
      display: block;
      width: 100%;
      height: 50px;
      padding: 0;
      background: #31dddb;
      line-height: 50px;
      text-align: center;
      text-decoration: none;
      text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
      font-size: 1.2em;
      font-family: "Helvetica Neue", sans-serif;
      font-weight: 400;
      color: #fff;
      border: 1px solid #27c1bf;
      border-radius: 4px;
      box-shadow: 0 0 0 transparent;
    }
    form fieldset a.prev-step {
      background: #4a76a8;
      border: 1px solid #1d5b90;
    }
    
    .out, .alpha.out, .beta.out {
      z-index: 0;
      opacity: 1;
      display: block;
      -webkit-animation: out 0.75s ease forwards;
      -moz-animation: out 0.75s ease forwards;
      -o-animation: out 0.75s ease forwards;
      animation: out 0.75s ease forwards;
    }
    
    @-webkit-keyframes out {
      0% {
        -webkit-transform: scale(1);
        opacity: 1;
      }
    
      25% {
        -webkit-transform: scale(1.05);
      }
    
      99% {
        -webkit-transform: scale(0.8);
      }
    
      100% {
        opacity: 0;
        display: none;
      }
    }
    @-moz-keyframes out {
      0% {
        -moz-transform: scale(1);
        opacity: 1;
      }
    
      25% {
        -moz-transform: scale(1.05);
      }
    
      99% {
        -moz-transform: scale(0.8);
      }
    
      100% {
        opacity: 0;
        display: none;
      }
    }
    @-o-keyframes out {
      0% {
        -o-transform: scale(1);
        opacity: 1;
      }
    
      25% {
        -o-transform: scale(1.05);
      }
    
      99% {
        -o-transform: scale(0.8);
      }
    
      100% {
        opacity: 0;
        display: none;
      }
    }
    @keyframes out {
      0% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
      }
    
      25% {
        -webkit-transform: scale(1.05);
        transform: scale(1.05);
      }
    
      99% {
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
      }
    
      100% {
        opacity: 0;
        display: none;
      }
    }
    .in, .beta.in {
      z-index: 30;
      display: block;
      opacity: 0;
      -webkit-animation: in 0.75s ease forwards 0.25s;
      -moz-animation: in 0.75s ease forwards 0.25s;
      -o-animation: in 0.75s ease forwards 0.25s;
      animation: in 0.75s ease forwards 0.25s;
    }
    
    @-webkit-keyframes in {
      0% {
        -webkit-transform: translate3d(150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @-moz-keyframes in {
      0% {
        -moz-transform: translate3d(150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -moz-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @-o-keyframes in {
      0% {
        -o-transform: translate3d(150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -o-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @keyframes in {
      0% {
        -webkit-transform: translate3d(150px, 0, 0);
        -moz-transform: translate3d(150px, 0, 0);
        -o-transform: translate3d(150px, 0, 0);
        transform: translate3d(150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0px, 0, 0);
        -moz-transform: translate3d(0px, 0, 0);
        -o-transform: translate3d(0px, 0, 0);
        transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    .alpha.in {
      z-index: 30;
      display: block;
      opacity: 0;
      -webkit-animation: in-prev 0.75s ease forwards 0.25s;
      -moz-animation: in-prev 0.75s ease forwards 0.25s;
      -o-animation: in-prev 0.75s ease forwards 0.25s;
      animation: in-prev 0.75s ease forwards 0.25s;
    }
    
    @-webkit-keyframes in-prev {
      0% {
        -webkit-transform: translate3d(-150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @-moz-keyframes in-prev {
      0% {
        -moz-transform: translate3d(-150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -moz-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @-o-keyframes in-prev {
      0% {
        -o-transform: translate3d(-150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -o-transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    @keyframes in-prev {
      0% {
        -webkit-transform: translate3d(-150px, 0, 0);
        -moz-transform: translate3d(-150px, 0, 0);
        -o-transform: translate3d(-150px, 0, 0);
        transform: translate3d(-150px, 0, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0px, 0, 0);
        -moz-transform: translate3d(0px, 0, 0);
        -o-transform: translate3d(0px, 0, 0);
        transform: translate3d(0px, 0, 0);
        opacity: 1;
      }
    }
    .charlie.in {
      z-index: 30;
      display: block;
      opacity: 0;
      -webkit-animation: in-charlie 0.75s ease-out forwards 0.25s;
      -moz-animation: in-charlie 0.75s ease-out forwards 0.25s;
      -o-animation: in-charlie 0.75s ease-out forwards 0.25s;
      animation: in-charlie 0.75s ease-out forwards 0.25s;
    }
    
    @-webkit-keyframes in-charlie {
      0% {
        -webkit-transform: translate3d(0, 150px, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0, 0, 0);
        opacity: 1;
      }
    }
    @-moz-keyframes in-charlie {
      0% {
        -moz-transform: translate3d(0, 150px, 0);
        opacity: 0;
      }
    
      100% {
        -moz-transform: translate3d(0, 0, 0);
        opacity: 1;
      }
    }
    @-o-keyframes in-charlie {
      0% {
        -o-transform: translate3d(0, 150px, 0);
        opacity: 0;
      }
    
      100% {
        -o-transform: translate3d(0, 0, 0);
        opacity: 1;
      }
    }
    @keyframes in-charlie {
      0% {
        -webkit-transform: translate3d(0, 150px, 0);
        -moz-transform: translate3d(0, 150px, 0);
        -o-transform: translate3d(0, 150px, 0);
        transform: translate3d(0, 150px, 0);
        opacity: 0;
      }
    
      100% {
        -webkit-transform: translate3d(0, 0, 0);
        -moz-transform: translate3d(0, 0, 0);
        -o-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        opacity: 1;
      }
    }
    

    View Code

    图片 24

    在线演示        源码下载

    CSS3/SVG质感背景小图标 镂空效果图标按钮

    图片 25

    在线演示        源码下载

    HTML5/CSS3自定义浮动Select 超炫下拉菜单动画

    一款很有特色的自定义Select下拉框,也是基于HTML5技术的,因为需要一些浮动动画。

    核心jQuery代码:

    图片 26图片 27

    $(document).ready(function(){
    
      $(".dropdown").click(function(){
        $(".menu").toggleClass("showMenu");
          $(".menu > li").click(function(){
            $(".dropdown > p").html($(this).html());
              $(".menu").removeClass("showMenu");
          });
      });
    
    });
    

    View Code

    图片 28

    在线演示        源码下载

    HTML5/CSS3弹出提示框 内置功能按钮

    这款Html5 教程非常实用,是一款带有动画特效的弹出提示框,样式也很不错。

    核心jQuery代码:

    图片 29图片 30

    function closeMessage(el) {    el.addClass('is-hidden');  }    $('.js-messageClose').on('click', function(e) {    closeMessage($(this).closest('.Message'));  });    $('#js-helpMe').on('click', function(e) {    alert('Help you we will, young padawan');    closeMessage($(this).closest('.Message'));  });    $('#js-authMe').on('click', function(e) {    alert('Okelidokeli, requesting data transfer.');    closeMessage($(this).closest('.Message'));  });    $('#js-showMe').on('click', function(e) {    alert("You're off to our help section. See you later!");    closeMessage($(this).closest('.Message'));  });    $(document).ready(function() {    setTimeout(function() {      closeMessage($('#js-timer'));    }, 5000);  });
    

    View Code

    图片 31

    在线演示        源码下载

    HTML5/CSS3书本翻页3D动画

    和第一个应用类似,这也是HTML5 3D动画,是一本3D的电子书,可以翻页。

    核心CSS代码(略长):

    图片 32图片 33

    /*
        1. container
    */
    
    .book {
        position: relative;
        width: 160px; 
        height: 220px;
        -webkit-perspective: 1000px;
        -moz-perspective: 1000px;
        perspective: 1000px;
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    /*
        2. background & color
    */
    
    /* HARDCOVER FRONT */
    .hardcover_front li:first-child {
        background-color: #eee;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* reverse */
    .hardcover_front li:last-child {
        background: #fffbec;
    }
    
    /* HARDCOVER BACK */
    .hardcover_back li:first-child {
        background: #fffbec;
    }
    
    /* reverse */
    .hardcover_back li:last-child {
        background: #fffbec;
    }
    
    .book_spine li:first-child {
        background: #eee;
    }
    .book_spine li:last-child {
        background: #333;
    }
    
    /* thickness of cover */
    
    .hardcover_front li:first-child:after,
    .hardcover_front li:first-child:before,
    .hardcover_front li:last-child:after,
    .hardcover_front li:last-child:before,
    .hardcover_back li:first-child:after,
    .hardcover_back li:first-child:before,
    .hardcover_back li:last-child:after,
    .hardcover_back li:last-child:before,
    .book_spine li:first-child:after,
    .book_spine li:first-child:before,
    .book_spine li:last-child:after,
    .book_spine li:last-child:before {
        background: #999;
    }
    
    /* page */
    
    .page > li {
        background: -webkit-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
        background: -moz-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
        background: -ms-linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
        background: linear-gradient(left, #e1ddd8 0%, #fffbf6 100%);
        box-shadow: inset 0px -1px 2px rgba(50, 50, 50, 0.1), inset -1px 0px 1px rgba(150, 150, 150, 0.2);
        border-radius: 0px 5px 5px 0px;
    }
    
    /*
        3. opening cover, back cover and pages
    */
    
    .hardcover_front {
        -webkit-transform: rotateY(-34deg) translateZ(8px);
        -moz-transform: rotateY(-34deg) translateZ(8px);
        transform: rotateY(-34deg) translateZ(8px);
        z-index: 100;
    }
    
    .hardcover_back {
        -webkit-transform: rotateY(-15deg) translateZ(-8px);
        -moz-transform: rotateY(-15deg) translateZ(-8px);
        transform: rotateY(-15deg) translateZ(-8px);
    }
    
    .page li:nth-child(1) {
        -webkit-transform: rotateY(-28deg);
        -moz-transform: rotateY(-28deg);
        transform: rotateY(-28deg);
    }
    
    .page li:nth-child(2) {
        -webkit-transform: rotateY(-30deg);
        -moz-transform: rotateY(-30deg);
        transform: rotateY(-30deg);
    }
    
    .page li:nth-child(3) {
        -webkit-transform: rotateY(-32deg);
        -moz-transform: rotateY(-32deg);
        transform: rotateY(-32deg);
    }
    
    .page li:nth-child(4) {
        -webkit-transform: rotateY(-34deg);
        -moz-transform: rotateY(-34deg);
        transform: rotateY(-34deg);
    }
    
    .page li:nth-child(5) {
        -webkit-transform: rotateY(-36deg);
        -moz-transform: rotateY(-36deg);
        transform: rotateY(-36deg);
    }
    
    /*
        4. position, transform & transition
    */
    
    .hardcover_front,
    .hardcover_back,
    .book_spine,
    .hardcover_front li,
    .hardcover_back li,
    .book_spine li {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    .hardcover_front,
    .hardcover_back {
        -webkit-transform-origin: 0% 100%;
        -moz-transform-origin: 0% 100%;
        transform-origin: 0% 100%;
    }
    
    .hardcover_front {
        -webkit-transition: all 0.8s ease, z-index 0.6s;
        -moz-transition: all 0.8s ease, z-index 0.6s;
        transition: all 0.8s ease, z-index 0.6s;
    }
    
    /* HARDCOVER front */
    .hardcover_front li:first-child {
        cursor: default;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
        -webkit-transform: translateZ(2px);
        -moz-transform: translateZ(2px);
        transform: translateZ(2px);
    }
    
    .hardcover_front li:last-child {
        -webkit-transform: rotateY(180deg) translateZ(2px);
        -moz-transform: rotateY(180deg) translateZ(2px);
        transform: rotateY(180deg) translateZ(2px);
    }
    
    /* HARDCOVER back */
    .hardcover_back li:first-child {
        -webkit-transform: translateZ(2px);
        -moz-transform: translateZ(2px);
        transform: translateZ(2px);
    }
    
    .hardcover_back li:last-child {
        -webkit-transform: translateZ(-2px);
        -moz-transform: translateZ(-2px);
        transform: translateZ(-2px);
    }
    
    /* thickness of cover */
    .hardcover_front li:first-child:after,
    .hardcover_front li:first-child:before,
    .hardcover_front li:last-child:after,
    .hardcover_front li:last-child:before,
    .hardcover_back li:first-child:after,
    .hardcover_back li:first-child:before,
    .hardcover_back li:last-child:after,
    .hardcover_back li:last-child:before,
    .book_spine li:first-child:after,
    .book_spine li:first-child:before,
    .book_spine li:last-child:after,
    .book_spine li:last-child:before {
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* HARDCOVER front */
    .hardcover_front li:first-child:after,
    .hardcover_front li:first-child:before {
        width: 4px;
        height: 100%;
    }
    
    .hardcover_front li:first-child:after {
        -webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        -moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        transform: rotateY(90deg) translateZ(-2px) translateX(2px);
    }
    
    .hardcover_front li:first-child:before {
        -webkit-transform: rotateY(90deg) translateZ(158px) translateX(2px);
        -moz-transform: rotateY(90deg) translateZ(158px) translateX(2px);
        transform: rotateY(90deg) translateZ(158px) translateX(2px);
    }
    
    .hardcover_front li:last-child:after,
    .hardcover_front li:last-child:before {
        width: 4px;
        height: 160px;
    }
    
    .hardcover_front li:last-child:after {
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(-2px) translateY(-78px);
    }
    .hardcover_front li:last-child:before {
        box-shadow: 0px 0px 30px 5px #333;
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(-2px) translateY(-78px);
    }
    
    /* thickness of cover */
    
    .hardcover_back li:first-child:after,
    .hardcover_back li:first-child:before {
        width: 4px;
        height: 100%;
    }
    
    .hardcover_back li:first-child:after {
        -webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        -moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        transform: rotateY(90deg) translateZ(-2px) translateX(2px);
    }
    .hardcover_back li:first-child:before {
        -webkit-transform: rotateY(90deg) translateZ(158px) translateX(2px);
        -moz-transform: rotateY(90deg) translateZ(158px) translateX(2px);
        transform: rotateY(90deg) translateZ(158px) translateX(2px);
    }
    
    .hardcover_back li:last-child:after,
    .hardcover_back li:last-child:before {
        width: 4px;
        height: 160px;
    }
    
    .hardcover_back li:last-child:after {
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(80px) translateX(2px) translateY(-78px);
    }
    
    .hardcover_back li:last-child:before {
        box-shadow: 10px -1px 80px 20px #666;
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(-140px) translateX(2px) translateY(-78px);
    }
    
    /* BOOK SPINE */
    .book_spine {
        -webkit-transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
        -moz-transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
        transform: rotateY(60deg) translateX(-5px) translateZ(-12px);
        width: 16px;
        z-index: 0;
    }
    
    .book_spine li:first-child {
        -webkit-transform: translateZ(2px);
        -moz-transform: translateZ(2px);
        transform: translateZ(2px);
    }
    
    .book_spine li:last-child {
        -webkit-transform: translateZ(-2px);
        -moz-transform: translateZ(-2px);
        transform: translateZ(-2px);
    }
    
    /* thickness of book spine */
    .book_spine li:first-child:after,
    .book_spine li:first-child:before {
        width: 4px;
        height: 100%;
    }
    
    .book_spine li:first-child:after {
        -webkit-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        -moz-transform: rotateY(90deg) translateZ(-2px) translateX(2px);
        transform: rotateY(90deg) translateZ(-2px) translateX(2px);
    }
    
    .book_spine li:first-child:before {
        -webkit-transform: rotateY(-90deg) translateZ(-12px);
        -moz-transform: rotateY(-90deg) translateZ(-12px);
        transform: rotateY(-90deg) translateZ(-12px);
    }
    
    .book_spine li:last-child:after,
    .book_spine li:last-child:before {
        width: 4px;
        height: 16px;
    }
    
    .book_spine li:last-child:after {
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(8px) translateX(2px) translateY(-6px);
    }
    
    .book_spine li:last-child:before {
        box-shadow: 5px -1px 100px 40px rgba(0, 0, 0, 0.2);
        -webkit-transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
        -moz-transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
        transform: rotateX(90deg) rotateZ(90deg) translateZ(-210px) translateX(2px) translateY(-6px);
    }
    
    .page,
    .page > li {
        position: absolute;
        top: 0;
        left: 0;
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    .page {
        width: 100%;
        height: 98%;
        top: 1%;
        left: 3%;
        z-index: 10;
    }
    
    .page > li {
        width: 100%;
        height: 100%;
        -webkit-transform-origin: left center;
        -moz-transform-origin: left center;
        transform-origin: left center;
        -webkit-transition-property: transform;
        -moz-transition-property: transform;
        transition-property: transform;
        -webkit-transition-timing-function: ease;
        -moz-transition-timing-function: ease;
        transition-timing-function: ease;
    }
    
    .page > li:nth-child(1) {
        -webkit-transition-duration: 0.6s;
        -moz-transition-duration: 0.6s;
        transition-duration: 0.6s;
    }
    
    .page > li:nth-child(2) {
        -webkit-transition-duration: 0.6s;
        -moz-transition-duration: 0.6s;
        transition-duration: 0.6s;
    }
    
    .page > li:nth-child(3) {
        -webkit-transition-duration: 0.4s;
        -moz-transition-duration: 0.4s;
        transition-duration: 0.4s;
    }
    
    .page > li:nth-child(4) {
        -webkit-transition-duration: 0.5s;
        -moz-transition-duration: 0.5s;
        transition-duration: 0.5s;
    }
    
    .page > li:nth-child(5) {
        -webkit-transition-duration: 0.6s;
        -moz-transition-duration: 0.6s;
        transition-duration: 0.6s;
    }
    
    /*
        5. events
    */
    
    .book:hover > .hardcover_front {
        -webkit-transform: rotateY(-145deg) translateZ(0);
        -moz-transform: rotateY(-145deg) translateZ(0);
        transform: rotateY(-145deg) translateZ(0);
        z-index: 0;
    }
    
    .book:hover > .page li:nth-child(1) {
        -webkit-transform: rotateY(-30deg);
        -moz-transform: rotateY(-30deg);
        transform: rotateY(-30deg);
        -webkit-transition-duration: 1.5s;
        -moz-transition-duration: 1.5s;
        transition-duration: 1.5s;
    }
    
    .book:hover > .page li:nth-child(2) {
        -webkit-transform: rotateY(-35deg);
        -moz-transform: rotateY(-35deg);
        transform: rotateY(-35deg);
        -webkit-transition-duration: 1.8s;
        -moz-transition-duration: 1.8s;
        transition-duration: 1.8s;
    }
    
    .book:hover > .page li:nth-child(3) {
        -webkit-transform: rotateY(-118deg);
        -moz-transform: rotateY(-118deg);
        transform: rotateY(-118deg);
        -webkit-transition-duration: 1.6s;
        -moz-transition-duration: 1.6s;
        transition-duration: 1.6s;
    }
    
    .book:hover > .page li:nth-child(4) {
        -webkit-transform: rotateY(-130deg);
        -moz-transform: rotateY(-130deg);
        transform: rotateY(-130deg);
        -webkit-transition-duration: 1.4s;
        -moz-transition-duration: 1.4s;
        transition-duration: 1.4s;
    }
    
    .book:hover > .page li:nth-child(5) {
        -webkit-transform: rotateY(-140deg);
        -moz-transform: rotateY(-140deg);
        transform: rotateY(-140deg);
        -webkit-transition-duration: 1.2s;
        -moz-transition-duration: 1.2s;
        transition-duration: 1.2s;
    }
    
    /*
        6. Bonus
    */
    
    /* cover CSS */
    
    .coverDesign {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        overflow: hidden;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .coverDesign::after {
        background-image: -webkit-linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
        background-image: -moz-linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
        background-image: linear-gradient( -135deg, rgba(255, 255, 255, 0.45) 0%, transparent 100%);
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
    }
    
    .coverDesign h1 {
        color: #fff;
        font-size: 2.2em;
        letter-spacing: 0.05em;
        text-align: center;
        margin: 54% 0 0 0;
        text-shadow: -1px -1px 0 rgba(0,0,0,0.1);
    }
    
    .coverDesign p {
        color: #f8f8f8;
        font-size: 1em;
        text-align: center;
        text-shadow: -1px -1px 0 rgba(0,0,0,0.1);
    }
    
    .yellow {
        background-color: #f1c40f;
        background-image: -webkit-linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
        background-image: -moz-linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
        background-image: linear-gradient(top, #f1c40f 58%, #e7ba07 0%);
    }
    
    .blue {
        background-color: #3498db;
        background-image: -webkit-linear-gradient(top, #3498db 58%, #2a90d4 0%);
        background-image: -moz-linear-gradient(top, #3498db 58%, #2a90d4 0%);
        background-image: linear-gradient(top, #3498db 58%, #2a90d4 0%);
    }
    
    .grey {
        background-color: #f8e9d1;
        background-image: -webkit-linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
        background-image: -moz-linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
        background-image: linear-gradient(top, #f8e9d1 58%, #e7d5b7 0%);
    }
    
    /* Basic ribbon */
    
    .ribbon {
        background: #c0392b;
        color: #fff;
        display: block;
        font-size: 0.7em;
        position: absolute;
        top: 11px;
        right: 1px;
        width: 40px;
        height: 20px;
        line-height: 20px;
        letter-spacing: 0.15em; 
        text-align: center;
        -webkit-transform: rotateZ(45deg) translateZ(1px);
        -moz-transform: rotateZ(45deg) translateZ(1px);
        transform: rotateZ(45deg) translateZ(1px);
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: 10;
    }
    
    .ribbon::before,
    .ribbon::after{
        position: absolute;
        top: -20px;
        width: 0;
        height: 0;
        border-bottom: 20px solid #c0392b;
        border-top: 20px solid transparent;
    }
    
    .ribbon::before{
        left: -20px;
        border-left: 20px solid transparent;
    }
    
    .ribbon::after{
        right: -20px;
        border-right: 20px solid transparent;
    }
    
    /* figcaption */
    
    figcaption {
        padding-left: 40px;
        text-align: left;
        position: absolute;
        top: 0%;
        left: 160px;
        width: 310px;
    }
    
    figcaption h1 {
        margin: 0;
    }
    
    figcaption span {
        color: #16a085;
        padding: 0.6em 0 1em 0;
        display: block;
    }
    
    figcaption p {
        color: #63707d;
        line-height: 1.3;
    }
    
    /* Media Queries */
    @media screen and (max-width: 37.8125em) {
        .align > li {
            width: 100%;
            min-height: 440px;
            height: auto;
            padding: 0;
            margin: 0 0 30px 0;
        }
    
        .book {
            margin: 0 auto;
        }
    
        figcaption {
            text-align: center;
            width: 320px;
            top: 250px;
            padding-left: 0;
            left: -80px;
            font-size: 90%;
        }
    }
    

    View Code

    图片 34

    在线演示        源码下载

    HTML5柱状图表 可合并多张图表的数据

    又是一款HTML5图表应用,外观很普通,但是其合并功能十分强大。

    图片 35

    在线演示        源码下载

    CSS3开关切换按钮 可左右横向切换

    这款开关切换按钮大家应该看到过了,类似的特效很多,实用性有待讨论,不过还是蛮漂亮的。

    核心jQuery代码:

    图片 36图片 37

    $('.track').click( function() {
        $indicator = $('.indicator');
        if( $indicator.hasClass('switch-on') ) {
            $indicator.removeClass('switch-on').addClass('switch-off');
            }
        else {
            $indicator.removeClass('switch-off').addClass('switch-on');
        }
    });
    

    View Code

    核心CSS代码:

    图片 38图片 39

    .track {
      position: relative;
      margin: 10em auto;
      /* padding: .2em; */
      background: #b7b7b7;
      width: 10em;
      height: 4em;
      border: .1em solid #575757;
      border-radius: 10em;
      box-shadow: inset 0 .5em .5em #666,
        inset 0 -.2em .5em #666;
      cursor: pointer;
    }
    
    .track:after {
      position: absolute;
      content: "";
      display: block;
      margin-top: -4.5em;
      margin-left: -.6em;
      width: 11em;
      height: 5em;
      border: .1em solid #979797;
      border-radius: 10em;
      box-shadow: inset 0 1em 1em #979797, inset 0 -1em 1em #e7e7e7, 0 .1em .2em #fff;
      z-index: -1;
    }
    
    .indicator {
      position: relative;
      background: #ddd;
      height: 100%;
      width: 40%;
      border-radius: 50%;
      border: .1em solid #666;
      box-shadow: inset 0 .5em .5em #f7f7f7,
        inset 0 -.3em .3em #666;
    }
    
    .indicator:after {
      content: "";
      display: block;
      margin: 1.2em auto;
      background: #ff3434;
      width: 1em;
      height: 1em;
      box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      border-radius: 50%;
    }
    
    .indicator.switch-on {
      -webkit-animation:           switch-on .3s;
      -moz-animation:              switch-on .3s;
      -o-animation:                switch-on .3s;
      animation:                   switch-on .3s;
      -webkit-animation-fill-mode: forwards;
      -moz-animation-fill-mode:    forwards;
      -o-animation-fill-mode:      forwards;
      animation-fill-mode:        forwards;
    }
    
    .indicator.switch-off {
      -webkit-animation:           switch-off .3s;
      -moz-animation:              switch-off .3s;
      -o-animation:                switch-off .3s;
      animation:                   switch-off .3s;
      -webkit-animation-fill-mode: forwards;
      -moz-animation-fill-mode:    forwards;
      -o-animation-fill-mode:      forwards;
      -animation-fill-mode:        forwards;
    }
    
    @-webkit-keyframes switch-on {
      0% {
        margin-left: 0;
      }
      100% {
        margin-left: 60%;
      }
    }
    @-moz-keyframes switch-on {
      0% {
        margin-left: 0;
      }
      100% {
        margin-left: 60%;
      }
    }
    @-o-keyframes switch-on {
      0% {
        margin-left: 0;
      }
      100% {
        margin-left: 60%;
      }
    }
    @keyframes switch-on {
      0% {
        margin-left: 0;
      }
      100% {
        margin-left: 60%;
      }
    }
    
    @-webkit-keyframes switch-off {
      0% {
        margin-left: 60%;
      }
      100% {
        margin-left: 0;
      }
    }
    @-moz-keyframes switch-off {
      0% {
        margin-left: 60%;
      }
      100% {
        margin-left: 0;
      }
    }
    @-o-keyframes switch-off {
      0% {
        margin-left: 60%;
      }
      100% {
        margin-left: 0;
      }
    }
    @keyframes switch-off {
      0% {
        margin-left: 60%;
      }
      100% {
        margin-left: 0;
      }
    }
    
    .indicator.switch-on:after {
      -webkit-animation:           light-on .3s;
      -moz-animation:              light-on .3s;
      -o-animation:                light-on .3s;
      animation:                   light-on .3s;
      -webkit-animation-fill-mode: forwards;
      -moz-animation-fill-mode:    forwards;
      -o-animation-fill-mode:      forwards;
      -animation-fill-mode:        forwards;
    }
    
    .indicator.switch-off:after {
      -webkit-animation:           light-off .3s;
      -moz-animation:              light-off .3s;
      -o-animation:                light-off .3s;
      animation:                   light-off .3s;
      -webkit-animation-fill-mode: forwards;
      -moz-animation-fill-mode:    forwards;
      -o-animation-fill-mode:      forwards;
      -animation-fill-mode:        forwards;
    }
    
    @-webkit-keyframes light-on {
      0% {
        background: #fa3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    
      100% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    }
    
    @-moz-keyframes light-on {
      0% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    
      100% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    }
    
    @-o-keyframes light-on {
      0% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    
      100% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    }
    
    @keyframes light-on {
      0% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    
      100% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    }
    
    @-webkit-keyframes light-off {
      0% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    
      100% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    }
    
    @-moz-keyframes light-off {
      0% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    
      100% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    }
    
    @-o-keyframes light-off {
      0% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    
      100% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    }
    
    @keyframes light-off {
      0% {
        background: #0f0;
        box-shadow: inset 0 .15em #494,
        0 .15em #afa;
      }
    
      100% {
        background: #ff3434;
        box-shadow: inset 0 .15em #499,
        0 .15em #faa;
      }
    }
    

    View Code

    图片 40

    在线演示        源码下载

    HTML5/CSS3提示框Tooltip动画

    一款基于CSS3的Tooltip工具,带有淡入淡出动画。

    核心CSS代码:

    图片 41图片 42

    .tooltip p { font-family: sans-serif;               font-size:14px;    font-weight:300;}    .tooltip { width:120px;             padding:10px;             border-radius:3px;             position:absolute;             box-shadow:1px 1px 10px 0 #ccc;             margin: -500px 0 0 -20px;             background:#fff;             -webkit-transition:margin .5s ease-in-out;            -moz-transition:margin .5s ease-in-out;}    .item:hover  {  background:#6d643b;}    .item:hover .tooltip {             margin:-145px 0 0 -20px;             -webkit-transition: margin .15s ease-in-out;    -moz-transition: margin .15s ease-in-out;}    .arrow {    position:absolute;    margin:10px 0 0 50px;      width: 0;       height: 0;       border-left: 10px solid transparent;      border-right: 10px solid transparent;      border-top: 10px solid #fff;  }
    

    View Code

    图片 43

    在线演示        源码下载

    CSS3华丽的Tab菜单 带小图标动画

    这是一款带动画效果的Tab菜单,也是基于HTML5和CSS3的,相当酷。

    核心jQuery代码:

    图片 44图片 45

    var menuItems = $('.main-navigation li');
    
    menuItems.on("click", function(event) {
    
      menuItems.removeClass("active");
    
      $(this).addClass("active");
    
      $(".main-content").css({
        "background": $(this).data("bg-color")
      });
    
      event.preventDefault();
    });
    

    View Code

    图片 46

    在线演示        源码下载

    HTML5/CSS3图片分割遮罩滑块动画

    该应用可以将任意元素遮盖在图片上方,并且指定遮住的部分。

    核心jQuery代码:

    图片 47图片 48

    (function($){  $(function(){        $('.code-wrapper').on( "mousemove", function(e) {        var offsets = $(this).offset();        var fullWidth = $(this).width();        var mouseX = e.pageX - offsets.left;          if (mouseX < 0) { mouseX = 0; }        else if (mouseX > fullWidth) { mouseX = fullWidth }            $(this).parent().find('.divider-bar').css({          left: mouseX,          transition: 'none'        });        $(this).find('.design-wrapper').css({          transform: 'translateX(' + (mouseX) + 'px)',          transition: 'none'        });        $(this).find('.design-image').css({          transform: 'translateX(' + (-1*mouseX) + 'px)',          transition: 'none'        });      });      $('.divider-wrapper').on( "mouseleave", function() {        $(this).parent().find('.divider-bar').css({          left: '50%',          transition: 'all .3s'        });        $(this).find('.design-wrapper').css({          transform: 'translateX(50%)',          transition: 'all .3s'        });        $(this).find('.design-image').css({          transform: 'translateX(-50%)',          transition: 'all .3s'        });      });      }); // end of document ready  })(jQuery);
    

    View Code

    图片 49

    在线演示        源码下载


    本文由威尼斯手机平台登陆发布于前端资源,转载请注明出处:付费投稿计划,我们需要不断学习

    关键词:

上一篇:没有了

下一篇:没有了