forked from external-repos/LifeTrinket
wip tailwind
This commit is contained in:
@@ -1,43 +1,17 @@
|
||||
import styled, { css } from 'styled-components';
|
||||
import { twc } from 'react-twc';
|
||||
import { Skull } from '../../Icons/generated';
|
||||
import { Rotation } from '../../Types/Player';
|
||||
import { RotationDivProps } from './CommanderDamage';
|
||||
|
||||
export const LoseButton = styled.button<{ $rotation: Rotation }>`
|
||||
position: absolute;
|
||||
flex-grow: 1;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
top: 25%;
|
||||
right: 15%;
|
||||
background-color: #43434380;
|
||||
border-radius: 8px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
user-select: none;
|
||||
-moz-user-select: -moz-none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
z-index: 1;
|
||||
const LoseButton = twc.div<RotationDivProps>((props) => [
|
||||
'absolute flex-grow border-none outline-none cursor-pointer bg-interface-loseButton-background rounded-lg select-none z-[1] webkit-user-select-none',
|
||||
|
||||
${(props) => {
|
||||
if (props.$rotation === Rotation.SideFlipped) {
|
||||
return css`
|
||||
right: auto;
|
||||
top: 15%;
|
||||
left: 27%;
|
||||
rotate: ${props.$rotation}deg;
|
||||
`;
|
||||
} else if (props.$rotation === Rotation.Side) {
|
||||
return css`
|
||||
right: auto;
|
||||
top: 15%;
|
||||
left: 27%;
|
||||
rotate: ${props.$rotation - 180}deg;
|
||||
`;
|
||||
}
|
||||
}}
|
||||
`;
|
||||
props.$rotation === Rotation.SideFlipped
|
||||
? `right-auto top-[15%] left-[27%] rotate-[${props.$rotation}deg]`
|
||||
: props.$rotation === Rotation.Side
|
||||
? `right-auto top-[15%] left-[27%] rotate-[${props.$rotation - 180}deg]`
|
||||
: 'right-[15%] top-1/4',
|
||||
]);
|
||||
|
||||
type LoseButtonProps = {
|
||||
onClick: () => void;
|
||||
|
||||
Reference in New Issue
Block a user