JSFiddle - React, Tailwind, and code Playground
by ckissi
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
<div class="flex justify-end items-end fixed z-50 w-screen h-screen">
<div id="popup" class="bg-white p-6 rounded-md shadow popup">
<!-- Your popup content goes here -->
<h2 class="text-lg font-bold mb-4">Welcome to our website!</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
</body>
</html>
CSS
.popup {
right: 20px;
bottom: -400px;
transition: bottom 0.5s;
}
.popup.open {
bottom: 20px;
}
JavaScript
window.addEventListener('DOMContentLoaded', (event) => {
const popup = document.getElementById('popup');
popup.classList.add('open');
});