Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial commit #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
11 changes: 6 additions & 5 deletions day-02/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const input = document.querySelector('.theme-switcher input');

input.addEventListener('change', (e) => {
if (e.target.checked) {
document.body.setAttribute('data-theme', 'dark');
} else {
document.body.setAttribute('data-theme', 'light');
}
{e.target.checked ? document.body.setAttribute('data-theme', 'dark') : document.body.setAttribute('data-theme', 'light') }
// if (e.target.checked) {
// document.body.setAttribute('data-theme', 'dark');
// } else {
// document.body.setAttribute('data-theme', 'light');
// }
})
18 changes: 11 additions & 7 deletions day-05/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ const timeH = document.querySelector('h1');

displayTime(5);

const countDown = setInterval(()=>{
const countDown = setInterval(timer, 1000);

function timer() {
timeSecond--;
displayTime(timeSecond);
if(timeSecond == 0 || timeSecond < 1){
endCount();
clearInterval(countDown);
}
}, 1000);
console.log(timeSecond)
displayTime(timeSecond);

if(timeSecond == 0 || timeSecond < 1){
endCount();
clearInterval(countDown);
}
}

function displayTime(second){
const min = Math.floor(second / 60);
Expand Down
4 changes: 2 additions & 2 deletions day-22/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="container initial">
<h1 class="brand">Recipe App</h1>
<form>
<input type="text" placeholder="Search Your Recipe...">
<input type="text" placeholder="Search Your Recipe..." />
<ion-icon name="search"></ion-icon>
</form>
<div class="search-result">
Expand All @@ -26,7 +26,7 @@ <h1 class="title">This is a recipe item</h1>
</div>
</div>
</section>
<script src="https://unpkg.com/ionicons@5.1.2/dist/ionicons.js"></script>
<script src="https://unpkg.com/ionicons@5.1.2/dist/ionicons.js"></script>
<script src="./main.js"></script>
</body>
</html>
27 changes: 22 additions & 5 deletions day-22/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@ let searchQuery = '';
const APP_ID = "Use Your Own App ID Here";
const APP_key = "Use Your Own App Key Here";
// console.log(container)
searchForm.addEventListener('submit', (e) => {
e.preventDefault();
searchQuery = e.target.querySelector('input').value;
fetchAPI();
})


searchForm.addEventListener('submit', async (e) => {
e.preventDefault();
searchQuery = e.target.querySelector('input').value;
console.log(searchQuery)
if(searchQuery==''){
alert('please provide value')
}
await fetchAPI();
})

// fetchAPI();




// searchForm.addEventListener('submit', (e) => {
// e.preventDefault();
// searchQuery = e.target.querySelector('input').value;
// fetchAPI();
// })

async function fetchAPI(){
const baseURL = `https://api.edamam.com/search?q=${searchQuery}&app_id=${APP_ID}&app_key=${APP_key}&from=0&to=20`;
Expand Down
13 changes: 13 additions & 0 deletions day-22/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "day-22",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node main.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}
1 change: 1 addition & 0 deletions day-22/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ input{
background-color: rgb(223, 223, 223);
display: inline-block;
}

form ion-icon{
width: 8%;
font-size: 3rem;
Expand Down