diff --git a/librehunt.js b/librehunt.js index 45354b1..c73e369 100644 --- a/librehunt.js +++ b/librehunt.js @@ -1,4 +1,5 @@ // actual database for distros can be found in static/distro.db (SQLite3 database) +// TODO change to JSON distros = [['Elementary OS', 0, 0, 1, 'mac', 1, 0, 1, 1, "It's own unique Pantheon desktop", 'elementary', 'https://elementary.io/', 'https://elementary.io/get-involved#funding', @@ -74,6 +75,8 @@ function optionSelected(optionName) { return 0; } + +// generic shuffle function, used to shuffle distros when displayed in the chooser and the distro list function shuffle(a) { var j, x, i; for (i = a.length - 1; i > 0; i--) { @@ -150,15 +153,53 @@ function distro(){ // add card each time in for loop, with distro for (j = 0; j < SelectedDistros.length; j++){ current = SelectedDistros[j]; - document.getElementById("distroFound").innerHTML +='
Distro Logo
'+current[0]+'

'+current[13]+'

Old Hardware Support: '+match[current[14]]+'

Timely Updates: '+match[current[15]]+'

Lookalike: '+match[current[16]]+'

Touch Support: '+match[current[17]]+'

Extreme Security: '+match[current[18]]+'

Popularity and Support: '+match[current[19]]+'

Appearance: '+match[current[20]]+'

WebsiteContribute
'; + document.getElementById("distroFound").innerHTML += + // card div + '
'+ + '
'+ + // distro logo + ''+current[0]+' Logo'+ + '
'+ + // body, including if each category matches or not + '
'+ + '
'+current[0]+'
'+ + '

'+current[13]+'

'+ + '

Old Hardware Support: '+match[current[14]]+'

'+ + '

Timely Updates: '+match[current[15]]+'

'+ + '

Lookalike: '+match[current[16]]+'

'+ + '

Touch Support: '+match[current[17]]+'

'+ + '

Extreme Security: '+match[current[18]]+'

'+ + '

Popularity and Support: '+match[current[19]]+'

'+ + '

Appearance: '+match[current[20]]+'

'+ + 'Website'+ + 'Contribute'+ + '
'+ + // which desktops the distro has + ''+ + '
'; } twemoji.parse(document.body); scroll(0,0); } function distrolist(){ distrolist=shuffle(distros) - console.log(distrolist) for (var i = 0; i < 43; i++){ - document.getElementById("distrolist").innerHTML +='
Card image cap
'+distrolist[i][0]+'

'+distrolist[i][13]+'

WebsiteContribute
' + document.getElementById("distrolist").innerHTML += + // card div + '
'+ + '
'+ + // distro logo + ''+distrolist[i][0]+' logo'+ + '
'+ + // card body, including title, description, website button, and contribution button + '
'+ + '
'+distrolist[i][0]+'
'+ + '

'+distrolist[i][13]+'

'+ + 'Website'+ + 'Contribute'+ + '
'+ + // card body including each desktop in the distro + ''+ + '
' } }