-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
23 lines (20 loc) · 880 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(function() {
const printShopModal = document.getElementById('print-shop-modal');
const imageToUseInput = document.getElementById('image-to-use-input');
const printShopIframe = document.getElementById('print-shop-modal__iframe');
const buyImageButton = document.getElementById('buy-image-btn');
const printShopCloseModalBtn =
document.getElementById('print-shop-modal__close-modal-btn');
function launchPrintShop() {
const imageToUseValue = imageToUseInput.value;
printShopIframe.src =
`https://staging-print.kite.ly/town-news/?images=${imageToUseValue}` +
`|1000x750#/create`;
printShopModal.style.display = 'block';
}
function closePrintShop() {
printShopModal.style.display = 'none';
}
buyImageButton.addEventListener('click', launchPrintShop);
printShopCloseModalBtn.addEventListener('click', closePrintShop);
}())