master
manetta 5 years ago
parent b93aa67fdf
commit df3cf418da

@ -16,7 +16,8 @@ body {
vertical-align: top;
padding: 5px;
font-size: 14px;
background-image: -webkit-gradient(linear, left top, left bottom, from(yellow), to(gold));
background-image: -webkit-gradient(linear, left top, left bottom, from(#02b38d), to(#07d2c4));
/*background-image: -webkit-gradient(linear, left top, left bottom, from(yellow), to(gold));*/
}
#cnn .button_container {
display: inline-block;

@ -28,6 +28,13 @@
// Find categories that this page is part of
var categories = findCategories(data);
if ( categories.length > 0 && categories.length < 2){
//if we have only one category we add another one at random
var keys = Object.keys(data)
keys.splice(categories[1], 1)
categories.push(keys[Math.floor(Math.random() * keys.length)])
}
// Select a pseudo-randomised category for buttonA
var buttonA = categories[Math.floor(Math.random() * categories.length)];
document.querySelectorAll('#buttonA button')[0].textContent = buttonA;
@ -81,4 +88,4 @@
<link rel="stylesheet" type="text/css" href="https://issue.xpub.nl/08/cnn/cnn.css">\
<!-- END CNN -->'
insertCNN(cnn_template);
insertCNN(cnn_template);

Loading…
Cancel
Save