Added social meta; a bit of cleaning
This commit is contained in:
34
js/main.js
34
js/main.js
@@ -1,4 +1,4 @@
|
||||
// Loads the IFrame Player API code asynchronously.
|
||||
// Loads the Youtube IFrame Player API code asynchronously.
|
||||
let tag = document.createElement('script');
|
||||
tag.src = 'https://www.youtube.com/iframe_api';
|
||||
let firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
@@ -213,14 +213,36 @@ function fetch_bandcamp_url(url) {
|
||||
console.log('scrap: ' + scrap);
|
||||
}
|
||||
|
||||
// Thumbnails: https://i1.ytimg.com/vi/{trackID}/mqdefault.jpg
|
||||
|
||||
// Converts values from 0-255 to 00-ff
|
||||
function componentToHex(c) {
|
||||
var hex = c.toString(16);
|
||||
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 doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
// doc.title; doc.body;
|
||||
@@ -233,6 +255,11 @@ let bcURL = 'https://clett.bandcamp.com/track/placenta';
|
||||
// console.log(Http.responseText)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// -----------------------------------
|
||||
// BACKGROUND
|
||||
// -----------------------------------
|
||||
let areStarsShooting = true;
|
||||
let shootingStarWrapper = document.getElementsByClassName('shooting-stars-wrapper')[0];
|
||||
let shootingStar;
|
||||
@@ -299,6 +326,7 @@ document.getElementById('shooting-stars-enable').addEventListener('click', () =>
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Enable/disable shooting stars (with P5JS background)
|
||||
// if (typeof processingSketch !== 'undefined') {
|
||||
// let separatorSpan = document.createElement('span');
|
||||
|
@@ -1,24 +0,0 @@
|
||||
// Avoid `console` errors in browsers that lack a console.
|
||||
(function() {
|
||||
var method;
|
||||
var noop = function () {};
|
||||
var methods = [
|
||||
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
|
||||
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
|
||||
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
|
||||
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
|
||||
];
|
||||
var length = methods.length;
|
||||
var console = (window.console = window.console || {});
|
||||
|
||||
while (length--) {
|
||||
method = methods[length];
|
||||
|
||||
// Only stub undefined methods.
|
||||
if (!console[method]) {
|
||||
console[method] = noop;
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
// Place any jQuery/helper plugins in here.
|
Reference in New Issue
Block a user