initial commit
This commit is contained in:
9
afkscreen2/index.html
Normal file
9
afkscreen2/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
<script src="./scripts/bg.js"> </script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas class="bgmaster" id="bg" name="bg" style="z-index=-5;"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
57
afkscreen2/scripts/bg.js
Normal file
57
afkscreen2/scripts/bg.js
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
var canvas;
|
||||
var ctx;
|
||||
var starPool = new Array();
|
||||
var stop = false;
|
||||
|
||||
|
||||
$(function() {
|
||||
canvas=document.getElementById("bg");
|
||||
ctx = canvas.getContext("2d");
|
||||
|
||||
canvas.width = $(document).width()-20;
|
||||
canvas.height = $(document).height()-20;
|
||||
//starPool[0] = new sparkle(120, 100, false, 0.4);
|
||||
//initiate();
|
||||
//main();
|
||||
//star(ctx,100,100,40,5,0.5);
|
||||
});
|
||||
|
||||
|
||||
var requestAnimFrame = (function(){
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback){
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
})();
|
||||
|
||||
function initiate(){
|
||||
|
||||
}
|
||||
|
||||
function main(){
|
||||
ctx.clearRect(0, 0, $(document).width()-20, $(document).height()-20);
|
||||
callframe();
|
||||
if(stop==true){
|
||||
console.log("ended");
|
||||
}else{
|
||||
requestAnimFrame(main);
|
||||
}
|
||||
}
|
||||
|
||||
function callframe(){
|
||||
//animation goes here...
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function background(){
|
||||
ctx.fillStyle="green";
|
||||
ctx.fillRect(0,canvas.height/5*3,canvas.width,canvas.height/5*2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user