fix mobile click to open links
This commit is contained in:
parent
37650b764d
commit
ad93f47e00
1 changed files with 7 additions and 2 deletions
|
|
@ -23,6 +23,12 @@ function TetrisPiece({ piece, isDark }) {
|
||||||
if (!isCV) setColor(null);
|
if (!isCV) setColor(null);
|
||||||
setShowText(false);
|
setShowText(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleClick = () => {
|
||||||
|
if (piece.link) {
|
||||||
|
window.open(piece.link, '_blank', 'noopener,noreferrer');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const bgColor = piece.label === 'cv' ? piece.color : piece.color;
|
const bgColor = piece.label === 'cv' ? piece.color : piece.color;
|
||||||
const rowDelay = piece.startY * 4;
|
const rowDelay = piece.startY * 4;
|
||||||
|
|
@ -45,7 +51,6 @@ function TetrisPiece({ piece, isDark }) {
|
||||||
inset: 0,
|
inset: 0,
|
||||||
backgroundColor: color || bgColor,
|
backgroundColor: color || bgColor,
|
||||||
transition: 'background-color 0.15s ease',
|
transition: 'background-color 0.15s ease',
|
||||||
pointerEvents: 'none',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const textStyle = {
|
const textStyle = {
|
||||||
|
|
@ -59,7 +64,6 @@ function TetrisPiece({ piece, isDark }) {
|
||||||
opacity: alwaysShowText ? 1 : (showText ? 1 : 0),
|
opacity: alwaysShowText ? 1 : (showText ? 1 : 0),
|
||||||
transition: 'opacity 0.15s ease, color 0.15s ease',
|
transition: 'opacity 0.15s ease, color 0.15s ease',
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
pointerEvents: 'none',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const className = 'tetris-piece show';
|
const className = 'tetris-piece show';
|
||||||
|
|
@ -108,6 +112,7 @@ function TetrisPiece({ piece, isDark }) {
|
||||||
style={containerStyle}
|
style={containerStyle}
|
||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href={piece.link}
|
href={piece.link}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue