Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
constellations css
css
body { background-color: #03283d;overflow: hidden; } /* Animation styling begins */ /* TODO: Break point to static, no animation hero illustration (stargazing-mobile.jpg) at 991px and below */ .startgazing { position: relative; } .startgazing-bg { width: 100%; } .startgazing-stars { position: absolute; top: 8px; left: 8%; width: 87%; } .flicker { animation: flicker 0.8s alternate infinite; opacity: 0.2; } /* benefits heart */ .benefits { animation: long-constellation 10s linear 0s infinite; } #Benefits-Heart { stroke-dasharray: 905; stroke-dashoffset: 905; } #Benefits-Plus { stroke-dasharray: 334; stroke-dashoffset: 334; } /* Survey */ .survey { animation: long-constellation 10s linear 1s infinite; } #Survey-big { stroke-dasharray: 411; stroke-dashoffset: 411; } #Survey-small { stroke-dasharray: 218; stroke-dashoffset: 218; } .survey-line { stroke-dasharray: 62; stroke-dashoffset: 62; } /* Document */ .document { animation: long-constellation 10s linear 3s infinite; } #Document-outline { stroke-dasharray: 592; stroke-dashoffset: 592; } #Document-corner { stroke-dasharray: 80; stroke-dashoffset: 80; } .document-text { stroke-dasharray: 84; stroke-dashoffset: 84; } .document-bullet { stroke-dasharray: 87; stroke-dashoffset: 87; } /* Payroll */ .payroll { animation: long-constellation 10s linear 4s infinite; } #Payroll-rectangle { stroke-dasharray: 701; stroke-dashoffset: 701; } .payroll-corner { stroke-dasharray: 52; stroke-dashoffset: 52; } .payroll-circle { stroke-dasharray: 145; stroke-dashoffset: 145; } #Payroll-S { stroke-dasharray: 189; stroke-dashoffset: 189; } .payroll-s-line { stroke-dasharray: 15; stroke-dashoffset: 15; } /* Compliance Check */ #Compliance-check { stroke-dasharray: 456; stroke-dashoffset: 456; animation: long-constellation 10s linear 5s infinite; } /* Bank */ .bank { animation: long-constellation 10s linear 7s infinite; } #Bank-roof { stroke-dasharray: 244; stroke-dashoffset: 244; } #Bank-ground { stroke-dasharray: 217; stroke-dashoffset: 217; } .bank-column { stroke-dasharray: 343; stroke-dashoffset: 343; } .bank-line { stroke-dasharray: 28; stroke-dashoffset: 28; } /* Calendar */ .calendar { animation: long-constellation 10s linear 8s infinite; } #Calendar-rectangle { stroke-dasharray: 423; stroke-dashoffset: 423; } .calendar-row { stroke-dasharray: 114; stroke-dashoffset: 114; } .calendar-column { stroke-dasharray: 74; stroke-dashoffset: 74; } .calendar-ring { stroke-dasharray: 29; stroke-dashoffset: 29; } .calendar-circle { stroke-dasharray: 32; stroke-dashoffset: 32; } /* Keyframes */ /* constellation animation */ @keyframes long-constellation { 0% { opacity: 0; } 10% { opacity: 1; } 35% { opacity: 1; stroke-dashoffset: 0; } 70% { opacity: 1; stroke-dashoffset: 0; } 85% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; } } /* star flicker animation */ @keyframes flicker { 0% { opacity: 0.3; } 100% { opacity: 1; } } /* Animation styling ends */
JavaScript
var $arr = jQuery.makeArray( $('circle') ); $( $arr ).each(function( i ) { var $randNum = (Math.random() * 3.75) + .3; $( this ).addClass('flicker'); $( this ).css( {'animation-delay': $randNum +'s'} ); }); ////// The following snippet was taken from a code pen created by Dean Wagman ////// See the original greatness at http://codepen.io/deanwagman/pen/EjLBdQ // // Little Canvas things var canvas = document.querySelector("#canvas"), ctx = canvas.getContext('2d'); // Set Canvas to be window size canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Configuration, Play with these var config = { particleNumber: 12, maxParticleSize: 4, maxSpeed: 2, colorVariation: 4 }; // Colors var colorPalette = { bg: {r:3,g:40,b:61}, // bg: {r:200,g:200,b:200}, matter: [ {r:5,g:62,b:94}, {r:63,g:118,b:147} ] }; // Some Variables hanging out var particles = [], centerX = canvas.width / .3, centerY = canvas.height / .2, drawBg, // Draws the background for the canvas, because space drawBg = function (ctx, color) { ctx.fillStyle = "rgb(" + color.r + "," + color.g + "," + color.b + ")"; ctx.fillRect(0,0,canvas.width,canvas.height); }; // Particle Constructor var Particle = function (x, y) { // X Coordinate this.x = x || Math.round(Math.random() * canvas.width); // Y Coordinate this.y = y || Math.round(Math.random() * canvas.height); // Radius of the space dust this.r = Math.ceil(Math.random() * config.maxParticleSize); // Color of the rock, given some randomness this.c = colorVariation(colorPalette.matter[Math.floor(Math.random() * colorPalette.matter.length)],true ); // Speed of which the rock travels this.s = Math.pow(Math.ceil(Math.random() * config.maxSpeed), .7); // Direction the Rock flies this.d = Math.round(Math.random() * 360); }; // Provides some nice color variation // Accepts an rgba object // returns a modified rgba object or a rgba string if true is passed in for argument 2 var colorVariation = function (color, returnString) { var r,g,b,a, variation; r = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.r); g = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.g); b = Math.round(((Math.random() * config.colorVariation) - (config.colorVariation/2)) + color.b); a = Math.random() + .5; if (returnString) { return "rgba(" + r + "," + g + "," + b + "," + a + ")"; } else { return {r,g,b,a}; } }; // Used to find the rocks next point in space, accounting for speed and direction var updateParticleModel = function (p) { var a = 180 - (p.d + 90); // find the 3rd angle p.d > 0 && p.d < 180 ? p.x += p.s * Math.sin(p.d) / Math.sin(p.s) : p.x -= p.s * Math.sin(p.d) / Math.sin(p.s); p.d > 90 && p.d < 270 ? p.y += p.s * Math.sin(a) / Math.sin(p.s) : p.y -= p.s * Math.sin(a) / Math.sin(p.s); return p; }; // Just the function that physically draws the particles // Physically? sure why not, physically. var drawParticle = function (x, y, r, c) { ctx.beginPath(); ctx.fillStyle = c; ctx.arc(x, y, r, 0, 2*Math.PI, false); ctx.fill(); ctx.closePath(); }; // Remove particles that aren't on the canvas var cleanUpArray = function () { particles = particles.filter((p) => { return (p.x > -100 && p.y > -100); }); }; var initParticles = function (numParticles, x, y) { for (let i = 0; i < numParticles; i++) { particles.push(new Particle(x, y)); } particles.forEach((p) => { drawParticle(p.x, p.y, p.r, p.c); }); }; // That thing window.requestAnimFrame = (function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); }; })(); // Our Frame function var frame = function () { // Draw background first drawBg(ctx, colorPalette.bg); // Update Particle models to new position particles.map((p) => { return updateParticleModel(p); }); // Draw em' particles.forEach((p) => { drawParticle(p.x, p.y, p.r, p.c); }); // Play the same song? Ok! window.requestAnimFrame(frame); }; // Click listener document.body.addEventListener("click", function (event) { var x = event.clientX, y = event.clientY; cleanUpArray(); initParticles(config.particleNumber, x, y); }); // First Frame frame(); // First particle explosion initParticles(config.particleNumber);
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>SVG动画与星座-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号