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
102 changes: 102 additions & 0 deletions Easy Project/To-do List App.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Enhanced Todo List</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<style>
body {
background: linear-gradient(270deg, #6a11cb, #2575fc);
animation: gradient 10s ease infinite;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.container {
background: rgba(255, 255, 255, 0.9);
border-radius: 10px;
padding: 30px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
max-width: 600px;
width: 100%;
}
.todo-item {
display: flex;
justify-content: space-between;
align-items: center;
margin: 5px 0;
}
</style>
</head>
<body>

<div class="container">
<h1 class="text-center">Todo List App</h1>
<div class="input-group mb-3">
<input type="text" id="taskInput" class="form-control" placeholder="Task description" aria-label="Task description">
<input type="date" id="dateInput" class="form-control">
<select id="categoryInput" class="form-control">
<option value="" disabled selected>Select category</option>
<option value="Work">Work</option>
<option value="Personal">Personal</option>
<option value="Study">Study</option>
<option value="Other">Other</option>
</select>
<div class="input-group-append">
<button class="btn btn-primary" id="addButton">Add</button>
</div>
</div>
<ul class="list-group" id="todoList"></ul>
</div>

<script>
document.getElementById('addButton').addEventListener('click', function() {
const taskInput = document.getElementById('taskInput');
const dateInput = document.getElementById('dateInput');
const categoryInput = document.getElementById('categoryInput');

const task = taskInput.value.trim();
const dueDate = dateInput.value;
const category = categoryInput.value;

if (task && dueDate && category) {
const li = document.createElement('li');
li.className = 'list-group-item todo-item';
li.innerHTML = `<strong>${task}</strong> <span class="text-muted">(${dueDate}, ${category})</span>`;

const deleteButton = document.createElement('button');
deleteButton.className = 'btn btn-danger btn-sm';
deleteButton.textContent = 'Delete';
deleteButton.onclick = function() {
li.remove();
};

li.appendChild(deleteButton);
document.getElementById('todoList').appendChild(li);
taskInput.value = '';
dateInput.value = '';
categoryInput.selectedIndex = 0; // Reset category
} else {
alert('Please fill in all fields.');
}
});
</script>

</body>
</html>
Binary file added Intermediate Project/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions Intermediate Project/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather App</title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<div class="app-wrap">
<header>
<input type="text" autocomplete="off" class="search-box" placeholder="Search for a city..." />
</header>
<main>
<section class="location">
<div class="city">New York, US</div>
<div class="date">Wednesday 22 July 2020</div>
</section>
<div class="current">
<div class="temp">15<span>°c</span></div>
<div class="weather">Sunny</div>
<div class="hi-low">13°c / 16°c</div>
</div>
</main>
</div>
<script src="main.js"></script>
</body>
</html>
95 changes: 95 additions & 0 deletions Intermediate Project/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'montserrat', sans-serif;
background-image: url('bg.jpg');
background-size: cover;
background-position: top center;
}

.app-wrap {
display: flex;
flex-direction: column;
min-height: 100vh;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
}

header {
display: flex;
justify-content: center;
align-items: center;
padding: 50px 15px 15px;
}

header input {
width: 100%;
max-width: 280px;
padding: 10px 15px;
border: none;
outline: none;
background-color: rgba(255, 255, 255, 0.3);
border-radius: 0px 16px 0px 16px;
border-bottom: 3px solid gray;

color: #313131;
font-size: 20px;
font-weight: 300;
transition: 0.2s ease-out;
}

header input:focus {
background-color: rgba(255, 255, 255, 0.6);
}

main {
flex: 1 1 100%;
padding: 25px 25px 50px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}

.location .city {
color: #fff;
font-size: 32px;
font-weight: 500;
margin-bottom: 5px;
}

.location .date {
color: #fff;
font-size: 16px;
}

.current .temp {
color: #fff;
font-size: 102px;
font-weight: 900;
margin: 30px 0px;
text-shadow: 2px 10px rgba(0, 0, 0, 0.6);
}

.current .temp span {
font-weight: 500;
}

.current .weather {
color: #fff;
font-size: 32px;
font-weight: 700;
font-style: italic;
margin-bottom: 15px;
text-shadow: 0px 3px rgba(0, 0, 0, 0.4);
}

.current .hi-low {
color: #fff;
font-size: 24px;
font-weight: 500;
text-shadow: 0px 4px rgba(0, 0, 0, 0.4);
}
50 changes: 50 additions & 0 deletions Intermediate Project/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const api = {
key: "fcc8de7015bbb202209bbf0261babf4c",
base: "https://api.openweathermap.org/data/2.5/"
}

const searchbox = document.querySelector('.search-box');
searchbox.addEventListener('keypress', setQuery);

function setQuery(evt) {
if (evt.keyCode == 13) {
getResults(searchbox.value);
}
}

function getResults (query) {
fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`)
.then(weather => {
return weather.json();
}).then(displayResults);
}

function displayResults (weather) {
let city = document.querySelector('.location .city');
city.innerText = `${weather.name}, ${weather.sys.country}`;

let now = new Date();
let date = document.querySelector('.location .date');
date.innerText = dateBuilder(now);

let temp = document.querySelector('.current .temp');
temp.innerHTML = `${Math.round(weather.main.temp)}<span>°c</span>`;

let weather_el = document.querySelector('.current .weather');
weather_el.innerText = weather.weather[0].main;

let hilow = document.querySelector('.hi-low');
hilow.innerText = `${Math.round(weather.main.temp_min)}°c / ${Math.round(weather.main.temp_max)}°c`;
}

function dateBuilder (d) {
let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
let days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

let day = days[d.getDay()];
let date = d.getDate();
let month = months[d.getMonth()];
let year = d.getFullYear();

return `${day} ${date} ${month} ${year}`;
}