Fix bugs on random server-side generation

parent 0b86c342
Pipeline #1486 passed with stage
in 40 seconds
......@@ -44,10 +44,10 @@ app.use(function(req, res, next) {
if (req.query.target === 'randomize') {
req.args.bgColor = bgColors[Math.floor(Math.random() * bgColors.length)];
do {
req.args.fgColor = bgColors[Math.floor(Math.random() * fgColors.length)];
req.args.fgColor = fgColors[Math.floor(Math.random() * fgColors.length)];
} while (req.args.fgColor === req.args.bgColor);
req.args.text = _(sampleTexts[Math.floor(Math.random() * sampleTexts.length)]);
req.args.font = _fonts[Math.floor(Math.random() * _fonts.length)];
req.args.font = _fonts[Math.ceil(Math.random() * _fonts.length)];
req.args.icon = Math.ceil(Math.random() * 36);
req.args.signature = _(sampleSignatures[Math.floor(Math.random() * sampleSignatures.length)]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment