假黑客攻击过程界面效果代码
代码语言:html
所属分类:布局界面
代码描述:假黑客攻击过程界面效果代码,模拟黑客红客进行防御攻击界面
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(http://themes.googleusercontent.com/static/fonts/sourcecodepro/v4/mrl8jkM18OlOQN8JLgasDxM0YzuT7MdOe03otPbuUS0.woff) format('woff');
}
body {
font-family: Source Code Pro;
background:#000;
color: #00FF00;
margin:0;
font-size: 13px;
}
canvas {
position:absolute;
top:0;
left:0;
}
.bars-and-stuff{
left:66.6%;
}
.output-console {
position:fixed;
overflow:hidden;
}
p{margin:0}
</style>
</head>
<body translate="no" >
<canvas class='hacker-3d-shiz'></canvas>
<canvas class='bars-and-stuff'></canvas>
<div class="output-console"></div>
<script>
var canvas = document.querySelector(".hacker-3d-shiz"),
ctx = canvas.getContext("2d"),
canvasBars = document.querySelector(".bars-and-stuff"),
ctxBars = canvasBars.getContext("2d"),
outputConsole = document.querySelector(".output-console");
canvas.width = window.innerWidth / 3 * 2;
canvas.height = window.innerHeight / 3;
canvasBars.width = window.innerWidth / 3;
canvasBars.height = canvas.height;
outputConsole.style.height = window.innerHeight / 3 * 2 + 'px';
outputConsole.style.top = window.innerHeight / 3 + 'px';
/* Graphics stuff */
function Square(z) {
this.width = canvas.width / 2;
if (canvas.height < 200) {
this.width = 200;
};
this.height = canvas.height;
z = z || 0;
this.points = [
new Point({
x: canvas.width / 2 - this.width,
y: canvas.height / 2 - this.height,
z: z }),
new Point({
x: canvas.width / 2 + this.width,
y: canvas.height / 2 - this.height,
z: z }),
new Point({
x: canvas.width / 2 + this.width,
y: canvas.height / 2 + this.height,
z: z }),
new Point({
x: canvas.width / 2 - this.width,
y: canvas.height / 2 + this.height,
z: z })];
this.dist = 0;
}
Square.prototype.update = function () {
for (var p = 0; p < this.points.length; p++) {
this.points[p].rotateZ(0.001);
this.points[p].z -= 3;
if (this.points[p].z < -300) {
this.points[p].z = 2700;
}
this.points[p].map2D();
}
};
Square.prototype.render = function () {
ctx.beginPath();
ctx.moveTo(this.points[0].xPos, this.points[0].yPos);
for (var p = 1; p < this.points.length; p++) {
if (this.points[p].z > -(focal - 50)) {
ctx.lineTo(this.points.........完整代码请登录后点击上方下载按钮下载查看
网友评论0