Bounce In Modal Card
CSS
Hard
4 views
Problem Description
Create a modal-like card that bounces in.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes with scale and translate.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
@keyframes pop { 0% { transform: translateY(12px) scale(0.96); opacity: 0; } 60% { transform: translateY(-4px) scale(1.02); opacity: 1; } 100% { transform: translateY(0) scale(1); } }
.backdrop { min-height: 100vh; display: grid; place-items: center; background: rgba(0,0,0,0.06); padding: 16px; }
.modal { width: min(92%, 420px); border-radius: 16px; background: #fff; border: 1px solid #eee; padding: 16px; animation: pop 420ms ease; }
</style>
</head>
<body>
<div class='backdrop'>
<div class='modal'>
<h2>meetcode</h2>
<p>Welcome back.</p>
</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!