🎈힙한취미코딩 이벤트 URL
https://spartacodingclub.kr/hip?utm_source=kakao_plusfriend&utm_medium=crm&utm_campaign=%EC%98%A8%EB%9D%BC%EC%9D%B8&utm_content=%EC%B9%B4%EC%B9%B4%EC%98%A4%ED%94%8C%EC%B9%9C%EC%A0%84%EC%88%98&utm_term=%EA%B2%BD%ED%92%88%EA%B0%95%EC%A1%B0_210913
🎈 미션 완성 작품 URL
https://xmas.spartacodingclub.kr/CkpnCWKzT1Fb/xmas.html
이름은
xmas.html
💡 html:5
입력후 tab
을 누르면 템플릿이 자동 완성 된다!!
회색빛이 섞인 진청록색:
#264C59
💡 배경색은 자신이 원하는 color 'pick'하면 된다!!
https://media.istockphoto.com/vectors/mail-customer-service-icon-vector-id1152903919?k=20&m=1152903919&s=612x612&w=0&h=fSfMK-4dtkcHuujrDXk2mMZrQnl9QC6CHpeaL9jsRIk=
<head>
태그 안의 <style>
태그 사이에.envelope {
width: 300px;
height: 300px;
background-image: url('https://media.istockphoto.com/vectors/mail-customer-service-icon-vector-id1152903919?k=20&m=1152903919&s=612x612&w=0&h=fSfMK-4dtkcHuujrDXk2mMZrQnl9QC6CHpeaL9jsRIk=');
background-size: cover;
background-position: center;
margin: 100px auto 0px auto;
}
<body>
태그 사이에<div class="envelope"></div>
<head>
태그 안의 <style>
태그 사이에.envelope-title {
color: white;
text-align: center;
}
.envelope-msg {
color: white;
text-align: center;
}
<body>
태그 사이에<h2 class="envelope-title">2021 MS's Online Piano Recital Invitation Card</h2>
<h5 class="envelope-msg">LET'S OPEN IT!</h5>
<body>
태그 사이에<div class="letter-close">
<div class="envelope" onclick="open_letter()"></div>
<h2 class="envelope-title">2021 MS's Online Piano Recital Invitation Card</h2>
<h5 class="envelope-msg">LET'S OPEN IT!</h5>
</div>
WHY? 이 셋은 같이 나타나고, 없어져야 하는 존재!!
💡 즉, 함께 행동해야 하는 존재이기 때문에, div로 묶어준다.
Josefin Sans체
https://fonts.google.com/specimen/Josefin+Sans#standard-styles
<head>
태그 안에 위치한 <title>
태그 아래에 붙여넣기<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500&display=swap" rel="stylesheet">
<head>
태그 안의 <style>
태그 사이에* {
font-family: 'Josefin Sans', sans-serif;
}
display 값을 none으로
주면 안 보이게 할 수 있다!!
<body>
태그 사이에<div class="letter-close">
<div class="envelope"></div>
<h2 class="envelope-title">2021 MS's Online Piano Recital Invitation Card</h2>
<h5 class="envelope-msg">LET'S OPEN IT!</h5>
</div>
<head>
태그 안의 <style>
태그 사이에.letter-close {
display: none;
}
https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif
<르탄이 이미지 띄우기>
<head>
태그 안의 <style>
태그 사이에.rtan {
background-color: white;
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif');
background-size: cover;
background-position: center;
}
<body>
태그 사이에<div class="rtan"></div>
<head>
태그 안의 <style>
태그 사이에.rtan {
background-color: white;
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif');
background-size: cover;
background-position: center;
margin: auto;
border-radius: 100px;
border: 5px solid white;
}
border
속성은 태그의 테두리를 설정하는 속성이다.5px solid white
는 순서대로 각각 '테두리의 두께', '테두리의 스타일', '테두리의 색상'을 의미하고 각 코드 명령에 따라 테두리를 변경한다.
<head>
태그 안의 <style>
태그 사이에.rtan {
background-color: white;
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif');
background-size: cover;
background-position: center;
margin: 30px auto 0px auto;
border-radius: 100px;
border: 5px solid white;
}
<head>
태그 안의 <style>
태그 사이에.rtan {
background-color: white;
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif');
background-size: cover;
background-position: center;
margin: 30px auto 0px auto;
border-radius: 100px;
border: 5px solid white;
box-shadow: 0px 0px 10px 0px white;
}
- box-shadow 속성은 요소의 테두리를 감싼 그림자 효과를 추가한다.
<head>
태그 안의 <style>
태그 사이에.hone {
color: white;
text-align: center;
}
.htwo {
color: white;
text-align: center;
}
<body>
태그 사이에<h1 class="hone">We invite medical workers</h1>
<h1 class="htwo">to '2021 MS's Online Piano Recital'</h1>
<body>
태그 사이에<div class="messagebox">
To. All Medical Workers <br />
We would like to express our gratitude to the medical personnel who are struggling more than anyone else to save COVID-19 patients and doing all they can to flatten the coronavirus. <br />
We wish for the medical staffs who are working hard even at this moment for human life to get a rest time through our online piano recital for a while. <br />
Sincerely, we are very appreciative of their efforts.
</div>
<br />
는 '줄바꿈'을 의미!!
<head>
태그 안의 <style>
태그 사이에.messagebox {
background-color: ivory;
width: 550px;
margin: auto;
color: burlywood;
padding: 30px;
font-size: 15px;
line-height: 30px;
box-shadow: 0px 0px 10px 0px white;
}
line-height
줄간격(줄의 높이)은 폰트 사이즈보다 큰게 보기에 좋다.
<head>
태그 안의 <style>
태그 사이에.from {
text-align: right;
margin-bottom: 0px;
}
<body>
태그 사이에<div class="messagebox">
To. All Medical Workers <br />
We would like to express our gratitude to the medical personnel who are struggling more than anyone else to save COVID-19 patients and doing all they can to flatten the coronavirus. <br />
We wish for the medical staffs who are working hard even at this moment for human life to get a rest time through our online piano recital for a while. <br />
Sincerely, we are very appreciative of their efforts.
<p class="from">From. MS</p>
</div>
<head>
태그 안의 <style>
태그 사이에.hone {
color: white;
text-align: center;
margin-top: 30px;
}
.htwo {
color: white;
text-align: center;
margin-bottom: 30px;
}
<body>
태그 사이에<div class="letter-open">
<div class="rtan"></div>
<h1 class="hone">We invite medical workers</h1>
<h1 class="htwo">to '2021 MS's Online Piano Recital'</h1>
<div class="messagebox">
To. All Medical Workers <br />
We would like to express our gratitude to the medical personnel who are struggling more than anyone else to save COVID-19 patients and doing all they can to flatten the coronavirus. <br />
We wish for the medical staffs who are working hard even at this moment for human life to get a rest time through our online piano recital for a while. <br />
Sincerely, we are very appreciative of their efforts.
<p class="from">From. MS</p>
</div>
</div>
WHY? 편지 HTML 태그들은 같이 나타나고, 없어져야 하는 존재!!
💡 즉, 함께 행동해야 하는 존재이기 때문에, div로 묶어준다.
- 마우스 오른쪽 키 누르고 →
검사
click → 모바일 보기 click- Responsive로 맞추고, 가로길이를 356px로 맞추기
<head>
태그 안의 <style>
태그 사이에@media screen and (max-width: 760px) {
}
↓ '편지지 사이즈', '르탄이 사이즈', '편지 제목 폰트 사이즈' 고쳐주기
@media screen and (max-width: 760px) {
.messagebox {
width: 300px;
padding: 20px;
}
.rtan {
margin: 50px auto 0px auto;
}
.hone {
font-size: 22px;
}
.htwo {
font-size: 22px;
}
.messagebox {
margin-bottom: 50px;
}
}
- 잠시 편지를 숨기고, 카드 봉투를 보여주기!!
.letter-close {
display: block;
}
.letter-open {
display: none;
}
↓ '카드 봉투 위치' 고쳐주기
@media screen and (max-width: 760px) {
.messagebox {
width: 300px;
padding: 20px;
}
.rtan {
margin: 50px auto 0px auto;
}
.hone {
font-size: 22px;
}
.htwo {
font-size: 22px;
}
.messagebox {
margin-bottom: 50px;
}
.envelope {
margin: 50px auto 0px auto;
}
}
<head>
태그 안의 <script>
태그 사이에function open_letter() {
document.getElementsByClassName("letter-close")[0].style.display = 'none'
document.getElementsByClassName("letter-open")[0].style.display = 'block'
}
<body>
태그 사이에<div class="envelope" onclick="open_letter()"></div>
<head>
태그 안의 <style>
태그 사이에.envelope {
width: 300px;
height: 300px;
background-image: url('https://media.istockphoto.com/vectors/mail-customer-service-icon-vector-id1152903919?k=20&m=1152903919&s=612x612&w=0&h=fSfMK-4dtkcHuujrDXk2mMZrQnl9QC6CHpeaL9jsRIk=');
background-size: cover;
background-position: center;
margin: 100px auto 0px auto;
cursor: pointer;
}
cursor
속성을 이용하면 해당 태그 위에 위치하는 마우스 cursor의 모양을 바꿀 수 있다.pointer
는 손가락 모양의 클릭 가능한 버튼!!
<script src="https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/snow.js"></script>
<head>
태그 안에 위치한 <title>
태그 아래에 붙여넣기<head>
태그 안의 <script>
태그 사이에function go_rtan() {
alert('앗, 어떻게 찾았지!');
window.location.href='https://www.youtube.com/watch?v=E4zTPrVx4Lc&list=OLAK5uy_m8Zrr2fonba63dH1AgQm9ywOGb5vt_ofk&index=3';
}
- alert 메시지 띄우기:
alert('앗, 어떻게 찾았지!');
- 링크로 이동하게 하기:
window.location.href='...';
<body>
태그 사이에<div class="rtan" onclick="go_rtan()"></div>
<head>
태그 안에 위치한 <title>
태그 아래에 붙여넣기<meta property="og:image" content="https://media.istockphoto.com/photos/grand-piano-picture-id540856596?k=20&m=540856596&s=612x612&w=0&h=13JroUZzU-23Dd4afIbs_4-34KzuC7RW766VBDdzWdc=">
<meta property="og:title" content="2021 MS's Online Piano Recital">
<meta property="og:description" content="For The Medical Workers">
<head>
태그 안에 위치한 <title>
태그 아래에 붙여넣기<link rel="shortcut icon" href="https://icons-for-free.com/iconfiles/png/512/Piano-1320568874543813841.png">
💡 받은 링크를 카카오톡에 보내서 og:image가 잘 뜨는지 확인해보기!!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2021 MS's Online Piano Recital</title>
<link rel="shortcut icon" href="https://icons-for-free.com/iconfiles/png/512/Piano-1320568874543813841.png">
<meta property="og:image" content="https://media.istockphoto.com/photos/grand-piano-picture-id540856596?k=20&m=540856596&s=612x612&w=0&h=13JroUZzU-23Dd4afIbs_4-34KzuC7RW766VBDdzWdc=">
<meta property="og:title" content="2021 MS's Online Piano Recital">
<meta property="og:description" content="For The Medical Workers">
<script src="https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/snow.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@500&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Josefin Sans', sans-serif;
}
body {
background-color: #264C59;
}
.envelope {
width: 300px;
height: 300px;
background-image: url('https://media.istockphoto.com/vectors/mail-customer-service-icon-vector-id1152903919?k=20&m=1152903919&s=612x612&w=0&h=fSfMK-4dtkcHuujrDXk2mMZrQnl9QC6CHpeaL9jsRIk=');
background-size: cover;
background-position: center;
margin: 100px auto 0px auto;
cursor: pointer;
}
.envelope-title {
color: white;
text-align: center;
}
.envelope-msg {
color: white;
text-align: center;
}
.letter-close {
display: block;
}
.letter-open {
display: none;
}
.rtan {
background-color: white;
width: 200px;
height: 200px;
background-image: url('https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/xmas/Webp.net-gifmaker.gif');
background-size: cover;
background-position: center;
margin: 30px auto 0px auto;
border-radius: 100px;
border: 5px solid white;
box-shadow: 0px 0px 10px 0px white;
}
.hone {
color: white;
text-align: center;
margin-top: 30px;
}
.htwo {
color: white;
text-align: center;
margin-bottom: 30px;
}
.messagebox {
background-color: ivory;
width: 550px;
margin: auto;
color: burlywood;
padding: 30px;
font-size: 15px;
line-height: 30px;
box-shadow: 0px 0px 10px 0px white;
}
.from {
text-align: right;
margin-bottom: 0px;
}
@media screen and (max-width: 760px) {
.messagebox {
width: 300px;
padding: 20px;
}
.rtan {
margin: 50px auto 0px auto;
}
.hone {
font-size: 22px;
}
.htwo {
font-size: 22px;
}
.messagebox {
margin-bottom: 50px;
}
.envelope {
margin: 50px 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://www.youtube.com/watch?v=E4zTPrVx4Lc&list=OLAK5uy_m8Zrr2fonba63dH1AgQm9ywOGb5vt_ofk&index=3';
}
</script>
</head>
<body>
<div class="letter-close">
<div class="envelope" onclick="open_letter()"></div>
<h2 class="envelope-title">2021 MS's Online Piano Recital Invitation Card</h2>
<h5 class="envelope-msg">LET'S OPEN IT!</h5>
</div>
<div class="letter-open">
<div class="rtan" onclick="go_rtan()"></div>
<h1 class="hone">We invite medical workers</h1>
<h1 class="htwo">to '2021 MS's Online Piano Recital'</h1>
<div class="messagebox">
To. All Medical Workers <br />
We would like to express our gratitude to the medical personnel who are struggling more than anyone else to save COVID-19 patients and doing all they can to flatten the coronavirus. <br />
We wish for the medical staffs who are working hard even at this moment for human life to get a rest time through our online piano recital for a while. <br />
Sincerely, we are very appreciative of their efforts.
<p class="from">From. MS</p>
</div>
</div>
</body>
</html>
나에게 힙한취미코딩 이벤트는 웹개발종합반에서 아직 다루지 않은 것들을 미리 쉽게 접해볼 수 있는 기회였다. 직접 웹페이지를 만들고 배포까지 해보니 너무 뿌뜻했다. 특히 모바일 버전 코드를 다시 짜보는 프로그래밍 과정이 되게 재밌었다. @media screen and (max-width: 760px)
코드를 사용해서 모바일 버전 코드를 따로 변경했는데, 어떻게 모바일 버전으로 웹페이지가 만들어지고 수정되는지 배울 수 있었다. 그리고 공유 기초 작업을 위해 og 태그와 favicon 넣는 것까지 해봤는데 이 부분이 너무 신기했다. 이렇게 코드를 하나하나씩 쌓아가니까 완성도 있는 웹페이지를 완성할 수 있었다. 이번 경험이 앞으로 웹페이지를 개발할 때 정말 큰 도움이 될 것 같다.