visual production for new EP release by Digital Selves (https://lwlsn.github.io/digitalselves-web/) commissioned by Cherche Encore (http://cherche-encore.info/).
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
303 lines
8.3 KiB
303 lines
8.3 KiB
//--------------------------------------------------------------------------
|
|
// CHOREOGRAPHIC CODE by Joana Chicau
|
|
//--------------------------------------------------------------------------
|
|
|
|
|
|
// errors we live by
|
|
|
|
// trial and error
|
|
// margin of error
|
|
// https://upload.wikimedia.org/wikipedia/commons/a/a9/Empirical_Rule.PNG
|
|
// printing error messages;
|
|
|
|
// creating a loop for changing text in all headings
|
|
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
|
|
|
|
var delay="1";
|
|
var count='0';
|
|
var tempo="500";
|
|
var elements = document.getElementsByTagName("a")
|
|
|
|
var textarray = [
|
|
"ヽ(´∇´)ノ (∇´ノ) ヽ( )ノ (ヽ´∇) ヽ(´∇`)ノ \ (^_^ ) ノ",
|
|
"(。・・。) 401 Unauthorized",
|
|
" 402 Payment Required 💸 💱 (゜゜)",
|
|
" (゚ρ゚; 403 Forbidden",
|
|
" 404 Not Found ヾ(´・ ・`。)ノ” ",
|
|
" 406 Not Acceptable ⊙ ﹏ ⊙",
|
|
" what error? ʍɥɐʇ ǝɹɹoɹ¿ what error? ʍɥɐʇ ǝɹɹoɹ¿",
|
|
" 408 Request Timeout ☼☼¸.•*",
|
|
"(─‿─) (─‿‿─) (─‿─) (─‿‿─) 409 Conflict (─‿─) (─‿‿─) (─‿─) (─‿‿─)",
|
|
"ˏ 𓏧 𓏲 𓏲 𓏲 𓋒 410 Gone 𓏲 𓏲 𓏲 𓏲 𓏧 ˎ",
|
|
"415 Unsupported Media Type (◔_◔)",
|
|
" ━━━━━━━ 416 Range ▼△▼△▼△▼ Not ▼△▼△▼△▼ Satisfiable ━━━━━━━ ",
|
|
" 417 Expectation ٩( ∩_∩ )۶ Failed (¸.꒳.¸) ",
|
|
" 418 I'm a teapot ☕ the server refuses the attempt to brew coffee with a teapot.",
|
|
"425 ⏰ ⌛ ⏱️ Too Early ⏱️ ⌛ ⏰ ・.⋆。⋆☂˚。⋆。˚☽˚。⋆",
|
|
"【☆】★【☆】★【426 Upgrade Required】★【☆】★【☆】",
|
|
"。°。°。°。°。°。°。°。°。°。°。° 429 Too Many Requests 。°。°。°。°。°。°。°。°。°。°。°",
|
|
"⤹⋆⸙͎۪۫。˚۰˚ 451 Unavailable For Legal Reasons˚⁀➷。˚⸙͎۪۫⋆ ༄ ",
|
|
"■ □ ■ □ ■ □ ■ □ 502 Bad Gateway ■ □ ■ □ ■ □ ■",
|
|
"‿︵‿︵‿︵‿ 508 Loop Detected ︵‿︵‿︵‿︵",
|
|
"○ꊞ○ꊞ○ꊞ○ꊞ○ꊞ 507 Insufficient Storage ꊞ○ꊞ○ꊞ○ꊞ○ꊞ○",
|
|
" 100 Continue ♪ ● ☽ ♩ ○ ♬ ☆ ༝̩̩̥͙ ",
|
|
"٩(✿∂‿∂✿)۶ 200 OK ✿ ✿ ✿ ✿ ✿ "
|
|
];
|
|
|
|
//textarray.push(" ♪ ♪ ♪ ┌(・ 。・)┘ ♩♪ ♫ ♬");
|
|
|
|
|
|
function wonder02() {
|
|
var rannum= Math.floor(Math.random()*textarray.length);
|
|
for (var i = 0; i < elements.length; i++) {
|
|
elements[i].innerHTML = textarray[rannum];
|
|
}
|
|
timer = setTimeout("wonder()", delay*tempo);
|
|
}
|
|
// clearTimeout(timer);
|
|
|
|
function wonder() {
|
|
document.querySelector('#stage02').innerHTML = textarray[count];
|
|
count++;
|
|
if(count==textarray.length){count='0';}
|
|
setTimeout("wonder()",6000);
|
|
}
|
|
wonder()
|
|
|
|
// - - - - - - - - INPUT Errors - - - - - - - -
|
|
|
|
// <p>Please input a number between 5 and 10:</p>
|
|
// <input id="demo" type="text">
|
|
// <button type="button" onclick="myFunction()">Test Input</button>
|
|
// <p id="p01"></p>
|
|
|
|
function myFunction() {
|
|
const message = document.getElementById("p01");
|
|
message.innerHTML = "";
|
|
let x = document.getElementById("demo").value;
|
|
try {
|
|
if(x == "") throw "empty";
|
|
if(isNaN(x)) throw "not a number";
|
|
x = Number(x);
|
|
if(x < 5) throw "too low";
|
|
if(x > 10) throw "too high";
|
|
}
|
|
catch(err) {
|
|
message.innerHTML = "Input is " + err;
|
|
}
|
|
}
|
|
|
|
// - - - - - - - - JavaScript Errors - - - - - - - -
|
|
|
|
$(document).ready(function(){
|
|
if (typeof console != "undefined")
|
|
if (typeof console.log != 'undefined')
|
|
console.olog = console.log;
|
|
else
|
|
console.olog = function() {};
|
|
|
|
console.log = function(message) {
|
|
console.olog(message);
|
|
$('#err').append(message);
|
|
// $('#err').append('<span>' + message + '</span>');
|
|
};
|
|
console.error = console.debug = console.info = console.log
|
|
});
|
|
|
|
|
|
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
|
var string = msg.toLowerCase();
|
|
var substring = 'script error';
|
|
if (string.indexOf(substring) > -1){
|
|
alert('Script Error: See Browser Console for Detail');
|
|
} else {
|
|
var message = [
|
|
'Message: ' + msg,
|
|
'URL: ' + url,
|
|
'Line: ' + lineNo,
|
|
'Column: ' + columnNo,
|
|
'Error object: ' + JSON.stringify(error)
|
|
].join(' - ');
|
|
|
|
alert(message);
|
|
console.log(message);
|
|
}
|
|
|
|
return false;
|
|
};
|
|
/*
|
|
|
|
let num = 1;
|
|
a = y + 1;
|
|
let ran = 1;
|
|
|
|
try {
|
|
// Type Error
|
|
num.toUpperCase();
|
|
// Reference Error
|
|
a = y + 1;
|
|
// Syntax Error
|
|
eval("alert('Hello)");
|
|
// Range Error
|
|
ran.toPrecision(500);
|
|
} catch (error) {
|
|
|
|
switch (true) {
|
|
case (error instanceof ForbiddenError): {
|
|
document.getElementById("err").innerHTML = error.name + "<br>" + error.message;
|
|
console.log();
|
|
break;
|
|
}
|
|
case (error instanceof SyntaxError): {
|
|
document.getElementById("err").innerHTML = error.name + "<br>" + error.message;
|
|
console.log();
|
|
break;
|
|
}
|
|
case (error instanceof RangeError): {
|
|
document.getElementById("err").innerHTML = error.name + "<br>" + error.message;
|
|
console.log();
|
|
break;
|
|
}
|
|
default: {
|
|
document.getElementById("err").innerHTML = error.name + "<br>" + error.message;
|
|
console.log();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// Reference Error
|
|
|
|
|
|
let a = 5;
|
|
try {
|
|
a = y + 1; // thrown if you use (reference) a variable that has not been declared
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML = err.name;
|
|
}
|
|
|
|
// Syntax Error
|
|
try {
|
|
eval("alert('Hello)"); // Missing ' will produce an error
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML = err.name;
|
|
}
|
|
|
|
//
|
|
try {
|
|
hello("world(s)!");
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML =
|
|
err.name + "<br>" + err.message;
|
|
}
|
|
|
|
// URI (Uniform Resource Identifier) Error
|
|
try {
|
|
decodeURI("%%%"); // You cannot URI decode percent signs
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML = err.name;
|
|
}
|
|
|
|
// Type Error
|
|
let num = 1;
|
|
try {
|
|
num.toUpperCase(); // You cannot convert a number to upper case
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML = err.name;
|
|
}
|
|
|
|
// Range Error
|
|
let ran = 1;
|
|
try {
|
|
ran.toPrecision(500); // A number cannot have 500 significant digits
|
|
}
|
|
catch(err) {
|
|
document.getElementById("err").innerHTML = err.name;
|
|
}
|
|
*/
|
|
|
|
function Breathing() {
|
|
var zooming = document.querySelector("body");
|
|
currentScale = 1;
|
|
currenttime = setInterval(function() {
|
|
zooming.style.transform="scale(" + currentScale + ")";
|
|
currentScale = Math.random() * 5
|
|
}, 800);
|
|
}
|
|
|
|
function No_Breathing() {
|
|
clearInterval(currenttime);
|
|
}
|
|
|
|
|
|
// background: radial-gradient(ellipse at center, #0000FF, #E6E6FA 10%, #0000FF);
|
|
// background: linear-gradient(#fff, #0000FF 100%, #fff 10%)
|
|
// transform: matrix3d(1, 1, 0, 0, 10, 1, 0, 10, 10, 0, 1, 0, 200, 10, 0, 1);
|
|
|
|
|
|
function Breathing02() {
|
|
var zooming = document.querySelector("body");
|
|
numb = 1;
|
|
currenttime = setInterval(function() {
|
|
zooming.style.backgroundSize = numb + "%";
|
|
numb = Math.random() * 500;
|
|
}, 800);
|
|
}
|
|
|
|
|
|
|
|
var x = document.getElementsByTagName("div");
|
|
var counter = 1000;
|
|
var i;
|
|
function Breathing03 () {
|
|
for (i = 0; i < x.length; i++) {
|
|
// x[i].style.opacity = Math.random() * 2;
|
|
x[i].style.transform = "scaleY(" + Math.random() * 5 + ")";
|
|
x[i].style.transition = "all 1s ease-in-out";
|
|
window.setTimeout(Breathing03, counter);
|
|
}
|
|
};
|
|
setTimeout(Breathing03, 1000);
|
|
|
|
|
|
|
|
|
|
function Breathing(){
|
|
var x = document.getElementsByTagName("div");
|
|
var i;
|
|
for (i = 0; i < x.length; i++) {
|
|
x[i].style.transform = "scaleY(" + Math.random() * 5 + ")";
|
|
x[i].style.transition = "all 1s ease-in-out";
|
|
}
|
|
}
|
|
// clearInterval(timer);
|
|
// timer = setInterval(Breathing, 2000);
|
|
|
|
|
|
function noBreathing() {
|
|
clearInterval(currenttime);
|
|
clearInterval(thistime);
|
|
}
|
|
|
|
|
|
|
|
|
|
// document.querySelector("body").style.border="solid #000 0rem"
|
|
// document.querySelector("body").style.borderRadius="30rem"
|
|
// document.querySelector("body").style.background="linear-gradient(70deg, Aquamarine, MistyRose, Blue, Plum, WhiteSmoke, LightYellow)"
|
|
// document.querySelector("html").style.backgroundColor="black"
|
|
|
|
function skin () {
|
|
currenttime = setInterval(function() {
|
|
document.querySelector("body").style.background = "linear-gradient(" + Math.floor(Math.random() * 1000) + "deg, var(--color-pink), var(--color-yel), var(--color-blue), var(--color-gray))";
|
|
}, 800);
|
|
}
|
|
|
|
|