Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ const produceImageBtn = document.querySelector('#export');
const captureModal = document.querySelector('.capture_modal');
const mod = document.querySelectorAll('.mod');
const overlay = document.querySelector('.overlay');
const inputFields = document.querySelectorAll('.input__field');

const captureExport = function () {
inputFields.forEach((e) => {
if(e.dataset['changed'] != true) {
document.querySelector(`.${e.dataset['set']}`).textContent = '';
}
})
html2canvas(document.querySelector('#capture'), {
logging: true,
letterRendering: 1,
Expand All @@ -24,7 +30,7 @@ const captureExport = function () {
});

mod.forEach((e) => e.classList.remove('hidden'));
};
};

const removeCapture = function () {
captureModal.removeChild(captureModal.firstElementChild);
Expand All @@ -40,13 +46,10 @@ window.addEventListener('keydown', (e) => {
}
});

// INPUT IMPLEMENTING

const inputFields = document.querySelectorAll('.input__field');

const updateInputValue = function (e) {
const target = e.target.dataset.set;
document.querySelector(`.${target}`).textContent = e.target.value;
e.dataset['changed'] = true;
};

inputFields.forEach((e) => {
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ <h1># Thumbnail Maker</h1>
</div>
<div class="control__panel">
<div class="inputFields">
<input class="input__field input__title" data-set="title" type="text" spellcheck="false" placeholder=">제목을 입력하세요">
<input class="input__field input__subtitle" data-set="subtitle" type="text" spellcheck="false" placeholder=">부제목을 입력하세요">
<input class="input__field input__category" data-set="category" type="text" spellcheck="false" placeholder=">분류를 입력하세요">
<input class="input__field input__title" data-changed="false" data-set="title" type="text" spellcheck="false" placeholder=">제목을 입력하세요">
<input class="input__field input__subtitle" data-changed="false" data-set="subtitle" type="text" spellcheck="false" placeholder=">부제목을 입력하세요">
<input class="input__field input__category" data-changed="false" data-set="category" type="text" spellcheck="false" placeholder=">분류를 입력하세요">
</div>

<div class="background__btns">
Expand Down