coloured border experiment

This commit is contained in:
Mashy 2019-10-15 16:05:58 +10:00
parent 1c611c31e9
commit b2e4570bfb
2 changed files with 41 additions and 1 deletions

View File

@ -139,6 +139,24 @@ button, input {
color: @gray-focus;
border-color: @gray-focus;
}
&.red-border {
font-z-color: @red;
}
&.blue-border {
border-color: @blue;
}
&.green-border {
border-color: @green;
}
&.red-blue-border {
border-image: linear-gradient(to right, @red 50%, @blue 50%) 5;
}
&.red-green-border {
border-image: linear-gradient(to right, @red 50%, @green 50%) 5;
}
&.blue-green-border {
border-image: linear-gradient(to right, @blue 50%, @green 50%) 5;
}
}
a {

View File

@ -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