-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
344 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
function oscillate_linear(x1, y1, x2, y2, speed) { | ||
//MATH referance: https://skysmart.ru/articles/mathematic/grafik-linejnoj-funkcii | ||
let a = (y1 - y2) / (x1 - x2) | ||
let b = y1 - a * x1 | ||
let iter = sin(frameCount / speed) | ||
let newX = map(iter, -1, 1, x1, x2) | ||
let newY = a * newX + b | ||
ellipse(newX, newY, random(1,5)) | ||
} | ||
//MATH referance: https://skysmart.ru/articles/mathematic/grafik-linejnoj-funkcii | ||
let a = (y1 - y2) / (x1 - x2) | ||
let b = y1 - a * x1 | ||
let iter = sin(frameCount / speed) | ||
let newX = map(iter, -1, 1, x1, x2) | ||
let newY = a * newX + b | ||
ellipse(newX, newY, random(1, 5)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
const direction = document.location.host === "hanumanum.github.io" ? "/p5experiments/" : ""; | ||
|
||
const pages = [ | ||
{ | ||
url: "art-cardioid", | ||
}, | ||
{ | ||
url: "art-noize-rotating-fans", | ||
} | ||
, | ||
{ | ||
url: "art-constalation", | ||
} | ||
, | ||
{ | ||
url: "art-flower-of-life", | ||
}, | ||
{ | ||
url: "art-arcs", | ||
}, | ||
{ | ||
url: "art-arrows", | ||
}, | ||
{ | ||
url: "art-artificial-alphabets" | ||
}, | ||
{ | ||
url: "art-graph" | ||
}, | ||
{ | ||
url: "art-infection" | ||
}, | ||
{ | ||
url: "art-letter-flower" | ||
} | ||
, | ||
{ | ||
url: "art-letter-flowers" | ||
} | ||
, | ||
{ | ||
url: "art-oscilating-squares" | ||
} | ||
, | ||
{ | ||
url: "art-particles" | ||
} | ||
, | ||
{ | ||
url: "art-light-propagation" | ||
} | ||
, | ||
{ | ||
url: "art-psy-rect-blanding-modes" | ||
} | ||
, | ||
{ | ||
url: "art-text-circle-packing-edges" | ||
} | ||
, | ||
{ | ||
url: "art-text-entropy" | ||
} | ||
, | ||
{ | ||
url: "art-text-flow-fields" | ||
} | ||
/* | ||
{ | ||
url: "art-floating-points" | ||
}*/ | ||
|
||
] | ||
|
||
|
||
const findCurrentIndex = () => { | ||
|
||
const slug = document.location.pathname.split("/").filter((e) => e !== "").pop(); | ||
for (let i = 0; i < pages.length; i++) { | ||
if (pages[i].url === slug) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
|
||
|
||
window.onload = () => { | ||
const currentIndex = findCurrentIndex(); | ||
if (currentIndex === -1) return | ||
if (currentIndex > 0) { | ||
const prev = document.createElement("div"); | ||
prev.id = "go-prev"; | ||
prev.innerHTML = "prev"; | ||
prev.onclick = () => { | ||
document.location.assign(direction + "/" + pages[currentIndex - 1].url); | ||
} | ||
|
||
document.body.appendChild(prev); | ||
} | ||
|
||
|
||
if (currentIndex < pages.length - 1) { | ||
|
||
const next = document.createElement("div"); | ||
|
||
next.id = "go-next"; | ||
next.innerHTML = "next"; | ||
next.onclick = () => { | ||
console.log(pages[currentIndex + 1]); | ||
document.location.assign(direction + "/" + pages[currentIndex + 1].url); | ||
} | ||
|
||
document.body.appendChild(next); | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
canvas{ | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ul li { | ||
list-style-type: none; | ||
cursor: pointer; | ||
display: inline; | ||
border: solid 1px rgb(210, 210, 210); | ||
margin: 0 5px; | ||
padding: 5px; | ||
} | ||
|
||
canvas { | ||
cursor: pointer; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
canvas{ | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Flower of Life</title> | ||
<link rel="stylesheet" href="../sketches-style.css"> | ||
</head> | ||
<body> | ||
<script src="https://cdn.jsdelivr.net/npm/p5@1.2.0/lib/p5.js"></script> | ||
<script src="script.js"></script> | ||
</body> | ||
|
||
<head> | ||
<title>Flower of Life</title> | ||
<meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0> | ||
<link rel="stylesheet" href="../sketches-style.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/p5@1.2.0/lib/p5.js"></script> | ||
<script src="scetch.js"></script> | ||
<script src="../aLib/pagination.js"></script> | ||
</head> | ||
<body> | ||
<h1>Flower Of Life</h1> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.