importer v3 coming soon
i intend to add a song randomizer feature which works with existing themes, but also accepts multiple songs as input and picks one randomly...
something like, create an empty array m = []
, add contents of theme's song url t.songURL
to array: if its a string, add the string as the first item, if its an array, extend the empty array with its contents
so in shorthand
typeof t.songURL == 'object' ? t.songURL.forEach(e=>m.push(e)) : m.push(t.songURL)
then get the length l
of this array and pick an item n
from it, where n
is ~~(Math.random()*l)
so
q('#songAudio').src = m[n]
where q()
is shorthand for document.querySelector
now i just have to put it all together and upload it to github.