modified: index.html
modified: js/qlpycon.js
This commit is contained in:
@ -74,9 +74,9 @@
|
||||
</div>
|
||||
<h4 class="">git clone (edge):</h4>
|
||||
<div class="qlpyconcodeblock">
|
||||
<p class="qlpyconcode">git clone https://git.6bit.ch/xbl/qlpycon.git</p>
|
||||
<p class="qlpyconcode">cd qlpycon</p>
|
||||
<p class="qlpyconcode">chmod u+x install.sh</p>
|
||||
<p class="qlpyconcode">git clone https://git.6bit.ch/xbl/qlpycon.git && \</p>
|
||||
<p class="qlpyconcode">cd qlpycon && \</p>
|
||||
<p class="qlpyconcode">chmod u+x install.sh && \</p>
|
||||
<p class="qlpyconcode">./install.sh</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
};
|
||||
|
||||
var colorizedNames = {
|
||||
'anarki': '<span style="color:#f00">a</span><span style="color:#0f0">n</span><span style="color:#ff0">a</span><span style="color:#09f">r</span><span style="color:#0cc">k</span><span style="color:#f0f">i</span>'
|
||||
'anarki': '<span style="color:#f00">A</span><span style="color:#0f0">n</span><span style="color:#ff0">a</span><span style="color:#09f">r</span><span style="color:#0cc">k</span><span style="color:#f0f">i</span>'
|
||||
};
|
||||
|
||||
function colorizeSpectator(name) {
|
||||
@ -122,8 +122,8 @@
|
||||
function sp(c, t) { return '<span class="' + c + '">' + t + '</span>'; }
|
||||
function pad(n) { return n < 10 ? '0' + n : '' + n; }
|
||||
function ts() {
|
||||
var b = 33*60 + 34 + elapsed;
|
||||
return '[' + pad(Math.floor(b/3600)) + ':' + pad(Math.floor((b%3600)/60)) + ':' + pad(b%60) + ']';
|
||||
var d = new Date();
|
||||
return '<span style="color:#ff0">[</span>' + '<span style="color:#fff">' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds()) + '</span>' + '<span style="color:#ff0">]</span>';
|
||||
}
|
||||
|
||||
function kill() {
|
||||
@ -140,7 +140,7 @@
|
||||
sp('plain', ' with the ') +
|
||||
(function(w){
|
||||
var weaponColors = {
|
||||
'Rocket Launcher':'#f33',
|
||||
'Rocket Launcher':'#f00',
|
||||
'Plasma Gun':'#f0f',
|
||||
'Railgun':'#0f0',
|
||||
'Lightning Gun':'#ff0',
|
||||
|
||||
199
html/snek.html
199
html/snek.html
@ -1,199 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>6bit.ch | Snek</title>
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png"/>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="author" type="text/plain" href="humans.txt">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script type="text/javascript" src="js/hearts.js"></script>
|
||||
</head>
|
||||
<body style="background-color:#101010;">
|
||||
<div class="main">
|
||||
<section class=headerimg>
|
||||
<a href="https://6bit.ch"><img src="img/6bitnobg.png"></a>
|
||||
</section>
|
||||
<div class="col left">
|
||||
<section class="navblock">
|
||||
<h4>🏡 here</h4>
|
||||
<ul><li><a href=https://git.6bit.ch/xbl>🐐 Goat</a></li></ul>
|
||||
<ul><li><a class=active href=https://6bit.ch/snek.html>🐍 Snek</a></li></ul>
|
||||
<ul><li><a href=https://6bit.ch/things.html>🎨 Things</a></li></ul>
|
||||
<ul><li><a href=https://6bit.ch/slamp.html>💡 slamp</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
<section class="navblock">
|
||||
<h4>✨ there</h4>
|
||||
<ul><li><a href=https://hardbrugg.ch target=_blank>📽️ Hardbrugg.ch</a></li></ul>
|
||||
<ul><li><a href=https://ravemitherz.li target=_blank>💗 RAVEmitHerz.li</a></li></ul>
|
||||
<ul><li><a href=https://rumpelkist.li target=_blank>🛸 Rumpelkist.li</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
<section class="navblock">
|
||||
<h4>👭 everywhere</h4>
|
||||
<ul><li><a href=https://ausliebemusik.ch target=_blank>Aus Liebe</a></li></ul>
|
||||
<ul><li><a href=https://instagram.com/catcallsofzrh target=_blank>Catcalls of Zurich</a></li></ul>
|
||||
<ul><li><a href=https://marcp.xyz target=_blank>cramp</a></li></ul>
|
||||
<ul><li><a href=https://le-lan.ch target=_blank>LeLAN</a></li></ul>
|
||||
<ul><li><a href=https://jar.band target=_blank>JAR</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
</div>
|
||||
<div class="col right">
|
||||
<canvas width="640" height="320" id="game" class="snake-box"></canvas>
|
||||
<script>
|
||||
|
||||
var canvas = document.getElementById('game');
|
||||
var context = canvas.getContext('2d');
|
||||
|
||||
var grid = 8;
|
||||
var count = 8;
|
||||
|
||||
var snake = {
|
||||
x: 160,
|
||||
y: 160,
|
||||
|
||||
// snake velocity. moves one grid length every frame in either the x or y direction
|
||||
dx: grid,
|
||||
dy: 0,
|
||||
|
||||
// keep track of all grids the snake body occupies
|
||||
cells: [],
|
||||
|
||||
// length of the snake. grows when eating an apple
|
||||
maxCells: 4
|
||||
};
|
||||
var apple = {
|
||||
x: 320,
|
||||
y: 160,
|
||||
};
|
||||
|
||||
// get random whole numbers in a specific range
|
||||
// @see https://stackoverflow.com/a/1527820/2124254
|
||||
function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min)) + min;
|
||||
}
|
||||
|
||||
// game loop
|
||||
function loop() {
|
||||
requestAnimationFrame(loop);
|
||||
|
||||
// slow game loop to 15 fps instead of 60 (60/15 = 4)
|
||||
if (++count < 11) {
|
||||
return;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
context.clearRect(0,0,canvas.width,canvas.height);
|
||||
|
||||
context.font = '9px sans-serif';
|
||||
context.fillText(snake.maxCells, 500, 75);
|
||||
|
||||
// move snake by it's velocity
|
||||
snake.x += snake.dx;
|
||||
snake.y += snake.dy;
|
||||
|
||||
// wrap snake position horizontally on edge of screen
|
||||
if (snake.x < 0) {
|
||||
snake.x = canvas.width - grid;
|
||||
}
|
||||
else if (snake.x >= canvas.width) {
|
||||
snake.x = 0;
|
||||
}
|
||||
|
||||
// wrap snake position vertically on edge of screen
|
||||
if (snake.y < 0) {
|
||||
snake.y = canvas.height - grid;
|
||||
}
|
||||
else if (snake.y >= canvas.height) {
|
||||
snake.y = 0;
|
||||
}
|
||||
|
||||
// keep track of where snake has been. front of the array is always the head
|
||||
snake.cells.unshift({x: snake.x, y: snake.y});
|
||||
|
||||
// remove cells as we move away from them
|
||||
if (snake.cells.length > snake.maxCells) {
|
||||
snake.cells.pop();
|
||||
}
|
||||
|
||||
// draw apple
|
||||
context.fillStyle = 'cyan';
|
||||
context.fillRect(apple.x, apple.y, grid-1, grid-1);
|
||||
|
||||
// draw snake one cell at a time
|
||||
context.fillStyle = 'magenta';
|
||||
snake.cells.forEach(function(cell, index) {
|
||||
|
||||
// drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
|
||||
context.fillRect(cell.x, cell.y, grid-1, grid-1);
|
||||
|
||||
// snake ate apple
|
||||
if (cell.x === apple.x && cell.y === apple.y) {
|
||||
snake.maxCells++;
|
||||
|
||||
// canvas is 400x400 which is 25x25 grids
|
||||
apple.x = getRandomInt(0, 25) * grid;
|
||||
apple.y = getRandomInt(0, 25) * grid;
|
||||
}
|
||||
|
||||
// check collision with all cells after this one (modified bubble sort)
|
||||
for (var i = index + 1; i < snake.cells.length; i++) {
|
||||
|
||||
// snake occupies same space as a body part. reset game
|
||||
if (cell.x === snake.cells[i].x && cell.y === snake.cells[i].y) {
|
||||
snake.x = 160;
|
||||
snake.y = 160;
|
||||
snake.cells = [];
|
||||
snake.maxCells = 4;
|
||||
snake.dx = grid;
|
||||
snake.dy = 0;
|
||||
|
||||
apple.x = getRandomInt(0, 25) * grid;
|
||||
apple.y = getRandomInt(0, 25) * grid;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// listen to keyboard events to move the snake
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// prevent snake from backtracking on itself by checking that it's
|
||||
// not already moving on the same axis (pressing left while moving
|
||||
// left won't do anything, and pressing right while moving left
|
||||
// shouldn't let you collide with your own body)
|
||||
|
||||
// left arrow key
|
||||
if (e.which === 37 && snake.dx === 0) {
|
||||
snake.dx = -grid;
|
||||
snake.dy = 0;
|
||||
}
|
||||
// up arrow key
|
||||
else if (e.which === 38 && snake.dy === 0) {
|
||||
snake.dy = -grid;
|
||||
snake.dx = 0;
|
||||
}
|
||||
// right arrow key
|
||||
else if (e.which === 39 && snake.dx === 0) {
|
||||
snake.dx = grid;
|
||||
snake.dy = 0;
|
||||
}
|
||||
// down arrow key
|
||||
else if (e.which === 40 && snake.dy === 0) {
|
||||
snake.dy = grid;
|
||||
snake.dx = 0;
|
||||
}
|
||||
});
|
||||
|
||||
// start the game
|
||||
requestAnimationFrame(loop);
|
||||
</script>
|
||||
<p>Arrow keys required.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="" class="footer">
|
||||
<p>Gmacht mit 🔮 z'Züri. | <a href=humans.txt>humans.txt</a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
153
html/snek.js
153
html/snek.js
@ -1,153 +0,0 @@
|
||||
<script>
|
||||
|
||||
var snekStarted = false;
|
||||
document.querySelector('#snek-details').addEventListener('toggle', function(e) {
|
||||
if (e.target.open && !snekStarted) {
|
||||
snekStarted = true;
|
||||
|
||||
var canvas = document.getElementById('game');
|
||||
var context = canvas.getContext('2d');
|
||||
|
||||
var grid = 8;
|
||||
var count = 8;
|
||||
|
||||
var snake = {
|
||||
x: 160,
|
||||
y: 160,
|
||||
|
||||
// snake velocity. moves one grid length every frame in either the x or y direction
|
||||
dx: grid,
|
||||
dy: 0,
|
||||
|
||||
// keep track of all grids the snake body occupies
|
||||
cells: [],
|
||||
|
||||
// length of the snake. grows when eating an apple
|
||||
maxCells: 4
|
||||
};
|
||||
var apple = {
|
||||
x: 320,
|
||||
y: 160,
|
||||
};
|
||||
|
||||
// get random whole numbers in a specific range
|
||||
// @see https://stackoverflow.com/a/1527820/2124254
|
||||
function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min)) + min;
|
||||
}
|
||||
|
||||
// game loop
|
||||
function loop() {
|
||||
requestAnimationFrame(loop);
|
||||
|
||||
// slow game loop to 15 fps instead of 60 (60/15 = 4)
|
||||
if (++count < 11) {
|
||||
return;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
context.clearRect(0,0,canvas.width,canvas.height);
|
||||
|
||||
context.font = '9px sans-serif';
|
||||
context.fillText(snake.maxCells, 500, 75);
|
||||
|
||||
// move snake by it's velocity
|
||||
snake.x += snake.dx;
|
||||
snake.y += snake.dy;
|
||||
|
||||
// wrap snake position horizontally on edge of screen
|
||||
if (snake.x < 0) {
|
||||
snake.x = canvas.width - grid;
|
||||
}
|
||||
else if (snake.x >= canvas.width) {
|
||||
snake.x = 0;
|
||||
}
|
||||
|
||||
// wrap snake position vertically on edge of screen
|
||||
if (snake.y < 0) {
|
||||
snake.y = canvas.height - grid;
|
||||
}
|
||||
else if (snake.y >= canvas.height) {
|
||||
snake.y = 0;
|
||||
}
|
||||
|
||||
// keep track of where snake has been. front of the array is always the head
|
||||
snake.cells.unshift({x: snake.x, y: snake.y});
|
||||
|
||||
// remove cells as we move away from them
|
||||
if (snake.cells.length > snake.maxCells) {
|
||||
snake.cells.pop();
|
||||
}
|
||||
|
||||
// draw apple
|
||||
context.fillStyle = 'cyan';
|
||||
context.fillRect(apple.x, apple.y, grid-1, grid-1);
|
||||
|
||||
// draw snake one cell at a time
|
||||
context.fillStyle = 'magenta';
|
||||
snake.cells.forEach(function(cell, index) {
|
||||
|
||||
// drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
|
||||
context.fillRect(cell.x, cell.y, grid-1, grid-1);
|
||||
|
||||
// snake ate apple
|
||||
if (cell.x === apple.x && cell.y === apple.y) {
|
||||
snake.maxCells++;
|
||||
|
||||
// canvas is 400x400 which is 25x25 grids
|
||||
apple.x = getRandomInt(0, 25) * grid;
|
||||
apple.y = getRandomInt(0, 25) * grid;
|
||||
}
|
||||
|
||||
// check collision with all cells after this one (modified bubble sort)
|
||||
for (var i = index + 1; i < snake.cells.length; i++) {
|
||||
|
||||
// snake occupies same space as a body part. reset game
|
||||
if (cell.x === snake.cells[i].x && cell.y === snake.cells[i].y) {
|
||||
snake.x = 160;
|
||||
snake.y = 160;
|
||||
snake.cells = [];
|
||||
snake.maxCells = 4;
|
||||
snake.dx = grid;
|
||||
snake.dy = 0;
|
||||
|
||||
apple.x = getRandomInt(0, 25) * grid;
|
||||
apple.y = getRandomInt(0, 25) * grid;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// listen to keyboard events to move the snake
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// prevent snake from backtracking on itself by checking that it's
|
||||
// not already moving on the same axis (pressing left while moving
|
||||
// left won't do anything, and pressing right while moving left
|
||||
// shouldn't let you collide with your own body)
|
||||
|
||||
// left arrow key
|
||||
if (e.which === 37 && snake.dx === 0) {
|
||||
snake.dx = -grid;
|
||||
snake.dy = 0;
|
||||
}
|
||||
// up arrow key
|
||||
else if (e.which === 38 && snake.dy === 0) {
|
||||
snake.dy = -grid;
|
||||
snake.dx = 0;
|
||||
}
|
||||
// right arrow key
|
||||
else if (e.which === 39 && snake.dx === 0) {
|
||||
snake.dx = grid;
|
||||
snake.dy = 0;
|
||||
}
|
||||
// down arrow key
|
||||
else if (e.which === 40 && snake.dy === 0) {
|
||||
snake.dy = grid;
|
||||
snake.dx = 0;
|
||||
}
|
||||
});
|
||||
|
||||
// start the game
|
||||
requestAnimationFrame(loop);
|
||||
}
|
||||
</script>
|
||||
151
html/things.html
151
html/things.html
@ -1,151 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>6bit.ch | Things</title>
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png"/>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="author" type="text/plain" href="humans.txt">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="js/sparks.js"></script>
|
||||
<script type="text/javascript" src="js/hearts.js"></script>
|
||||
</head>
|
||||
<body style="background-color:#101010;">
|
||||
<div class="main">
|
||||
<div id="starshine">
|
||||
<div class="template shine"></div>
|
||||
</div>
|
||||
<section class=headerimg>
|
||||
<a href="https://6bit.ch"><img src="img/6bitnobg.png"></a>
|
||||
</section>
|
||||
<div class="col left">
|
||||
<section class="navblock">
|
||||
<h4>🏡 here</h4>
|
||||
<ul><li><a href=https://git.6bit.ch/xbl>🐐 Goat</a></li></ul>
|
||||
<ul><li><a href=https://6bit.ch/snek.html>🐍 Snek</a></li></ul>
|
||||
<ul><li><a class=active href=https://6bit.ch/things.html>🎨 Things</a></li></ul>
|
||||
<ul><li><a href=https://6bit.ch/slamp.html>💡 slamp</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
<section class="navblock">
|
||||
<h4>✨ there</h4>
|
||||
<ul><li><a href=https://hardbrugg.ch target=_blank>📽️ Hardbrugg.ch</a></li></ul>
|
||||
<ul><li><a href=https://ravemitherz.li target=_blank>💗 RAVEmitHerz.li</a></li></ul>
|
||||
<ul><li><a href=https://rumpelkist.li target=_blank>🛸 Rumpelkist.li</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
<section class="navblock">
|
||||
<h4>👭 everywhere</h4>
|
||||
<ul><li><a href=https://ausliebemusik.ch target=_blank>Aus Liebe</a></li></ul>
|
||||
<ul><li><a href=https://instagram.com/catcallsofzrh target=_blank>Catcalls of Zurich</a></li></ul>
|
||||
<ul><li><a href=https://marcp.xyz target=_blank>cramp</a></li></ul>
|
||||
<ul><li><a href=https://le-lan.ch target=_blank>LeLAN</a></li></ul>
|
||||
<ul><li><a href=https://jar.band target=_blank>JAR</a></li></ul>
|
||||
</section>
|
||||
</br>
|
||||
</div>
|
||||
<div class="col right">
|
||||
<section class=contentindexart>
|
||||
<div class=artitem>
|
||||
<a href=art/clicktoris.png target=_blank><img src=art/clicktoris.png></a>
|
||||
<p>clicktoris.org</p>
|
||||
<p class=artdesc>image, logo</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/hb.png target=_blank><img src=art/hb.png></a>
|
||||
<p>Hardbrugg.ch</p>
|
||||
<p class=artdesc>image, logo</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/lelogo.png target=_blank><img src=art/lelogo.png></a>
|
||||
<p>LeLAN</p>
|
||||
<p class=artdesc>image, logo</p>
|
||||
</div>
|
||||
<div class=break></div>
|
||||
<div class=artitem>
|
||||
<a href=art/raverave.png target=_blank><img src=art/raverave.png></a>
|
||||
<p>RAVE Rave</p>
|
||||
<p class=artdesc>image, postcard</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/rerave.png target=_blank><img src=art/rerave.png></a>
|
||||
<p>RAVE Re-Rave</p>
|
||||
<p class=artdesc>image, postcard</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/fbn.png target=_blank><img src=art/fbn.png></a>
|
||||
<p>RAVE Fernbedienung Nebel</p>
|
||||
<p class=artdesc>image, postcard</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/bsin.png target=_blank><img src=art/bsin.png></a>
|
||||
<p>RAVE Blazerstuhl des Lebens</p>
|
||||
<p class=artdesc>image, postcard</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/dgk.png target=_blank><img src=art/dgk.png></a>
|
||||
<p>RAVE Durchgangskonzept</p>
|
||||
<p class=artdesc>image, postcard</p>
|
||||
</div>
|
||||
<div class=break></div>
|
||||
<div class=artitem>
|
||||
<a href=art/ccofz.png target=_blank><img src=art/ccofz.png></a>
|
||||
<p>C of Z</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/1312.png target=_blank><img src=art/1312.png></a>
|
||||
<p>Gleis 1312</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/grzh.png target=_blank><img src=art/grzh.png></a>
|
||||
<p>GrZH</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/plan.png target=_blank><img src=art/plan.png></a>
|
||||
<p>planlos</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/viv.png target=_blank><img src=art/viv.png></a>
|
||||
<p>ViV</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/zbb.png target=_blank><img src=art/zbb.png></a>
|
||||
<p>ZBB</p>
|
||||
<p class=artdesc>image, sticker</p>
|
||||
</div>
|
||||
<div class=break></div>
|
||||
<div class=artitem>
|
||||
<a href=art/alho100.png target=_blank><img src=art/alho100.png></a>
|
||||
<p>AlHo100</p>
|
||||
<p class=artdesc>image, money</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/donot.png target=_blank><img src=art/donot.png></a>
|
||||
<p>don't blender</p>
|
||||
<p class=artdesc>image, 3d</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=https://www.youtube.com/watch?v=lMSjd6HNQdY target=_blank><img src=art/eve.png></a>
|
||||
<p>EVE Online FaLiHSS (2006)</p>
|
||||
<p class=artdesc>video, youtube</p>
|
||||
</div>
|
||||
<div class=artitem>
|
||||
<a href=art/pp.pdf target=_blank><img src=art/pp.png></a>
|
||||
<p>Postparade</p>
|
||||
<p class=artdesc>pdf, text</p>
|
||||
</div>
|
||||
</br>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div id="" class="footer">
|
||||
<p>Gmacht mit 🔮 z'Züri. | <a href=humans.txt>humans.txt</a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user