Mahjong Tile Card
A card shaped like a mahjong tile with intricate engraved patterns. Hovering tilts the tile to reveal its carved depth and shadow. Clicking flips the tile like in a real game, revealing the opposite face with the matching suit symbol.
Mahjong Tile Card
by FreeCsStyles Dev's
CardsSpin / Rotation / Flip
🌐HTML/CSS🎨Tailwind⚛️React💚Vue🅰️Angular🔥Svelte☁️LWC
#mahjong#tile#game#chinese#board-game#flip#engraved#traditional#suit#ivory
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/mahjong-tile-card.
<iframe src="/embed/mahjong-tile-card" sandbox="allow-scripts" loading="lazy" title="Mahjong Tile Card" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Mahjong Tile Card, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<div class="mahjong-tile-card">
<div class="mahjong-tile">
<div class="tile-carved">
<div class="tile-suit">🀄</div>
<div class="tile-value">中</div>
</div>
<div class="tile-back">
<div class="tile-suit">🀆</div>
<div class="tile-value">發</div>
</div>
</div>
<div class="mahjong-content">
<div class="mahjong-title">Mahjong Tile</div>
<div class="mahjong-sub">Red Dragon</div>
</div>
</div>CSS
.mahjong-tile-card { position: relative; width: 220px; min-height: 290px; border-radius: 8px; background: linear-gradient(160deg, #1a1814, #0e0c08); border: 1.5px solid rgba(200,180,150,0.12); overflow: hidden; cursor: pointer; perspective: 500px; }
.mahjong-tile-card:hover { box-shadow: 0 0 30px rgba(200,180,150,0.06); }
.mahjong-tile { position: absolute; left: 50%; top: 35%; transform: translate(-50%,-50%) rotateX(0deg); width: 70px; height: 90px; border-radius: 6px; background: linear-gradient(145deg, #f0e8d8, #d8ccb8); border: 1px solid rgba(180,160,130,0.3); transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.mahjong-tile-card:hover .mahjong-tile { transform: translate(-50%,-50%) rotateX(15deg) rotateY(10deg); }
.mahjong-tile-card.flipped .mahjong-tile { transform: translate(-50%,-50%) rotateY(180deg); }
.tile-carved, .tile-back { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; backface-visibility: hidden; }
.tile-back { transform: rotateY(180deg); }
.tile-suit { font-size: 28px; }
.tile-value { font-size: 14px; font-weight: 700; color: #333; }
.mahjong-content { position: absolute; inset-x: 0; bottom: 0; padding: 16px; background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); }
.mahjong-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.mahjong-sub { font-size: 9px; color: rgba(200,180,150,0.5); }Tailwind CSS
<div class="group relative w-[220px] min-h-[290px] rounded-lg bg-gradient-to-b from-[#1a1814] to-[#0e0c08] border border-amber-800/20 overflow-hidden cursor-pointer [perspective:500px] group-hover:shadow-[0_0_30px_rgba(200,180,150,0.06)]">
<div class="absolute left-1/2 top-[35%] -translate-x-1/2 -translate-y-1/2 w-[70px] h-[90px] rounded-md bg-gradient-to-br from-amber-100 to-amber-200 border border-amber-700/30 [transform-style:preserve-3d] transition-transform duration-500 group-hover:[transform:translate(-50%,-50%)_rotateX(15deg)_rotateY(10deg)] group-[.flipped]:[transform:translate(-50%,-50%)_rotateY(180deg)] shadow-lg">
<div class="absolute inset-0 flex flex-col items-center justify-center [backface-visibility:hidden]">
<span class="text-[28px]">🀄</span>
<span class="text-sm font-bold text-gray-800">中</span>
</div>
<div class="absolute inset-0 flex flex-col items-center justify-center [backface-visibility:hidden] [transform:rotateY(180deg)]">
<span class="text-[28px]">🀆</span>
<span class="text-sm font-bold text-gray-800">發</span>
</div>
</div>
<div class="absolute inset-x-0 bottom-0 p-4 bg-gradient-to-t from-black/70 to-transparent">
<p class="text-sm font-bold text-white/90">Mahjong Tile</p>
<p class="text-[9px] text-amber-600/50">Red Dragon</p>
</div>
</div>React
import React, { useState } from 'react';
import { motion } from 'framer-motion';
export function MahjongTileCard({ width = 220 }) {
const [flipped, setFlipped] = useState(false);
const [isHovered, setIsHovered] = useState(false);
return (
<div onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
<motion.div onClick={() => setFlipped(!flipped)} whileTap={{ scale: 0.97 }} className="relative cursor-pointer" style={{ width }}>
<motion.div className="relative rounded-lg overflow-hidden" style={{ minHeight: 290, background: 'linear-gradient(160deg, #1a1814, #0e0c08)', border: '1.5px solid rgba(200,180,150,0.12)' }}>
<motion.div className="absolute left-1/2 top-[35%] -translate-x-1/2 -translate-y-1/2" style={{ width: 70, height: 90, perspective: 500 }}>
<motion.div className="w-full h-full rounded-md" style={{ background: 'linear-gradient(145deg, #f0e8d8, #d8ccb8)', border: '1px solid rgba(180,160,130,0.3)', transformStyle: 'preserve-3d', boxShadow: '0 4px 12px rgba(0,0,0,0.3)' }}
animate={{ rotateX: isHovered && !flipped ? 15 : 0, rotateY: flipped ? 180 : (isHovered ? 10 : 0) }}
transition={{ type: 'spring', stiffness: 200, damping: 18 }}>
<motion.div className="absolute inset-0 flex flex-col items-center justify-center" style={{ backfaceVisibility: 'hidden' }}>
<span className="text-[28px]">🀄</span>
<span className="text-sm font-bold" style={{ color: '#333' }}>中</span>
</motion.div>
<motion.div className="absolute inset-0 flex flex-col items-center justify-center" style={{ backfaceVisibility: 'hidden', transform: 'rotateY(180deg)' }}>
<span className="text-[28px]">🀆</span>
<span className="text-sm font-bold" style={{ color: '#333' }}>發</span>
</motion.div>
</motion.div>
</motion.div>
<div className="absolute inset-x-0 bottom-0 p-4" style={{ background: 'linear-gradient(0deg, rgba(0,0,0,0.7), transparent)' }}>
<p className="text-sm font-bold" style={{ color: 'rgba(255,255,255,0.9)' }}>Mahjong Tile</p>
<p className="text-[9px]" style={{ color: 'rgba(200,180,150,0.5)' }}>{flipped ? 'Green Dragon' : 'Red Dragon'}</p>
</div>
</motion.div>
</motion.div>
</div>
);
}Where Mahjong Tile Card fits
- Game Cards
- Mahjong UI
- Board Game Interfaces
- Tile Displays
- Traditional Game Apps
Interaction states & animations
- Tile tilt reveal
- Engraving shadow cast
- Flip to opposite face
- Suit symbol swap
- Carved depth highlight
Topics
- #mahjong
- #tile
- #game
- #chinese
- #board-game
- #flip
- #engraved
- #traditional
- #suit
- #ivory
Accessibility notes
Tile flip animation may be disorienting. prefers-reduced-motion shows both faces side by side. Screen reader announces tile suit and value.
Browser support
- Chrome 76+
- Firefox 90+
- Safari 13+
- Edge 79+