Browse Source

Update 'digitalselves-scripts.js'

master
JoanaChicau 3 years ago
parent
commit
d192733e65
  1. 266
      digitalselves-scripts.js

266
digitalselves-scripts.js

@ -2,94 +2,103 @@
// CHOREOGRAPHIC CODE by Joana Chicau // CHOREOGRAPHIC CODE by Joana Chicau
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// THEME
// errors we live by // errors we live by
// margin(s) and errors
// ACTIONS
// document.getElementById("type").value = "2000"
// click()
// timeArray = setInterval("errorList()",6000);
// clearInterval(timeArray);
// timeStretch = setInterval(stretching, 3000);
// clearInterval(timeStretch);
// breathing()
// noBreathing()
// on marquee
// transform: matrix3D(-20, -200, 0, -10, 10, 1, 0, 1, 1, 0, 1, 0, 200, 1, 0, 1);
// transform: matrix(1, 2, 50, 3, 4, 1);
// newHTMLskin()
// trial and error // iframe journey starting from:
// margin of error
// https://upload.wikimedia.org/wikipedia/commons/a/a9/Empirical_Rule.PNG // 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
// ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
var delay="1"; var delay="1";
var count='0'; var count='0';
var tempo="500"; var tempo="500";
var elements = document.getElementsByTagName("a")
var textarray = [ var textarray = [
"ヽ(´∇´)ノ (∇´ノ) ヽ(   )ノ (ヽ´∇) ヽ(´∇`)ノ \ (^_^ ) ノ", "ヽ(´∇´)ノ (∇´ノ) ヽ(   )ノ (ヽ´∇) ヽ(´∇`)ノ \ (^_^ ) ノ",
"(。・・。) 401 Unauthorized", "(。・・。) 401 Unauthorized",
" 402 Payment Required 💸 💱 (゜゜)", " 402 Payment Required 💸 💱 ",
" (゚ρ゚; 403 Forbidden", " (゚ρ゚; 403 Forbidden",
" 404 Not Found ヾ(´・ ・`。)ノ” ", " 404 Not Found ヾ(´・ ・`。)ノ” ",
" 406 Not Acceptable ⊙ ﹏ ⊙", " 406 Not Acceptable ⊙ ﹏ ⊙",
" what error? ʍɥɐʇ ǝɹɹoɹ¿ what error? ʍɥɐʇ ǝɹɹoɹ¿",
" 408 Request Timeout ☼☼¸.•*", " 408 Request Timeout ☼☼¸.•*",
"(─‿─) (─‿‿─) (─‿─) (─‿‿─) 409 Conflict (─‿─) (─‿‿─) (─‿─) (─‿‿─)", " 409 Conflict (゜゜)",
"ˏ 𓏧 𓏲 𓏲 𓏲 𓋒 410 Gone 𓏲 𓏲 𓏲 𓏲 𓏧 ˎ", "ˏ 𓏧 𓏲 𓏲 𓏲 𓋒 410 Gone 𓏲 𓏲 𓏲 𓏲 𓏧 ˎ",
"415 Unsupported Media Type (◔_◔)", "415 Unsupported Media Type (◔_◔)",
" ━━━━━━━ 416 Range ▼△▼△▼△▼ Not ▼△▼△▼△▼ Satisfiable ━━━━━━━ ", " △ 416 Range ▼ △ ▼ Not △ ▼ △ Satisfiable ▼ ",
" 417 Expectation ٩( ∩_∩ )۶ Failed (¸.꒳.¸) ", " 417 Expectation ٩( ∩_∩ )۶ Failed (¸.꒳.¸) ",
" 418 I'm a teapot ☕ the server refuses the attempt to brew coffee with a teapot.", " 418 I'm a teapot ☕ the server refuses the attempt to brew coffee with a teapot.",
"425 ⏰ ⌛ ⏱️ Too Early ⏱️ ⌛ ⏰ ・.⋆。⋆☂˚。⋆。˚☽˚。⋆", " 425 ⏰ ⌛ ⏱️ Too Early ⏱️ ⌛ ⏰ ・.⋆。⋆☂˚。⋆。˚☽˚。⋆",
"【☆】★【☆】★【426 Upgrade Required】★【☆】★【☆】", "【☆】★【☆】★【 426 Upgrade Required 】★【☆】★【☆】",
"。°。°。°。°。°。°。°。°。°。°。° 429 Too Many Requests 。°。°。°。°。°。°。°。°。°。°。°", "。°。°。°。°。°。°。°。 429 °。°。 Too °。° Many 。°。 Requests 。°。°。°。°。°。°。°。",
"⤹⋆⸙͎۪۫。˚۰˚ 451 Unavailable For Legal Reasons˚⁀➷。˚⸙͎۪۫⋆ ༄ ", "⤹ ⸙͎۪۫ 。۰˚ 451 Unavailable For Legal Reasons ˚ 。˚⸙͎۪۫⋆ ༄ ",
"■ □ ■ □ ■ □ ■ □ 502 Bad Gateway ■ □ ■ □ ■ □ ■", "■ □ ■ □ ■ 502 Bad Gateway ■ □ ■ □ ■",
"‿︵‿︵‿︵‿ 508 Loop Detected ︵‿︵‿︵‿︵", "‿︵‿︵‿︵‿ 508 Loop Detected ︵‿︵‿︵‿︵",
"○ꊞ○ꊞ○ꊞ○ꊞ○ꊞ 507 Insufficient Storage ꊞ○ꊞ○ꊞ○ꊞ○ꊞ○", "○ꊞ○ꊞ○ꊞ○ꊞ○ꊞ 507 Insufficient Storage ꊞ○ꊞ○ꊞ○ꊞ○ꊞ○",
" 100 Continue ♪ ● ☽ ♩ ○ ♬ ☆ ༝̩̩̥͙ ", " 100 Continue ♪ ● ☽ ♩ ○ ♬ ☆ ༝̩̩̥͙ ",
"٩(✿∂‿∂✿)۶ 200 OK ✿ ✿ ✿ ✿ ✿ " "٩(✿∂‿∂✿)۶ 200 OK ✿ ✿ ✿ "
]; ];
//textarray.push(" ♪ ♪ ♪ ┌(・ 。・)┘ ♩♪ ♫ ♬"); //textarray.push(" ♪ ♪ ♪ ┌(・ 。・)┘ ♩♪ ♫ ♬");
function wonder02() { function errorList () {
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]; document.querySelector('#stage02').innerHTML = textarray[count];
count++; count++;
if(count==textarray.length){count='0';} if(count==textarray.length){count='0';}
setTimeout("wonder()",6000);
} }
wonder()
// - - - - - - - - INPUT Errors - - - - - - - -
// <p>Please input a number between 5 and 10:</p> // - - - - - - - - some more * errors * - - - - - - - -
// <input id="demo" type="text">
// <button type="button" onclick="myFunction()">Test Input</button>
// <p id="p01"></p>
function myFunction() {
const message = document.getElementById("p01");
function click() {
const message = document.getElementById("result");
message.innerHTML = ""; message.innerHTML = "";
let x = document.getElementById("demo").value; let x = document.getElementById("type").value;
try { try {
if(x == "") throw "empty"; if(x == "") throw "empty";
if(isNaN(x)) throw "not a number"; if(isNaN(x)) throw "not ━━━━━━━ a number.";
x = Number(x); x = Number(x);
if(x < 5) throw "too low"; if(x < 5) throw "too low (─ ‿ ─) ";
if(x > 10) throw "too high"; if(x > 10 ) throw "too high (・ 。・)/ ";
} }
catch(err) { catch(err) {
message.innerHTML = "Input is " + err; message.innerHTML = "Input is " + err;
} }
} }
// - - - - - - - - JavaScript Errors - - - - - - - -
// - - - - - - - - Print Error Messages - - - - - - - -
$(document).ready(function(){ $(document).ready(function(){
if (typeof console != "undefined") if (typeof console != "undefined")
@ -101,7 +110,7 @@ if (typeof console != "undefined")
console.log = function(message) { console.log = function(message) {
console.olog(message); console.olog(message);
$('#err').append(message); $('#err').append(message);
// $('#err').append('<span>' + message + '</span>'); // $('#err').append('<span>' + message + '</span>');
}; };
console.error = console.debug = console.info = console.log console.error = console.debug = console.info = console.log
}); });
@ -127,105 +136,9 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
return false; 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() { function breathing() {
var zooming = document.querySelector("body"); var zooming = document.querySelector("#stage03");
currentScale = 1; currentScale = 1;
currenttime = setInterval(function() { currenttime = setInterval(function() {
zooming.style.transform="scale(" + currentScale + ")"; zooming.style.transform="scale(" + currentScale + ")";
@ -233,71 +146,32 @@ function Breathing() {
}, 800); }, 800);
} }
function No_Breathing() { function noBreathing() {
clearInterval(currenttime); clearInterval(currenttime);
} }
function newHTMLskin() {
// background: radial-gradient(ellipse at center, #0000FF, #E6E6FA 10%, #0000FF); var element = document.querySelector("body");
// background: linear-gradient(#fff, #0000FF 100%, #fff 10%) element.classList.toggle("move");
// 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);
} }
function remove () {
var divs = document.getElementsByTagName("img"), i;
var x = document.getElementsByTagName("div"); for (i = 0; i < divs.length; ++i) {
var counter = 1000; divs[i].src="";
var i; divs[i].srcset ="";
function Breathing03 () { divs[i].style.background = "linear-gradient(" + Math.floor(Math.random() * 1000) + "deg, #000000, blue, #ececec)";
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(){ function stretching (){
var x = document.getElementsByTagName("div"); var x = document.getElementsByTagName("div");
var i; var i;
for (i = 0; i < x.length; i++) { for (i = 0; i < x.length; i++) {
x[i].style.transform = "scaleY(" + Math.random() * 5 + ")"; x[i].style.transform = "scaleY(" + Math.random() * 4 + ")";
x[i].style.transition = "all 1s ease-in-out"; x[i].style.transition = "all 1s ease-in-out";
} }
} }
// clearInterval(timer); // clearInterval(timeStretch);
// timer = setInterval(Breathing, 2000); // timeStretch = setInterval(stretching, 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);
}

Loading…
Cancel
Save