mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-20 17:57:59 +00:00
small fix
This commit is contained in:
@@ -3,7 +3,7 @@ import './App.css';
|
|||||||
import Counters from './Components/Counters/Counters';
|
import Counters from './Components/Counters/Counters';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Player } from './Types/Player';
|
import { Player } from './Types/Player';
|
||||||
import { initialPlayers } from './Data/initialPlayers';
|
import { initialPlayers } from './Data/getInitialPlayers';
|
||||||
|
|
||||||
const MainWrapper = styled.div`
|
const MainWrapper = styled.div`
|
||||||
width: 100vmax;
|
width: 100vmax;
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ export const CenteredText = styled.div`
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
font-size: 5vmin;
|
font-size: 7vmin;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff,
|
-webkit-text-stroke: 2px #ffffff; /* Add a 2-pixel black stroke */
|
||||||
1px 1px 0 #ffffff;
|
-webkit-text-fill-color: #000000;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Player } from '../../Types/Player';
|
import { Player } from '../../Types/Player';
|
||||||
import * as S from './PlayerMenu.style';
|
import * as S from './PlayerMenu.style';
|
||||||
import { initialPlayers } from '../../Data/initialPlayers';
|
import { initialPlayers } from '../../Data/getInitialPlayers';
|
||||||
|
|
||||||
type SettingsProps = {
|
type SettingsProps = {
|
||||||
player: Player;
|
player: Player;
|
||||||
@@ -40,14 +40,15 @@ const Settings = ({ player, opponents, onChange }: SettingsProps) => {
|
|||||||
opponents.forEach((opponent) => {
|
opponents.forEach((opponent) => {
|
||||||
// Only reset commander damage from the player that is being reset
|
// Only reset commander damage from the player that is being reset
|
||||||
opponent.commanderDamage.forEach((commanderDamage) => {
|
opponent.commanderDamage.forEach((commanderDamage) => {
|
||||||
if (commanderDamage.source === player.key) {
|
if (commanderDamage.source !== player.key) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
opponent.lifeTotal =
|
opponent.lifeTotal =
|
||||||
opponent.lifeTotal +
|
opponent.lifeTotal +
|
||||||
commanderDamage.damageTotal +
|
commanderDamage.damageTotal +
|
||||||
commanderDamage.partnerDamageTotal;
|
commanderDamage.partnerDamageTotal;
|
||||||
commanderDamage.damageTotal = 0;
|
commanderDamage.damageTotal = 0;
|
||||||
commanderDamage.partnerDamageTotal = 0;
|
commanderDamage.partnerDamageTotal = 0;
|
||||||
}
|
|
||||||
});
|
});
|
||||||
onChange(opponent);
|
onChange(opponent);
|
||||||
});
|
});
|
||||||
@@ -56,9 +57,7 @@ const Settings = ({ player, opponents, onChange }: SettingsProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleNewGame = () => {
|
const handleNewGame = () => {
|
||||||
//remove local storage
|
|
||||||
localStorage.removeItem('players');
|
localStorage.removeItem('players');
|
||||||
//reload page
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user