运用HTLM技术设计水波纹动画效果

2019-09-10 郑州网站建设  

article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}

zzsc.css

body, html { font-size: 100%; padding: 0; margin: 0;}

/* Reset */

*,

*:after,

*:before {

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

}

/* Clearfix hack by Nicolas Gallagher: */

.clearfix:before,

.clearfix:after {

content: " ";

display: table;

}

.clearfix:after {

clear: both;

}

body{

background: #494A5F;

color: #D5D6E2;

font-weight: 500;

font-size: 1.05em;

font-family: "Microsoft YaHei","Segoe UI", "Lucida Grande", Helvetica, Arial,sans-serif;

}

a{ color: rgba(255, 255, 255, 0.6);outline: none;text-decoration: none;-webkit-transition: 0.2s;transition: 0.2s;}

a:hover,a:focus{color:#74777b;text-decoration: none;}

网站代码

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>HTML5 Canvas逼真水波纹动画特效</title>

<link rel="stylesheet" type="text/css" href=http://www.divcss5.com/html5/"css/normalize.css" />

<link rel="stylesheet" type="text/css" href=http://www.divcss5.com/html5/"css/zzsc.css">

<script src=http://www.divcss5.com/html5/"js/jquery-1.11.0.min.js" type="text/javascript"></script>

<script type="text/javascript" src=http://www.divcss5.com/html5/"js/jquery.waterrippleeffect.min.js"></script>

<style type="text/css">

html, body, div, span, applet, object, iframe,

h1, h2, h3, h4, h5, h6, p, blockquote, pre,

a, abbr, acronym, address, big, cite, code,

del, dfn, em, font, img, ins, kbd, q, s, samp,

small, strike, strong, sub, sup, tt, var,

b, u, i, center,

dl, dt, dd, ol, ul, li,

fieldset, form, label, legend,

table, caption, tbody, tfoot, thead, tr, th, td {

margin: 0;

padding: 0;

border: 0;

outline: 0;

font-size: 100%;

vertical-align: baseline;

/*background: transparent;*/

box-sizing: border-box;

}

body {

overflow: hidden;

}

.container{

width: 480px;

height: 480px;

margin:20px auto;

position: relative;

}

.clear {

clear: both;

height: 0;

font-size: 0;

line-height: 0;

}

</style>

<script>

$( document ).ready( function() {

//------------------------------------------------------------------------

$( '#preloaderDiv' ).delay( 1000 ).fadeTo( 1000 , 0, function() {

$( this ).css( 'display', 'none' );

} );

$( '#startDiv' ).css( 'cursor', 'pointer' ).click( function() {

//$( this ).css( 'display', 'none' );

$( this ).delay( 10 ).fadeTo( 1000 , 0, function() {

$( this ).css( 'display', 'none' );

} );

init();

} );

//------------------------------------------------------------------------

function init() {

//Settings - params for WaterRippleEffect

var settings = {

image: './img/SwimmingPool.jpg',//image path

rippleRadius: 3,//radius of the ripple

width: 480,//width

height: 480,//height

delay: 1,//if auto param === true. 1 === 1 second delay for animation

auto: true//if auto param === true, animation starts on it´s own

};

//------------------------------------------------------------------------

//standalone

//init

var waterRippleEffect = new WaterRippleEffect( document.getElementById( 'holder' ), settings );

document.getElementById( 'holder' ).style.cursor = 'pointer';

//on click

document.getElementById( 'holder' ).addEventListener( 'click', function( e ) {

var mouseX = e.layerX;

var mouseY = e.layerY;

waterRippleEffect.disturb( mouseX, mouseY );

} );

//on mousemove

document.getElementById( 'holder' ).addEventListener( 'mousemove', function( e ) {

var mouseX = e.layerX;

var mouseY = e.layerY;

waterRippleEffect.disturb( mouseX, mouseY );

} );

//------------------------------------------------------------------------

//jQuery

//init

/*

$( '#holder' ).waterRippleEffect( settings );

$( '#holder' ).css( 'cursor', 'pointer' );

*/

//on click

/*

$( '#holder' ).click( function( e ) {

var mouseX = e.pageX - $( this ).offset().left;

var mouseY = e.pageY - $( this ).offset().top;

$( '#holder' ).waterRippleEffect( "disturb", mouseX, mouseY );

} );

*/

//on mousemove

/*

$( '#holder' ).mousemove( function( e ) {

var mouseX = e.pageX - $( this ).offset().left;

var mouseY = e.pageY - $( this ).offset().top;

$( '#holder' ).waterRippleEffect( "disturb", mouseX, mouseY );

} );

*/

};

//------------------------------------------------------------------------

} );

</script>

</head>

<body><script src=http://www.divcss5.com/html5/"/demos/谷歌gg.js"></script>

<div>

<div></div>

<div>

<img src='http://www.divcss5.com/html5/img/startBt.jpg' alt='Start'>

</div>

<div>

<img src='http://www.divcss5.com/html5/img/PreloaderDark.gif' alt='Preloader'>

</div>

</div>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">


河南郑州做网站首选天择文化,我们专注郑州网站建设网站设计网站制作与开发,是中原地区专业的郑州网络公司,多年来我们一直努力,服务客户数百家,欢迎您的咨询。
本文链接:郑州网络公司http://tzchb.ieyo.com/dede/1726.html转载请标明出处,谢谢合作!
标签:
  • article
  • Ч
  • HTLM
  • normalize.cs