[HTML5] 크리스마스카드 페이지
1 분 소요
소스 출처 :: 스파르타 코딩
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2020년-덕분에 행복했어요!</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poor+Story&display=swap" rel="stylesheet">
<meta property="og:image"
content="https://www.christmastreeassociation.org/wp-content/uploads/2016/06/multiple-christmas-trees-in-one-household-800x400.jpg">
<meta property="og:description" content="2020을 추억하며">
<meta property="og:titlte" content="길동이의 카드">
<link rel="shortcut icon" href="https://freepngimg.com/download/christmas/26196-6-christmas-stocking.png">
<script src="https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/snow.js"></script>
<style>
* {
font-family: 'Poor Story', cursive;
}
body {
background-color: #9b070f;
}
.envelope {
background-image: url('https://pngimg.com/uploads/envelope/envelope_PNG18366.png');
background-size: cover;
background-position: center;
width: 200px;
height: 200px;
margin: 200px auto 0px auto;
cursor: pointer;
}
.envelope-msg {
color: white;
text-align: center;
}
.letter-close {
display: block;
}
.letter-open {
display: none;
}
.rtan {
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker+(1).gif');
background-size: cover;
background-position: center;
background-color: white;
margin: 100px auto 0px auto;
border-radius: 100px;
border: 5px solid white;
box-shadow: 0px 0px 10px 0px white;
}
h1 {
text-align: center;
color: white;
margin-top: 30px;
margin-bottom: 30px;
}
.messagebox {
width: 400px;
margin: auto;
font-size: 20px;
line-height: 30px;
background-color: ivory;
color: brown;
padding: 30px;
box-shadow: 0px 0px 10px 0px white;
}
.from {
text-align: right;
margin-top: 20px;
margin-bottom: 0px;
}
@media screen and (max-width: 760px) {
.messagebox {
width: 300px;
font-size: 20px;
line-height: 30px;
padding: 20px;
}
.rtan {
width: 150px;
height: 150px;
margin: 70px auto 0px auto;
}
h1 {
font-size: 28px;
}
.envelope {
margin: 150px auto 0px auto;
}
}
</style>
<script>
function open_letter() {
document.getElementsByClassName("letter-close")[0].style.display = 'none'
document.getElementsByClassName("letter-open")[0].style.display = 'block'
}
function go_rtan() {
alert('앗, 어떻게 찾았지!')
window.location.href="https://spartacodingclub.kr?f_name=%EC%9D%B4%EB%B2%94%EA%B7%9C&f_uid=5f7334e6c8cc246ea1e3c529"
}
</script>
</head>
<body>
<div class="letter-close">
<div class="envelope" onclick="open_letter()"></div>
<h2 class="envelope-msg">편지를 열어봐!</h2>
</div>
<div class="letter-open">
<div class="rtan" onclick="go_rtan()"></div>
<h1>2020년 수고 많았어!</h1>
<div class="messagebox">
친구들에게. <br />
잘 지내니? <br />
올해 이런저런 일이 많았는데 <br />
너희 덕분에 하나도 힘들지 않았어 <br />
연말에 다 같이 못 봐서 아쉽다 <br />
<p class="from">2020.12.14 길동이가</p>
</div>
</div>
</body>
</html>