群星环绕

html

<!DOCTYPE html>
<html><head><meta charset="utf-8" /><title>星星环绕</title><link rel="stylesheet" href="css/index.css" /><script type="text/javascript" src="js/jquery-3.1.1.min.js"></script><script type="text/javascript" src="js/index.js"></script></head><body><!--作者:352183987@qq.com时间:2018-01-09描述:群星环绕--><center><h1>我是一个<span>被施了魔法的</span>皮皮怪!</h1><button class="Shine">Hover Me</button><button class="Shine last">Hover Me!!</button></center></body>
</html>

css

.Shine {background: #3e5771;color: white;border: none;padding: 16px 36px;font-weight: normal;border-radius: 3px;transition: all 0.25s ease;box-shadow: 0 38px 32px -23px black;margin: 0 1em 1em;
}
.Shine:hover {background: #2c3e50;color: rgba(255, 255, 255, 0.2);
}

Js

/*Author:352183987@qq.comTime:2018-01-09Des:群星环绕LastModify:2018年1月9日11:17:01*/
$(function() {// 默认是不同程度的透明白色闪烁$(".Shine:first").sparkleh();// rainbow用来产生随机颜色// count决定闪闪发光的数量// overlap决定闪烁点的移动,不过要小心其他的dom事件.$(".Shine:last").sparkleh({color: "rainbow",count: 100,overlap: 10});// 在这里创建了Fuscia闪烁$("h1").sparkleh({count: 80,color: "#ff0080"});$("p").sparkleh({count: 20,color: "#00ff00"});// color也可以是数组// 对于image,需要完全加载才能设置// canvas的高度或者宽度 $("#image").imagesLoaded( function() {$(".img").sparkleh({count: 25,color: ["#00afec","#fb6f4a","#fdfec5"]});});});$.fn.sparkleh = function( options ) {return this.each( function(k,v) {var $this = $(v).css("position","relative");var settings = $.extend({width: $this.outerWidth(),height: $this.outerHeight(),color: "#FFFFFF",count: 30,overlap: 0}, options );var sparkle = new Sparkle( $this, settings );$this.on({"mouseover focus" : function(e) {sparkle.over();},"mouseout blur" : function(e) {sparkle.out();}});});}function Sparkle( $parent, options ) {this.options = options;this.init( $parent );
}Sparkle.prototype = {"init" : function( $parent ) {var _this = this;this.$canvas = $("<canvas>").addClass("sparkle-canvas").css({position: "absolute",top: "-"+_this.options.overlap+"px",left: "-"+_this.options.overlap+"px","pointer-events": "none"}).appendTo($parent);this.canvas = this.$canvas[0];this.context = this.canvas.getContext("2d");this.sprite = new Image();this.canvas.width = this.options.width + ( this.options.overlap * 2);this.canvas.height = this.options.height + ( this.options.overlap * 2);this.sprites = [0,6,13,20];this.particles = this.createSparkles( this.canvas.width , this.canvas.height );this.anim = null;this.fade = false;},"createSparkles" : function( w , h ) {var holder = [];for( var i = 0; i < this.options.count; i++ ) {var color = this.options.color;if( this.options.color == "rainbow" ) {color = '#'+Math.floor(Math.random()*16777215).toString(16);} else if( $.type(this.options.color) === "array" ) {color = this.options.color[ Math.floor(Math.random()*this.options.color.length) ];}holder[i] = {position: {x: Math.floor(Math.random()*w),y: Math.floor(Math.random()*h)},style: this.sprites[ Math.floor(Math.random()*4) ],delta: {x: Math.floor(Math.random() * 1000) - 500,y: Math.floor(Math.random() * 1000) - 500},size: parseFloat((Math.random()*2).toFixed(2)),color: color};}return holder;},"draw" : function( time, fade ) {var ctx = this.context;var img = this.sprite;img.src = this.datauri;ctx.clearRect( 0, 0, this.canvas.width, this.canvas.height );for( var i = 0; i < this.options.count; i++ ) {var derpicle = this.particles[i];var modulus = Math.floor(Math.random()*7);if( Math.floor(time) % modulus === 0 ) {derpicle.style = this.sprites[ Math.floor(Math.random()*4) ];}ctx.save();ctx.globalAlpha = derpicle.opacity;ctx.drawImage(img, derpicle.style, 0, 7, 7, derpicle.position.x, derpicle.position.y, 7, 7);if( this.options.color ) {  ctx.globalCompositeOperation = "source-atop";ctx.globalAlpha = 0.5;ctx.fillStyle = derpicle.color;ctx.fillRect(derpicle.position.x, derpicle.position.y, 7, 7);}ctx.restore();}},"update" : function() {var _this = this;this.anim = window.requestAnimationFrame( function(time) {for( var i = 0; i < _this.options.count; i++ ) {var u = _this.particles[i];var randX = ( Math.random() > Math.random()*2 );var randY = ( Math.random() > Math.random()*3 );if( randX ) {u.position.x += (u.delta.x / 1500); }        if( !randY ) {u.position.y -= (u.delta.y / 800);         }if( u.position.x > _this.canvas.width ) {u.position.x = -7;} else if ( u.position.x < -7 ) {u.position.x = _this.canvas.width; }if( u.position.y > _this.canvas.height ) {u.position.y = -7;u.position.x = Math.floor(Math.random()*_this.canvas.width);} else if ( u.position.y < -7 ) {u.position.y = _this.canvas.height; u.position.x = Math.floor(Math.random()*_this.canvas.width);}if( _this.fade ) {u.opacity -= 0.02;} else {u.opacity -= 0.005;}if( u.opacity <= 0 ) {u.opacity = ( _this.fade ) ? 0 : 1;}}_this.draw( time );if( _this.fade ) {_this.fadeCount -= 1;if( _this.fadeCount < 0 ) {window.cancelAnimationFrame( _this.anim );} else {_this.update(); }} else {_this.update();}});},"cancel" : function() {this.fadeCount = 100;},"over" : function() {window.cancelAnimationFrame( this.anim );for( var i = 0; i < this.options.count; i++ ) {this.particles[i].opacity = Math.random();}this.fade = false;this.update();},"out" : function() {this.fade = true;this.cancel();},"datauri" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAHCAYAAAD5wDa1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDNFMzM5REEyMkUxMUUzOEE3NEI3Q0U1QUIzMTc4NiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDNFMzM5RUEyMkUxMUUzOEE3NEI3Q0U1QUIzMTc4NiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0M0UzMzlCQTIyRTExRTM4QTc0QjdDRTVBQjMxNzg2IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0M0UzMzlDQTIyRTExRTM4QTc0QjdDRTVBQjMxNzg2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+jzOsUQAAANhJREFUeNqsks0KhCAUhW/Sz6pFSc1AD9HL+OBFbdsVOKWLajH9EE7GFBEjOMxcUNHD8dxPBCEE/DKyLGMqraoqcd4j0ChpUmlBEGCFRBzH2dbj5JycJAn90CEpy1J2SK4apVSM4yiKonhePYwxMU2TaJrm8BpykpWmKQ3D8FbX9SOO4/tOhDEG0zRhGAZo2xaiKDLyPGeSyPM8sCxr868+WC/mvu9j13XBtm1ACME8z7AsC/R9r0fGOf+arOu6jUwS7l6tT/B+xo+aDFRo5BykHfav3/gSYAAtIdQ1IT0puAAAAABJRU5ErkJggg=="}; // $('img.photo',this).imagesLoaded(myFunction)
// 因为.load()不适用于缓存的图像,所以所有图像加载完成后执行回调.// 回调函数传递最后一个图像作为参数加载,集合为`this`$.fn.imagesLoaded = function(callback){var elems = this.filter('img'),len   = elems.length,blank = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";elems.bind('load.imgloaded',function(){if (--len <= 0 && this.src !== blank){ elems.unbind('load.imgloaded');callback.call(elems,this); }}).each(function(){// 缓存的图像有时不会触发负载,所以我们重置src.if (this.complete || this.complete === undefined){var src = this.src;this.src = blank;this.src = src;}  }); return this;
};

雪花飘落

html

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>雪花飘落</title><link rel="apple-touch-icon" href="images/apple-touch-icon.png" /><!-- The leaves.css file animates the leaves --><link rel="stylesheet" href="css/SnowFall.css" type="text/css" media="screen" charset="utf-8"><!-- The leaves.js file creates the leaves --><script src="js/SnowFall.js" type="text/javascript" charset="utf-8"></script></head><body><!--作者:352183987@qq.com时间:2018-01-09描述:雪花飘落--><div id="container"><!-- The container is dynamically populated using the init function in leaves.js --><!-- Its dimensions and position are defined using its id selector in leaves.css --><div id="leafContainer"></div><!-- its appearance, dimensions, and position are defined using its id selector in leaves.css --></div></body>
</html>

css

/*Author:352183987@qq.comTime:2018-01-09Des:雪花飘落LastModify: 2018年1月9日12:07:03*/body
{background-color: #fff;
}#container {position: relative;height: 90vh;width: 90vw;margin: 10px auto;overflow: hidden;border: 4px solid #ccc;
}/* Defines the position and dimensions of the leafContainer div */
#leafContainer
{position: absolute;width: 100%;height: 100%;
}/* Sets the color of the "Dino's Gardening Service" message */
em
{font-weight: bold;font-style: normal;
}/* This CSS rule is applied to all div elements in the leafContainer div.It styles and animates each leafDiv.
*/
#leafContainer > div
{position: absolute;width: 100px;height: 100px;/* We use the following properties to apply the fade and drop animations to each leaf.Each of these properties takes two values. These values respectively match a settingfor fade and drop.*/-webkit-animation-iteration-count: infinite, infinite;-webkit-animation-direction: normal, normal;-webkit-animation-timing-function: linear, ease-in;
}/* This CSS rule is applied to all img elements directly inside div elements which aredirectly inside the leafContainer div. In other words, it matches the 'img' elementsinside the leafDivs which are created in the createALeaf() function.
*/
#leafContainer > div > img {position: absolute;width: 50px;height: 50px;/* We use the following properties to adjust the clockwiseSpin or counterclockwiseSpinAndFlipanimations on each leaf.The createALeaf function in the Leaves.js file determines whether a leaf has the clockwiseSpin or counterclockwiseSpinAndFlip animation.*/-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-timing-function: ease-in-out;-webkit-transform-origin: 50% -100%;
}/* Hides a leaf towards the very end of the animation */
@-webkit-keyframes fade
{/* Show a leaf while into or below 95 percent of the animation and hide it, otherwise */0%   { opacity: 1; }95%  { opacity: 1; }100% { opacity: 0; }
}/* Makes a leaf fall from -300 to 600 pixels in the y-axis */
@-webkit-keyframes drop
{/* Move a leaf to -300 pixels in the y-axis at the start of the animation */0%   { -webkit-transform: translate(0px, -50px); }/* Move a leaf to 600 pixels in the y-axis at the end of the animation */100% { -webkit-transform: translate(0px, 850px); }
}/* Rotates a leaf from -50 to 50 degrees in 2D space */
@-webkit-keyframes clockwiseSpin
{/* Rotate a leaf by -50 degrees in 2D space at the start of the animation */0%   { -webkit-transform: rotate(-50deg); }/*  Rotate a leaf by 50 degrees in 2D space at the end of the animation */100% { -webkit-transform: rotate(50deg); }
}/* Flips a leaf and rotates it from 50 to -50 degrees in 2D space */
@-webkit-keyframes counterclockwiseSpinAndFlip
{/* Flip a leaf and rotate it by 50 degrees in 2D space at the start of the animation */0%   { -webkit-transform: scale(-1, 1) rotate(50deg); }/* Flip a leaf and rotate it by -50 degrees in 2D space at the end of the animation */100% { -webkit-transform: scale(-1, 1) rotate(-50deg); }
}

Js

/*Author:352183987@qq.comTime:2018-01-09Des:雪花飘落LastModify: 2018年1月9日12:07:03*/const NUMBER_OF_LEAVES = 60;
/* Called when the "Falling Leaves" page is completely loaded.
*/
function init()
{/* Get a reference to the element that will contain the leaves */var container = document.getElementById('leafContainer');/* Fill the empty container with new leaves */for (var i = 0; i < NUMBER_OF_LEAVES; i++) {container.appendChild(createALeaf());}
}
/*Receives the lowest and highest values of a range andreturns a random integer that falls within that range.
*/
function randomInteger(low, high)
{return low + Math.floor(Math.random() * (high - low));
}
/*Receives the lowest and highest values of a range andreturns a random float that falls within that range.
*/
function randomFloat(low, high)
{return low + Math.random() * (high - low);
}/*Receives a number and returns its CSS pixel value.
*/
function pixelValue(value)
{return value + 'vw';
}/*Returns a duration value for the falling animation.
*/function durationValue(value)
{return value + 's';
}/*Uses an img element to create each leaf. "Leaves.css" implements two spin animations for the leaves: clockwiseSpin and counterclockwiseSpinAndFlip. Thisfunction determines which of these spin animations should be applied to each leaf.*/
function createALeaf()
{/* Start by creating a wrapper div, and an empty img element */var leafDiv = document.createElement('div');var image = document.createElement('img');/* Randomly choose a leaf image and assign it to the newly created element *///image.src = 'images/realLeaf' + randomInteger(1, 5) + '.png';image.src = 'img/Snow.png';leafDiv.style.top = "-50px";/* Position the leaf at a random location along the screen */leafDiv.style.left = pixelValue(randomInteger(0, 90));/* Randomly choose a spin animation */var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';/* Set the -webkit-animation-name property with these values */leafDiv.style.webkitAnimationName = 'fade, drop';image.style.webkitAnimationName = spinAnimationName;/* Figure out a random duration for the fade and drop animations */var fadeAndDropDuration = durationValue(randomFloat(5, 11));/* Figure out another random duration for the spin animation */var spinDuration = durationValue(randomFloat(4, 8));/* Set the -webkit-animation-duration property with these values */leafDiv.style.webkitAnimationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration;var leafDelay = durationValue(randomFloat(0, 5));leafDiv.style.webkitAnimationDelay = leafDelay + ', ' + leafDelay;image.style.webkitAnimationDuration = spinDuration;// add the <img> to the <div>leafDiv.appendChild(image);/* Return this img element so it can be added to the document */return leafDiv;
}/* Calls the init function when the "Falling Leaves" page is full loaded */
window.addEventListener('load', init, false);

闪耀按钮

html

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>闪光按钮</title><link rel="stylesheet" href="css/ShineBtn.css" /></head><body id="radioactiveButtonsPage" class="chrome windows"><div class="wall-of-buttons"><a class="large green button">路飞</a><a class="large blue button">黑崎一护</a><a class="large magenta button">白胡子</a><a class="large green button">朽木露琪亚</a><a class="large red button">蓝染</a><a class="large magenta button">井上织姬</a><br /><a class="large orange button">野比大雄</a><a class="large magenta button">刚田武胖虎</a><a class="large green button">骨川小夫</a><a class="large orangellow button">源静香</a><a class="large blue button">哆啦A梦</a><a class="large red button">夏目友人帐</a><a class="large blue button">娘口三三</a><br /><a class="large magenta button">坂本</a><a class="large orangellow button">出木杉</a><a class="large red button">哆啦小子</a><a class="large orange button">哆啦王</a><a class="large green button">哆啦尼可夫</a><a class="large orangellow button">哆啦利钮</a><a class="large red button">哆啦梅度三世</a><a class="large blue button">耶鲁马他哆啦</a><a class="large orangellow button">御坂美琴</a><a class="large blue button">利威尔·阿克曼</a><a class="large red button">叶音竹</a><a class="large orange button">萧炎</a><a class="large orangellow button">美少女战士</a></div></body></html>

Css


body {background: #333;text-shadow: 0 1px 1px rgba(0, 0, 0, .5);}@-webkit-keyframes bigAssButtonPulse {from {background-color: #749a02;-webkit-box-shadow: 0 0 25px #333;}50% {background-color: #91bd09;-webkit-box-shadow: 0 0 50px #91bd09;}to {background-color: #749a02;-webkit-box-shadow: 0 0 25px #333;}}@-webkit-keyframes greenPulse {from {background-color: #749a02;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #91bd09;-webkit-box-shadow: 0 0 18px #91bd09;}to {background-color: #749a02;-webkit-box-shadow: 0 0 9px #333;}}@-webkit-keyframes bluePulse {from {background-color: #007d9a;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #2daebf;-webkit-box-shadow: 0 0 18px #2daebf;}to {background-color: #007d9a;-webkit-box-shadow: 0 0 9px #333;}}@-webkit-keyframes redPulse {from {background-color: #bc330d;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #e33100;-webkit-box-shadow: 0 0 18px #e33100;}to {background-color: #bc330d;-webkit-box-shadow: 0 0 9px #333;}}@-webkit-keyframes magentaPulse {from {background-color: #630030;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #a9014b;-webkit-box-shadow: 0 0 18px #a9014b;}to {background-color: #630030;-webkit-box-shadow: 0 0 9px #333;}}@-webkit-keyframes orangePulse {from {background-color: #d45500;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #ff5c00;-webkit-box-shadow: 0 0 18px #ff5c00;}to {background-color: #d45500;-webkit-box-shadow: 0 0 9px #333;}}@-webkit-keyframes orangellowPulse {from {background-color: #fc9200;-webkit-box-shadow: 0 0 9px #333;}50% {background-color: #ffb515;-webkit-box-shadow: 0 0 18px #ffb515;}to {background-color: #fc9200;-webkit-box-shadow: 0 0 9px #333;}}a.button {-webkit-animation-duration: 2s;-webkit-animation-iteration-count: infinite;}.green.button {-webkit-animation-name: greenPulse;-webkit-animation-duration: 3s;}.blue.button {-webkit-animation-name: bluePulse;-webkit-animation-duration: 4s;}.red.button {-webkit-animation-name: redPulse;-webkit-animation-duration: 1s;}.magenta.button {-webkit-animation-name: magentaPulse;-webkit-animation-duration: 2s;}.orange.button {-webkit-animation-name: orangePulse;-webkit-animation-duration: 3s;}.orangellow.button {-webkit-animation-name: orangellowPulse;-webkit-animation-duration: 5s;}.wall-of-buttons {width: 100%;height: 180px;text-align: center;}.wall-of-buttons a.button {display: inline-block;margin: 0 10px 9px 0;}.button {display: inline-block;padding: 5px 15px 6px;color: #fff !important;font-size: 13px;font-weight: bold;line-height: 1;text-decoration: none;-moz-border-radius: 5px;-webkit-border-radius: 5px;-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);border-bottom: 1px solid rgba(0, 0, 0, 0.25);position: relative;cursor: pointer;overflow: visible;width: auto;
}button::-moz-focus-inner {border: 0;padding: 0;
}.button:hover {background-color: #111;color: #fff;
}.button:active {-webkit-transform: translateY(1px);-moz-transform: translateY(1px);
}/* Small Buttons */.small.button {font-size: 11px;
}/* Large Buttons */.large.button {font-size: 14px;padding: 8px 19px 9px;
}/* Colors for our beloved buttons */.green.button {background-color: #91bd09;
}.green.button:hover {background-color: #749a02;
}.blue.button {background-color: #2daebf;
}.blue.button:hover {background-color: #007d9a;
}.red.button {background-color: #e33100;
}.red.button:hover {background-color: #872300;
}.magenta.button {background-color: #a9014b;
}.magenta.button:hover {background-color: #630030;
}.orange.button {background-color: #ff5c00;
}.orange.button:hover {background-color: #d45500;
}.orangellow.button {background-color: #ffb515;
}.orangellow.button:hover {background-color: #fc9200;
}.white.button {background-color: #fff;border: 1px solid #ccc;color: #666 !important;font-weight: normal;text-shadow: 0 1px 1px rgba(255, 255, 255, 1);
}.white.button:hover {background-color: #eee;
}/*Strike button*/.strike.button {background-color: #4ADFC1
}.strike.button:hover {background-color: #39ceb0
}/* Secondary buttons (perfect for Cancels or other secondary actions */.secondary.button {background: #fff url(/images/gradients/36px-black.png) repeat-x 0 0;color: #555 !important;text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);border: 1px solid #bbb;-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}.secondary.button:hover {background-color: #eee;color: #444 !important;border-color: #999;
}/* Make the buttons super awesomer */.super.button {background-image: url(/images/super-button-overlay.png);font-size: 13px;padding: 0;border: 1px solid rgba(0, 0, 0, .25);-webkit-border-radius: 15px;-moz-border-radius: 15px;
}.super.button span {display: block;padding: 4px 15px 6px;-webkit-border-radius: 14px;-moz-border-radius: 14px;border-top: 1px solid rgba(255, 255, 255, .2);line-height: 1;
}.small.super.button {font-size: 11px;-webkit-border-radius: 12px;-moz-border-radius: 12px;
}.small.super.button span {padding: 2px 12px 6px;-webkit-border-radius: 11px;-moz-border-radius: 11px;
}.small.white.super.button span {padding: 3px 12px 5px;
}.large.super.button {background-position: left bottom;-webkit-border-radius: 18px;-moz-border-radius: 18px;
}.large.super.button span {font-size: 14px;padding: 7px 20px 9px;-webkit-border-radius: 17px;-moz-border-radius: 17px;
}

抽卡

(PS: 想要背景大图的加Q: 352183987)

html

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>抽卡</title><link rel="stylesheet" href="css/card.css" /><script type="text/javascript" src="js/jquery-3.1.1.min.js"></script></head><body><div class="container"><div class="folder"><div class="paper"><h1>なつめ ゆうじん ちょう</h1><p>我想成为一个温柔的人,因为曾被温柔的人那样对待,深深了解那种被温柔相待的感觉.</p><p>所看到的东西未必存在,没有人理解我独自行走在那个不安定世界的恐惧。所看到的东西或许也不存在,那个不安定的世界.</p><p>我喜欢温柔,也喜欢温暖,所以我喜欢人类.</p></div><div class="cover"><div class="title">夏目友人帐</div></div></div></div></body>
</html>

Css

/*Author:352183987@qq.comTime:2018-01-09Des:抽卡LastModify: 2018年1月9日16:00:17*/
*, *:before, *:after {box-sizing: border-box;
}html, body {height: 100%;background: url(../img/XM.jpg);margin: 0;padding: 0;
}.container {position: relative;width: 100%;height: 100%;
}
.container > .folder {width: 220px;height: 180px;left: calc(50% - 110px);top: calc(70% - 90px);position: absolute;
}
.container > .folder > .cover {cursor: pointer;position: absolute;width: 100%;height: 100%;background-color: #fab62f;-moz-border-radius: 0 0 10px 10px;-webkit-border-radius: 0;border-radius: 0 0 10px 10px;-moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.2);box-shadow: 5px 5px rgba(0, 0, 0, 0.2);
}
.container > .folder > .cover:before, .container > .folder > .cover:after {box-sizing: border-box;content: "";display: block;position: absolute;top: -100px;border: 50px solid transparent;
}
.container > .folder > .cover:before {left: 0;width: 50%;border-left: none;border-bottom-color: #fab62f;
}
.container > .folder > .cover:after {right: 0;width: 50%;border-right: none;border-bottom-color: #fab62f;
}
.container > .folder > .cover > .title {position: absolute;padding: 1em;font-family: Arial, Helvetica, sans-serif;text-transform: uppercase;font-weight: bold;text-align: center;font-size: 2.5em;color: rgba(0, 0, 0, 0.1);-moz-user-select: -moz-none;-ms-user-select: none;-webkit-user-select: none;user-select: none;-moz-transform: rotate(20deg);-ms-transform: rotate(20deg);-o-transform: rotate(20deg);-webkit-transform: rotate(20deg);transform: rotate(20deg);
}
.container > .folder > .paper {opacity: 1;position: absolute;overflow: hidden;width: 200px;height: 200px;top: calc(50% - 150px);left: calc(50% - 100px);transition: top 0.5s, opacity 0.4s;font-family: Verdana, Tahoma, sans-serif;font-size: 0.1em;padding: 1em;color: #644812;background-color: #fde1ab;-moz-box-shadow: 10px 10px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 10px 10px rgba(0, 0, 0, 0.2);box-shadow: 10px 10px rgba(0, 0, 0, 0.2);-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;
}
.container > .folder:hover > .paper {top: calc(50% - 200px);
}
.container > .folder.opened > .paper {top: calc(-500px);opacity: 0;
}

Js

$(document).on('click', '.folder', function() {$(this).toggleClass('opened');
});

Coder往事之: 一些炫酷的特效 for web 前端 (一)相关推荐

  1. 那些炫酷的特效--QQ空间+VUE

    废话,可以跳过 在这个色彩斑斓的时代,各种app.各式各样的特效充斥着我们的眼球.在我看来,炫酷的特效在很大程度上是能够博取用户的好感,提高用户体验的.而这些酷炫的交互方式是没有界限的,所以一些好的a ...

  2. C/C++制作炫酷烟雾特效

    C/C++制作炫酷烟雾特效 效果 代码 #include <graphics.h> #include <time.h> #include <conio.h> #in ...

  3. HTML5炫酷的特效代码下载

    原文:HTML5炫酷的特效代码下载 源代码下载地址http://www.zuidaima.com/share/1800857292508160.htm 炫酷的效果会随着鼠标移动不停的变更,很赞的

  4. 给页面写一个炫酷的时钟特效【web前端】

    文章目录 一.前言 二.想法设计/实现过程 三.基本样式 四.时间函数控制器 五,时,分,秒占位 六.时间动态填充 一.前言 今天看到某网站的时间特别的丑陋,所以就诞生了写一个看时间的炫酷的时钟前端页 ...

  5. html5+CSS3实现的炫酷超链接特效

    今天为大家介绍一个非常炫酷的超链接特效.在你做一些前端的网页时可以在里面去用上这些前卫时尚的效果. 这些超链接特性,大都是借助伪元素.svg.HTML5动画来实现的.效果都很漂亮,不信看下面. 用你的 ...

  6. 【网页特效】12 个炫酷背景特效库

    1.particles-bg 地址:https://github.com/lindelof/particles-bg 效果: 2.particles-bg-vue 地址:https://github. ...

  7. android开发炫酷背景图片,12 个炫酷背景特效库

    作者:lindelof 译者:前端小智 来源:github点赞再看,微信搜索GitHub https://github.com/qq44924588... 上已经收录,文章的已分类,也整理了很多我的文 ...

  8. html飞机动画,基于纯CSS3纸飞机炫酷动画特效

    简要教程 Flyaway.css是一款使用纯CSS3制作的炫酷纸飞机动画特效.Flyout模式可以应用于登录页面,信息发送成功,如果填的信息有误,可以使用Shake模式,代表信息输入有误. Flyaw ...

  9. 四个复制就能用的炫酷网页特效

    第一个:炫酷星空 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" ...

  10. 33+卡通炫酷视频特效素材AE模板 Flash FX Elements Pack 02

    包含33个卡通炫酷视频叠加特效素材AE模板 Flash FX Elements Pack 02.只需添加这些元素即可改善您的体育视频.广告.社交媒体和电视内容等. 项目特点: 33+闪光效果 全色控件 ...

最新文章

  1. HDU4738(割点)
  2. wincc历史数据库_什么是数据库?如何学习数据库?
  3. PM2中无法开启ES6的解决方案
  4. 【Linux】9.ssh登录与scp文件拷贝
  5. Angular Route数据结构里常用字段使用方法一览
  6. tomcat(5)servlet容器
  7. MapReduce学习笔记(4)
  8. C/C++线程与多线程工作笔记003---C++指针引用和解引用
  9. guava cache reload返回新旧值解析
  10. 元素居中的一种特殊方法
  11. Mybatis的直接执行SQL
  12. VsVim - Shortcut Key (快捷键)
  13. FreeSwitch明明已经设置了H264,为什么通话时还是别的格式(如VP8)
  14. 前端实现base64解码编码
  15. php话费充值接口对接,基于PHP的聚合数据手机话费充值API调用代码示例
  16. 抖音整人/撩小姐姐代码(vbs脚本)
  17. Deepin 系统安装NVIDIA
  18. 泰国8日自助游攻略(普吉+清迈)
  19. 华为nova8pro和荣耀60pro哪个好
  20. 基于神经网络 lstm的股票开盘价收盘价预测详细

热门文章

  1. 用javascript实现九九乘法口诀表
  2. 利用Excel去除重复项
  3. Barefoot Networks 宣布 P4 Studio—下一代软件开发环境
  4. 严格的概念认识——关系、关系模型
  5. everedit 格式化json_Bracket 使用指南
  6. Eclipse和IDEA哪个好
  7. FPGA—蜂鸣器播放《两只老虎》
  8. 立方人物|吴胜男律师:一位温而不沸的90后执行主任
  9. 【Python爬虫】-从入门到入门-个人技术经验汇总-【爬虫和数据】
  10. 《蔡康永说话之道》书摘