<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<title>THE BOYZ [THRILL-ING]</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=IBM+Plex+Sans+KR:wght@200;300;500&display=swap"
rel="stylesheet">
</head>
<style>
* {
font-family: 'IBM Plex Sans KR', sans-serif;
font-size: small;
}
.image {
background-color: green;
width: 400px;
height: 400px;
margin: auto;
background-image: url("http://cdn.shopify.com/s/files/1/1801/5317/products/thumbnail02bang_1200x1200.jpg?v=1627634165");
background-size: cover;
background-position: center;
}
.letter {
width: 600px;
margin: auto;
}
.button {
width: 90px;
margin: auto;
}
.rate {
color: blue;
}
</style>
<script>
$(document).ready(function () {
get_rate();
});
function order() {
alert('주문해주셔서 감사합니다. Best We THE BOYZ!');
}
function get_rate() {
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/rate",
data: {},
success: function (response) {
let now_rate = response['rate']
$("#now-rate").text(now_rate);
}
})
}
</script>
</head>
<body>
<div class="image"></div>
<div class="letter">
<h1> THE BOYZ 6th MINI ALBUM <span style="font-size:20px">가격:17,800원/장</span></h1>
<h4> 글로벌 대세 더보이즈, 미니 6집 [THRILL-ING] 발매! 올 여름, ‘핫’한 열 한 명의 소년들이 당신의 마음에 ‘쿨’한 스릴링(THRILL-ING)을 선사한다.</h4>
<p class="rate"> 원-달러 환율: <span id="now-rate">1215.19</span></p>
<h1> ORDER HERE! </h1>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">주문자 성함</span>
</div>
<input type="text" class="form-control" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="inputGroupSelect01">수량</label>
</div>
<select class="custom-select" id="inputGroupSelect01">
<option selected></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">주소</span>
</div>
<input type="text" class="form-control" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">전화번호</span>
</div>
<input type="text" class="form-control" aria-label="Username" aria-describedby="basic-addon1">
</div>
</div>
<div class="button">
<button type="button" onclick="order()" class="btn btn-primary">주문하기</button>
</div>
</body>
</html>
지난 번에 만들었던 사이트에 업데이트되는 원/달러 환율 추가!
ajax를 적용해 원/달러 환율을 실시간으로 받고, span처리를 해서 그 부분만 계속 달라지도록 만든다.
파란색은 css 이용!
'SpartaCodingClub > week 2' 카테고리의 다른 글
개발일지 2주차 (0) | 2021.08.29 |
---|