Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views2 pages

Example

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Example

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Teacher's Day Greeting</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #ffcccb;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
flex-direction: column;
}
.envelope-container {
position: relative;
width: 400px;
height: 300px;
display: flex;
justify-content: center;
align-items: center;
}
.envelope {
width: 100%;
height: 100%;
background-color: #fff;
border: 2px solid #000;
position: relative;
overflow: hidden;
}
.flap {
position: absolute;
width: 100%;
height: 50%;
background-color: #fff;
border: 2px solid #000;
top: 0;
transform-origin: top;
transition: transform 0.5s ease;
z-index: 2;
}
.message {
position: absolute;
width: 100%;
height: 100%;
background-color: #fff;
top: 100%;
left: 0;
padding: 20px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
text-align: center;
transform: translateY(0);
transition: transform 0.5s ease;
z-index: 1;
}
.open-button {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 20px;
}
.open-button:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div class="envelope-container">
<div class="envelope">
<div class="flap"></div>
<div class="message">
<h2>Thank you, Teacher <span id="teacher-name"></span>!</h2>
<p>Thanks for teaching me <span id="subject-name"></span>!</p>
</div>
</div>
</div>
<p>You have 1 new message</p>
<button class="open-button" onclick="openEnvelope()">Open</button>

<script>
function openEnvelope() {
document.querySelector('.flap').style.transform = 'rotateX(-180deg)';
document.querySelector('.message').style.transform = 'translateY(-
100%)';
document.querySelector('.open-button').style.display = 'none';
}

// Set the teacher's name and subject dynamically


document.getElementById('teacher-name').textContent = 'Mr. Smith';
document.getElementById('subject-name').textContent = 'Mathematics';
</script>
</body>
</html>

You might also like