Skip to content

Commit

Permalink
Don't use marching ants for use-active, add a lofi mode where instanc…
Browse files Browse the repository at this point in the history
…es don't have art
  • Loading branch information
serprex committed Mar 24, 2018
1 parent 7e48ace commit 542f535
Show file tree
Hide file tree
Showing 4 changed files with 302 additions and 349 deletions.
8 changes: 4 additions & 4 deletions etg.js
Expand Up @@ -21,13 +21,13 @@ const adrtbl = new Uint16Array([
]);
exports.getAdrenalRow = function(x) {
x |= 0;
var sign = (x > 0) - (x < 0);
const sign = (x > 0) - (x < 0);
x = Math.abs(x);
if (x > 15) return '';
var row = adrtbl[x],
let row = adrtbl[x],
atks = row & 7,
ret = '';
for (var i = 0; i < atks; i++) {
for (let i = 0; i < atks; i++) {
row >>= 3;
ret += (i ? ', ' : '') + (row & 7) * sign;
}
Expand All @@ -39,7 +39,7 @@ exports.countAdrenaline = function(x) {
};
exports.calcAdrenaline = function(y, dmg) {
if (y < 2) return dmg;
var row = adrtbl[Math.abs(dmg)];
const row = adrtbl[Math.abs(dmg)];
if (y - 2 >= (row & 7)) return 0;
return ((row >> ((y - 1) * 3)) & 7) * ((dmg > 0) - (dmg < 0));
};
Expand Down
19 changes: 8 additions & 11 deletions ui.css
Expand Up @@ -129,20 +129,17 @@ input[type="text"],input[type="password"],input[type="number"],input:not([type])
background-color:#222;
}
@keyframes animatedShiny {
0% { filter: hue-rotate(90deg) }
100% { filter: hue-rotate(270deg) }
0% { filter:hue-rotate(90deg) }
100% { filter:hue-rotate(270deg) }
}
@keyframes ants { to { background-position: 100% 100% } }
@keyframes ants { to { background-position:100% 100% } }
.ants-red {
background: linear-gradient(#fff, #fff) padding-box,
background:linear-gradient(#fff, #fff) padding-box,
repeating-linear-gradient(-45deg, red 0, red 25%, #fff 0, #fff 50%) 0 / .6em .6em;
animation: ants 8s linear infinite;
}
.ants-black {
background: linear-gradient(#fff, #fff) padding-box,
repeating-linear-gradient(-45deg, #000 0, #000 25%, #fff 0, #fff 50%) 0 / .6em .6em;
animation: ants 8s linear infinite;
animation:ants 8s linear infinite;
}
.ants-black { border:2px #fff solid!important }
.ants-light { border:2px #000 solid!important }
.shiny {
animation: animatedShiny 8s linear infinite alternate-reverse;
animation:animatedShiny 8s linear infinite alternate-reverse;
}
217 changes: 101 additions & 116 deletions views/MainMenu.js
Expand Up @@ -136,6 +136,7 @@ module.exports = connect(({opts}) => ({
offline: opts.offline,
selectedDeck: opts.selectedDeck,
disableTut: opts.disableTut,
lofiArt: opts.lofiArt,
}))(class MainMenu extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -761,10 +762,19 @@ module.exports = connect(({opts}) => ({
sock.userEmit('passchange', { p: changePass.value });
}
}
const wipe = h('input', {
type: 'button',
value: 'Wipe Account',
onClick: function() {
mainc.push(
<div className='bgbox'
style={{
position: 'absolute',
left: '585px',
top: '380px',
width: '267px',
height: '156px',
}}>
<input
type='button'
value='Wipe Account'
onClick={() => {
if (self.props.foename == sock.user.name + 'yesdelete') {
logout('delete');
} else {
Expand All @@ -775,128 +785,103 @@ module.exports = connect(({opts}) => ({
'System',
);
}
},
onMouseOver: mkSetTip(
}}
onMouseOver={mkSetTip(
'Click here to permanently remove your account',
),
style: {
)}
style={{
position: 'absolute',
left: '184px',
top: '123px',
},
}),
changePass = h('input', {
placeholder: 'New Password',
onKeyPress: function(e) {
top: '8px',
}}
/>
<input
placeholder='New Password'
onKeyPress={(e) => {
if (e.which == 13) changeFunc();
},
style: {
}}
style={{
position: 'absolute',
left: '8px',
top: '8px',
},
}),
changeBtn = h('input', {
type: 'button',
value: 'Change Pass',
onClick: changeFunc,
style: {
}}
/>
<input
type='button'
value='Change Pass'
onClick={changeFunc}
style={{
position: 'absolute',
left: '184px',
top: '8px',
},
}),
enableSound = h(
'label',
{
style: {
position: 'absolute',
left: '8px',
top: '53px',
},
},
h('input', {
type: 'checkbox',
ref: function(ctrl) {
ctrl && options.register('enableSound', ctrl);
},
onChange: soundChange,
}),
'Enable sound',
),
enableMusic = h(
'label',
{
style: {
position: 'absolute',
left: '135px',
top: '53px',
},
},
h('input', {
type: 'checkbox',
ref: function(ctrl) {
ctrl && options.register('enableMusic', ctrl);
},
onChange: musicChange,
}),
'Enable music',
),
hideRightpane = h(
'label',
{
style: {
position: 'absolute',
left: '8px',
top: '88px',
},
},
h('input', {
type: 'checkbox',
ref: function(ctrl) {
ctrl && options.register('hideRightpane', ctrl);
},
onChange: hideRightpaneChange,
}),
'Hide rightpane',
),
disableTut = h(
'label',
{
style: {
position: 'absolute',
left: '8px',
top: '123px',
},
},
h('input', {
type: 'checkbox',
checked: this.props.disableTut,
onChange: e => this.props.dispatch(store.setOpt('disableTut', e.target.checked)),
}),
'Disable tutorial',
);
mainc.push(
h(
'div',
{
className: 'bgbox',
style: {
position: 'absolute',
left: '585px',
top: '380px',
width: '267px',
height: '156px',
},
},
wipe,
changePass,
enableSound,
enableMusic,
hideRightpane,
disableTut,
),
);
}}
/>
<label
style={{
position: 'absolute',
left: '8px',
top: '53px',
}}>
<input
type='checkbox'
ref={(ctrl) => ctrl && options.register('enableSound', ctrl)}
onChange={soundChange}
/>
Enable sound
</label>
<label
style={{
position: 'absolute',
left: '135px',
top: '53px',
}}>
<input
type='checkbox'
ref={(ctrl) => ctrl && options.register('enableMusic', ctrl)}
onChange={musicChange}
/>
Enable music
</label>
<label
style={{
position: 'absolute',
left: '8px',
top: '88px',
}}>
<input
type='checkbox'
ref={(ctrl) => ctrl && options.register('hideRightpane', ctrl)}
onChange={hideRightpaneChange}
/>
Hide rightpane
</label>
<label
style={{
position: 'absolute',
left: '8px',
top: '123px',
}}>
<input
type='checkbox'
checked={this.props.disableTut}
onChange={e => this.props.dispatch(store.setOpt('disableTut', e.target.checked))}
/>
Disable tutorial
</label>
<label
style={{
position: 'absolute',
left: '135px',
top: '123px',
}}>
<input
type='checkbox'
checked={this.props.lofiArt}
onChange={e => this.props.dispatch(store.setOpt('lofiArt', e.target.checked))}
/>
Lofi Art
</label>
</div>);
}
return h('div', { className: 'bg_main' }, ...mainc);
}
Expand Down

0 comments on commit 542f535

Please sign in to comment.