coloured border experiment
This commit is contained in:
@@ -3,6 +3,7 @@ const range = require('lodash/range');
|
||||
const countBy = require('lodash/countBy');
|
||||
const without = require('lodash/without');
|
||||
const { connect } = require('preact-redux');
|
||||
const { removeTier } = require('../utils');
|
||||
|
||||
const shapes = require('./shapes');
|
||||
const actions = require('../actions');
|
||||
@@ -282,8 +283,29 @@ function Vbox(args) {
|
||||
return combinerChange(combiner);
|
||||
}
|
||||
|
||||
const source = itemInfo.combos.filter(c => c.item === removeTier(v));
|
||||
const colours = itemSource => {
|
||||
if (!itemSource || !itemSource.length) return '';
|
||||
if (itemSource[0].components[0] === 'Blue') {
|
||||
if (itemSource[0].components[1] === 'Red') return 'red-blue-border';
|
||||
if (itemSource[0].components[1] === 'Green') return 'blue-green-border';
|
||||
if (itemSource[0].components[1] === 'Blue') return 'blue-border';
|
||||
}
|
||||
if (itemSource[0].components[0] === 'Red') {
|
||||
if (itemSource[0].components[1] === 'Red') return 'red-border';
|
||||
if (itemSource[0].components[1] === 'Green') return 'red-green-border';
|
||||
if (itemSource[0].components[1] === 'Blue') return 'red-blue-border';
|
||||
}
|
||||
if (itemSource[0].components[0] === 'Green') {
|
||||
if (itemSource[0].components[1] === 'Red') return 'red-green-border';
|
||||
if (itemSource[0].components[1] === 'Green') return 'green-border';
|
||||
if (itemSource[0].components[1] === 'Blue') return 'blue-green-border';
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
const highlighted = combiner.indexOf(i) > -1;
|
||||
const classes = `${highlighted ? 'highlight' : ''}`;
|
||||
const classes = `${highlighted ? 'highlight' : colours(source)}`;
|
||||
if (shapes[v]) {
|
||||
return (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user