Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqdorte/artegenerativafoda.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function defaultArgs() {
}

function setup() {
createCanvas(window.innerWidth-4, window.innerHeight-4);
createCanvas(window.innerWidth, window.innerHeight);
defaultArgs();
r = -100;
};
Expand Down
2 changes: 1 addition & 1 deletion sqdorte/generarstistic.js → sqdorte/generartistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var s;
var p;

function setup() {
createCanvas(window.innerWidth-4, window.innerHeight-4);
createCanvas(window.innerWidth, window.innerHeight);

l = 15; // length
s = 30; // spacing
Expand Down
9 changes: 5 additions & 4 deletions sqdorte/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>plzkillme</title>
<style> body {padding: 0; margin: 0;} </style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js"></script>
<script src="generarstistic.js"></script>
<title id="title">:: sqdorte ::</title>
<link id="style" rel="stylesheet" type="text/css" href="style.css">
<script id="script" src="menu.js"></script>
</head>
<body>
<ul id="ul">
</ul>
</body>
</html>
31 changes: 0 additions & 31 deletions sqdorte/jooj.js

This file was deleted.

36 changes: 36 additions & 0 deletions sqdorte/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
window.onload = function() {

arts = ['artegenerativafoda', 'generartistic', 'selgnairt'];
ul = document.getElementById('ul');

arts.forEach(art => {
a = document.createElement('A');
a.setAttribute('onclick', `loadArt('${art}')`)
a.innerHTML = art

li = document.createElement('LI');
li.appendChild(a);

ul.appendChild(li);
})
}

function injectScript(src) {
script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = src;
document.head.appendChild(script);
}

function loadArt(name) {
document.title = name;
document.body.removeChild(document.getElementById('ul'));

document.getElementById('style').setAttribute('href', 'p5.css');

injectScript(`${name}.js`);
injectScript('https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.min.js');

document.head.removeChild(document.getElementById('script'));
}
11 changes: 11 additions & 0 deletions sqdorte/p5.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
html, body {
height: 100%;
}

body {
padding: 0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
53 changes: 0 additions & 53 deletions sqdorte/plzkillme.js

This file was deleted.

29 changes: 29 additions & 0 deletions sqdorte/selgnairt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function setup() {
createCanvas(windowWidth, windowHeight);

fill(0);
frameRate(30);
j = 0;

s = Math.floor(Math.random()*100+20); // spacing
}


function draw() {
if (j <= height) {

for (var i = 0; i <= width; i += s) {
triangle(
i,j,
i+(Math.random() <= 0.5 ? 1 : -1)*s,
j+(Math.random() <= 0.5 ? 1 : -1)*s,
i+(Math.random() <= 0.5 ? 1 : -1)*s,
j+(Math.random() <= 0.5 ? 1 : -1)*s
)
}

if ( i >= width ) {
j += s;
}
}
}
19 changes: 19 additions & 0 deletions sqdorte/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ul {
list-style: none;
text-align: center;
}

li {
padding-top: 30px;
}

a {
outline: none;
color: #4c4d4f;
text-decoration: none;
}

a:hover {
font-weight: bold;
color: #8fefb2;
}