|
|
@ -1,4 +1,4 @@ |
|
|
|
// Loads the IFrame Player API code asynchronously.
|
|
|
|
// Loads the Youtube IFrame Player API code asynchronously.
|
|
|
|
let tag = document.createElement('script'); |
|
|
|
let tag = document.createElement('script'); |
|
|
|
tag.src = 'https://www.youtube.com/iframe_api'; |
|
|
|
tag.src = 'https://www.youtube.com/iframe_api'; |
|
|
|
let firstScriptTag = document.getElementsByTagName('script')[0]; |
|
|
|
let firstScriptTag = document.getElementsByTagName('script')[0]; |
|
|
@ -213,14 +213,36 @@ function fetch_bandcamp_url(url) { |
|
|
|
console.log('scrap: ' + scrap); |
|
|
|
console.log('scrap: ' + scrap); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Thumbnails: https://i1.ytimg.com/vi/{trackID}/mqdefault.jpg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Converts values from 0-255 to 00-ff
|
|
|
|
function componentToHex(c) { |
|
|
|
function componentToHex(c) { |
|
|
|
var hex = c.toString(16); |
|
|
|
var hex = c.toString(16); |
|
|
|
return hex.length == 1 ? "0" + hex : hex; |
|
|
|
return hex.length == 1 ? "0" + hex : hex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Thumbnails: https://i1.ytimg.com/vi/{trackID}/mqdefault.jpg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let bcURL = 'https://clett.bandcamp.com/track/placenta'; |
|
|
|
// -----------------------------------
|
|
|
|
|
|
|
|
// BANDCAMP Tests
|
|
|
|
|
|
|
|
// -----------------------------------
|
|
|
|
|
|
|
|
// let bcURL = 'https://clett.bandcamp.com/track/placenta';
|
|
|
|
|
|
|
|
// let request = new Request(bcURL);
|
|
|
|
|
|
|
|
// let headers = new Headers({
|
|
|
|
|
|
|
|
// 'X-Requested-With': 'com.bandcamp.android',
|
|
|
|
|
|
|
|
// 'Content-Type': 'application/json',
|
|
|
|
|
|
|
|
// 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9; Unknown Device)',
|
|
|
|
|
|
|
|
// 'Host': 'bandcamp.com',
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// let data;
|
|
|
|
|
|
|
|
// fetch(bcURL, {
|
|
|
|
|
|
|
|
// method: 'GET',
|
|
|
|
|
|
|
|
// headers: headers
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then(response => response.json())
|
|
|
|
|
|
|
|
// .then(data => console.log('data: ' + data));
|
|
|
|
|
|
|
|
// console.log('response: ' + data);
|
|
|
|
|
|
|
|
// console.log('data: ' + data);
|
|
|
|
// let html = async await fetch(bcURL).text(); // html as text
|
|
|
|
// let html = async await fetch(bcURL).text(); // html as text
|
|
|
|
// let doc = new DOMParser().parseFromString(html, 'text/html');
|
|
|
|
// let doc = new DOMParser().parseFromString(html, 'text/html');
|
|
|
|
// doc.title; doc.body;
|
|
|
|
// doc.title; doc.body;
|
|
|
@ -233,6 +255,11 @@ let bcURL = 'https://clett.bandcamp.com/track/placenta'; |
|
|
|
// console.log(Http.responseText)
|
|
|
|
// console.log(Http.responseText)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------
|
|
|
|
|
|
|
|
// BACKGROUND
|
|
|
|
|
|
|
|
// -----------------------------------
|
|
|
|
let areStarsShooting = true; |
|
|
|
let areStarsShooting = true; |
|
|
|
let shootingStarWrapper = document.getElementsByClassName('shooting-stars-wrapper')[0]; |
|
|
|
let shootingStarWrapper = document.getElementsByClassName('shooting-stars-wrapper')[0]; |
|
|
|
let shootingStar; |
|
|
|
let shootingStar; |
|
|
@ -299,6 +326,7 @@ document.getElementById('shooting-stars-enable').addEventListener('click', () => |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Enable/disable shooting stars (with P5JS background)
|
|
|
|
// Enable/disable shooting stars (with P5JS background)
|
|
|
|
// if (typeof processingSketch !== 'undefined') {
|
|
|
|
// if (typeof processingSketch !== 'undefined') {
|
|
|
|
// let separatorSpan = document.createElement('span');
|
|
|
|
// let separatorSpan = document.createElement('span');
|
|
|
|