diff --git "a/week-3/solution/easy/The-Pok\303\251mon/README.md" "b/week-3/solution/easy/The-Pok\303\251mon/README.md" new file mode 100644 index 000000000..d4f0e73ec --- /dev/null +++ "b/week-3/solution/easy/The-Pok\303\251mon/README.md" @@ -0,0 +1,19 @@ + +# The-Pokémon + +Your task is to design and implement an application that display Pokémon Cards. + +- user comes to site and enter number of cards and select category of Pokémon. + +**Hint**: take category and no of Pokémon, use API and render. + +## Resources: + +- refer this: https://pokeapi.co/ +- use this `https://pokeapi.co/api/v2/pokemon/${id}` api to get the pokemon data by id. + +**Note**: here id is a number. for example `https://pokeapi.co/api/v2/pokemon/1` + + + + diff --git "a/week-3/solution/easy/The-Pok\303\251mon/public/index.html" "b/week-3/solution/easy/The-Pok\303\251mon/public/index.html" new file mode 100644 index 000000000..0229d92df --- /dev/null +++ "b/week-3/solution/easy/The-Pok\303\251mon/public/index.html" @@ -0,0 +1,47 @@ + + + + + + Pokemon + + + +
+

Pokemon World

+
+

Find your pokemon

+ + + Enter a number between 1 and 20 + + + +
+
+
+ + +
+ + + \ No newline at end of file diff --git "a/week-3/solution/easy/The-Pok\303\251mon/public/script.js" "b/week-3/solution/easy/The-Pok\303\251mon/public/script.js" new file mode 100644 index 000000000..41fd4f395 --- /dev/null +++ "b/week-3/solution/easy/The-Pok\303\251mon/public/script.js" @@ -0,0 +1,104 @@ +document.getElementById("pokemonForm").addEventListener("submit", async function (e) { + e.preventDefault(); + + const numPokemon = parseInt(document.getElementById("numPokemon").value, 10); // Parse as integer + const category = document.getElementById("category").value; + const container = document.getElementById("pokemonContainer"); + const messageContainer = document.getElementById("messageContainer"); + + if (!numPokemon) { + messageContainer.innerText = "Please enter a number to generate cards"; + return; + } + + container.innerHTML = ""; + messageContainer.innerText = "Loading Pokémon... Please wait."; + + try { + const pokemonCards = await fetchUniquePokemon(numPokemon, category); + + if (pokemonCards.length === 0) { + container.innerHTML = `

No Pokémon found for the selected category.

`; + messageContainer.textContent = "No Pokémon found."; + } else { + pokemonCards.forEach(card => container.appendChild(card)); + messageContainer.textContent = "Pokémon cards loaded successfully!"; + } + } catch (error) { + console.error("Error fetching and displaying Pokémon:", error); + container.innerHTML = `

An error occurred while loading Pokémon. Please try again.

`; + messageContainer.textContent = "Error loading Pokémon."; + } finally { + setTimeout(() => (messageContainer.textContent = ""), 5 * 1000); + } +}); + +const cache = {}; // Simple in-memory cache + +async function fetchUniquePokemon(numPokemon, category) { + const pokemonCards = []; + const fetchedPokemon = new Set(); // Use a Set to track fetched IDs + let id = Math.floor(Math.random()) + 1; + + while (pokemonCards.length < numPokemon && id <= 1000) { + try { + // Check cache first + if (cache[id]) { + const data = cache[id]; + if (data.types.some(type => type.type.name === category)) { + if (!fetchedPokemon.has(id)) { //Ensure pokemon is unique + const card = createPokemonCard(data); + pokemonCards.push(card); + fetchedPokemon.add(id); + } + + } + } else { + const response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`); + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } + const data = await response.json(); + cache[id] = data; // Store data in cache + + if (data.types.some(type => type.type.name === category)) { + if (!fetchedPokemon.has(id)) { //Ensure pokemon is unique + const card = createPokemonCard(data); + pokemonCards.push(card); + fetchedPokemon.add(id); + } + + } + } + + + } catch (err) { + console.error(`Failed to process Pokémon with ID ${id}: `, err); + } + id++; + } + + return pokemonCards; +} + +function createPokemonCard(data) { + const card = document.createElement("div"); + card.className = "card"; + + const img = document.createElement("img"); + img.src = data.sprites.front_default; + img.alt = data.name; + img.onerror = () => { img.src = 'path/to/default/image.png'; }; // Handle image loading errors + + const name = document.createElement("h3"); + name.textContent = data.name; + + const type = document.createElement("p"); + type.textContent = `Type: ${data.types.map(t => t.type.name).join(", ")}`; + + card.appendChild(img); + card.appendChild(name); + card.appendChild(type); + + return card; +} \ No newline at end of file diff --git "a/week-3/solution/easy/The-Pok\303\251mon/public/styles.css" "b/week-3/solution/easy/The-Pok\303\251mon/public/styles.css" new file mode 100644 index 000000000..601008072 --- /dev/null +++ "b/week-3/solution/easy/The-Pok\303\251mon/public/styles.css" @@ -0,0 +1,144 @@ +/* styles.css */ + +/* Global Styles */ +:root { + --pokemon-blue: #29B6F6; /* Light Blue - Electric/Water */ + --pokemon-yellow: #FFCA28; /* Light Yellow - Electric */ + --pokemon-red: #E57373; /* Light Red - Fire */ + --pokemon-green: #81C784; /* Light Green - Grass/Poison */ + --pokemon-text: #263238; /* Dark Blue-Gray - Improved readability */ + --pokemon-background: #ECEFF1; /* Light Gray-Blue - Softer background */ + --pokemon-card-shadow: rgba(0, 0, 0, 0.15) 0px 2px 8px; /* Even lighter shadow */ +} + +body { + font-family: 'Roboto', sans-serif; + background-color: var(--pokemon-background); + color: var(--pokemon-text); + line-height: 1.6; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; +} + +/* Container Styles */ +.container { /* Corrected typo: contianer -> container */ + background-color: #fff; + border-radius: 8px; + box-shadow: var(--pokemon-card-shadow); + padding: 2rem; + width: 90%; + max-width: 600px; + text-align: center; +} + +/* Heading Styles */ +h1 { + color: var(--pokemon-blue); + font-size: 2.5rem; + margin-bottom: 1rem; +} + +/* Form Styles */ +form { + display: flex; + flex-direction: column; + align-items: stretch; +} + +label { + font-weight: bold; + margin-bottom: 0.5rem; + color: var(--pokemon-text); +} + +input[type="number"], +select { + padding: 0.75rem; + margin-bottom: 1rem; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 1rem; +} + +/* Button Styles */ +button { + background-color: var(--pokemon-green); + color: white; + padding: 0.75rem 1.5rem; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 1.1rem; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: var(--pokemon-blue); +} + +/* Message Container Styles */ +#messageContainer { + margin-top: 1rem; + font-style: italic; + color: var(--pokemon-red); +} + +/* Pokemon Container Styles */ +#pokemonContainer { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 1rem; + margin-top: 2rem; +} + +/* Card Styles */ +.card { + background-color: #fff; + border-radius: 8px; + box-shadow: var(--pokemon-card-shadow); + padding: 1rem; + width: 150px; + text-align: center; +} + +.card img { + max-width: 100%; + height: auto; + margin-bottom: 0.5rem; +} + +.card h3 { + color: var(--pokemon-blue); + font-size: 1.2rem; + margin-bottom: 0.5rem; +} + +.card p { + font-size: 0.9rem; + color: var(--pokemon-text); +} + +/* Media Queries for Responsiveness */ +@media (max-width: 600px) { + .container { /* Corrected typo: contianer -> container */ + width: 95%; + padding: 1rem; + } + + h1 { + font-size: 2rem; + } + + form { + margin-bottom: 1.5rem; + } + + .card { + width: calc(50% - 0.5rem); + } +} diff --git "a/week-3/solution/easy/The-Pok\303\251mon/server.js" "b/week-3/solution/easy/The-Pok\303\251mon/server.js" new file mode 100644 index 000000000..e69de29bb diff --git a/week-3/solution/easy/bg-color-changer/README.md b/week-3/solution/easy/bg-color-changer/README.md new file mode 100644 index 000000000..9fc2a61ed --- /dev/null +++ b/week-3/solution/easy/bg-color-changer/README.md @@ -0,0 +1,17 @@ + +# BG-Color-Changer + +Your task is to design and implement a Bg-Color-Changer application that meets the following requirements: + +- The UI should resemble the example shown below.. + +![Image](https://utfs.io/f/7e57da15-803c-48c7-8487-dcade58eef91-wx71zg.png) + + +- When user clicks on a red button, the background color should change to red. + + +- User should also be able to add custom colors to the color panel. + + +### Don't copy UI as it is, only take reference from it. \ No newline at end of file diff --git a/week-3/solution/easy/bg-color-changer/index.html b/week-3/solution/easy/bg-color-changer/index.html new file mode 100644 index 000000000..aff7001c8 --- /dev/null +++ b/week-3/solution/easy/bg-color-changer/index.html @@ -0,0 +1,20 @@ + + + + + + Color Factory + + + +
+

Colour Factory

+
+ + + +
+
+ + + \ No newline at end of file diff --git a/week-3/solution/easy/bg-color-changer/script.js b/week-3/solution/easy/bg-color-changer/script.js new file mode 100644 index 000000000..933782e85 --- /dev/null +++ b/week-3/solution/easy/bg-color-changer/script.js @@ -0,0 +1,23 @@ +document.addEventListener('DOMContentLoaded', function() { + const colorPicker = document.getElementById("colorPicker"); + const whiteButton = document.getElementById("white"); + const blackButton = document.getElementById("black"); + + function changeBackgroundColor(color) { + document.body.style.backgroundColor = color; + } + + colorPicker.addEventListener("input", function(e) { + const color = e.target.value; + changeBackgroundColor(color); + }); + + whiteButton.addEventListener("click", function() { + changeBackgroundColor("white"); + }); + + blackButton.addEventListener("click", function() { + changeBackgroundColor("black"); + }); + +}); \ No newline at end of file diff --git a/week-3/solution/easy/bg-color-changer/styles.css b/week-3/solution/easy/bg-color-changer/styles.css new file mode 100644 index 000000000..ba6e8a2da --- /dev/null +++ b/week-3/solution/easy/bg-color-changer/styles.css @@ -0,0 +1,59 @@ +/* styles.css */ + +html, body { + height: 100%; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + background-color: #f0f0f0; /* Default background */ +} + +.container { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +h1 { + margin-bottom: 20px; +} + +.color-selector { + display: flex; +} + +button, input { + border-radius: 8px; + width: 100px; /* Reduced Width */ + height: 50px; /* Square Buttons */ + margin: 10px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Added subtle shadow */ + transition: transform 0.2s ease; /* Smooth transition */ +} + +button:hover { + transform: scale(1.1); /* Slightly enlarge on hover */ +} + +#white { + background-color: white; +} + +#black { + background-color: black; +} + +input[type="color"] { + width: 100px; /* Auto width for color input */ + padding: 5px; /* Remove padding */ +} + +input:hover{ + transform: scale(1.1); /* Slightly enlarge on hover */ +} diff --git a/week-3/solution/easy/quiz-app/README.md b/week-3/solution/easy/quiz-app/README.md new file mode 100644 index 000000000..d41f58535 --- /dev/null +++ b/week-3/solution/easy/quiz-app/README.md @@ -0,0 +1,13 @@ + +# Quiz-App + +Your task is to design and implement a Quiz application that meets the following requirements: + +- The UI should resemble the example shown [here](https://utfs.io/f/032c6baa-e76a-4e26-b6b2-f6a105c15f03-pym7du.webm) + +- display the result after submitting the quiz. + +- you don't need to use api or backend, use data mentioned in `data.js` + + +### Don't copy UI as it is, only take reference from it. \ No newline at end of file diff --git a/week-3/solution/easy/quiz-app/data.js b/week-3/solution/easy/quiz-app/data.js new file mode 100644 index 000000000..430579680 --- /dev/null +++ b/week-3/solution/easy/quiz-app/data.js @@ -0,0 +1,35 @@ +// use this quizData in your app. +export const quizData = [{ + "question": "Which language runs in a web browser?", + "a": "Java", + "b": "C", + "c": "Python", + "d": "JavaScript", + "correct": "d", +}, +{ + "question": "What does CSS stand for?", + "a": "Central Style Sheets", + "b": "Cascading Style Sheets", + "c": "Cascading Simple Sheets", + "d": "Cars SUVs Sailboats", + "correct": "b", +}, +{ + "question": "What does HTML stand for?", + "a": "Hypertext Markup Language", + "b": "Hypertext Markdown Language", + "c": "Hyperloop Machine Language", + "d": "Helicopters Terminals Motorboats Lamborginis", + "correct": "a", +}, +{ + "question": "What year was JavaScript launched?", + "a": "1996", + "b": "1995", + "c": "1994", + "d": "none of the above", + "correct": "b", +}, +// you can add more quiz here +] \ No newline at end of file diff --git a/week-3/solution/easy/quiz-app/package-lock.json b/week-3/solution/easy/quiz-app/package-lock.json new file mode 100644 index 000000000..2dbca148c --- /dev/null +++ b/week-3/solution/easy/quiz-app/package-lock.json @@ -0,0 +1,833 @@ +{ + "name": "quiz", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "quiz", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.21.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/week-3/solution/easy/quiz-app/package.json b/week-3/solution/easy/quiz-app/package.json new file mode 100644 index 000000000..baafc64aa --- /dev/null +++ b/week-3/solution/easy/quiz-app/package.json @@ -0,0 +1,16 @@ +{ + "name": "quiz", + "version": "1.0.0", + "main": "data.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "express": "^4.21.2" + } +} diff --git a/week-3/solution/easy/quiz-app/public/index.html b/week-3/solution/easy/quiz-app/public/index.html new file mode 100644 index 000000000..b495aa4b1 --- /dev/null +++ b/week-3/solution/easy/quiz-app/public/index.html @@ -0,0 +1,23 @@ + + + + + + Quiz App + + + +
+

Quiz App

+
+

+
+
+ + + +

+
+ + + \ No newline at end of file diff --git a/week-3/solution/easy/quiz-app/public/script.js b/week-3/solution/easy/quiz-app/public/script.js new file mode 100644 index 000000000..140b8887d --- /dev/null +++ b/week-3/solution/easy/quiz-app/public/script.js @@ -0,0 +1,124 @@ +const startBtn = document.getElementById('start-btn'); +const nextBtn = document.getElementById('next-btn'); +const backBtn = document.getElementById('back-btn'); +const questionContainer = document.getElementById('question-container'); +const questionElement = document.getElementById('question'); +const optionsContainer = document.getElementById('options-container'); +const scoreElement = document.getElementById('score'); + +let currentQuestionIndex = 0; +let score = 0; +let quizData = []; +let selectedOption = null; +let userAnswers = []; // Track user's answers + +// Fetch quiz data from the server +async function fetchQuizData() { + const response = await fetch('/quiz-data'); + quizData = await response.json(); +} + +// Start the quiz +startBtn.addEventListener('click', () => { + startBtn.classList.add('hide'); + questionContainer.classList.remove('hide'); + backBtn.classList.remove('hide'); + nextBtn.classList.remove('hide'); + showQuestion(); +}); + +// Show the current question +function showQuestion() { + if (quizData.length === 0) { + questionElement.innerText = "No questions available."; + optionsContainer.innerHTML = ''; + return; + } + + const question = quizData[currentQuestionIndex]; + questionElement.innerText = question.question; + optionsContainer.innerHTML = ''; + question.options.forEach(option => { + const button = document.createElement('button'); + button.innerText = option; + button.addEventListener('click', () => selectAnswer(option, button)); + optionsContainer.appendChild(button); + }); + + // Restore selected option + selectedOption = userAnswers[currentQuestionIndex] || null; + if (selectedOption) { + const selectedButton = Array.from(optionsContainer.children).find( + btn => btn.innerText === selectedOption + ); + selectedButton.classList.add('selected'); + } + + // Disable "Back" button on the first question + backBtn.disabled = currentQuestionIndex === 0; +} + +// Handle answer selection and deselection +function selectAnswer(option, button) { + if (selectedOption === option) { + button.classList.remove('selected'); + selectedOption = null; + userAnswers[currentQuestionIndex] = null; // Deselect the answer + } else { + if (selectedOption) { + const previouslySelectedButton = Array.from(optionsContainer.children).find( + btn => btn.innerText === selectedOption + ); + previouslySelectedButton.classList.remove('selected'); + } + button.classList.add('selected'); + selectedOption = option; + userAnswers[currentQuestionIndex] = option; // Store the selected answer + } +} + +// Move to the next question +nextBtn.addEventListener('click', () => { + if (selectedOption === null) { + alert('Please select an option before proceeding!'); + return; + } + + currentQuestionIndex++; + if (currentQuestionIndex < quizData.length) { + showQuestion(); + } else { + calculateScore(); // Recalculate score before ending the quiz + endQuiz(); + } +}); + +// Move to the previous question +backBtn.addEventListener('click', () => { + if (currentQuestionIndex > 0) { + currentQuestionIndex--; + showQuestion(); + } +}); + +// Calculate the score +function calculateScore() { + score = 0; + userAnswers.forEach((answer, index) => { + if (answer === quizData[index].answer) { + score++; + } + }); +} + +// End the quiz and show the score +function endQuiz() { + questionContainer.classList.add('hide'); + backBtn.classList.add('hide'); + nextBtn.classList.add('hide'); + scoreElement.classList.remove('hide'); + scoreElement.innerText = `Your score: ${score} out of ${quizData.length}`; +} + +// Initialize the app +fetchQuizData(); \ No newline at end of file diff --git a/week-3/solution/easy/quiz-app/public/styles.css b/week-3/solution/easy/quiz-app/public/styles.css new file mode 100644 index 000000000..c94c4756e --- /dev/null +++ b/week-3/solution/easy/quiz-app/public/styles.css @@ -0,0 +1,56 @@ +body { + font-family: Arial, sans-serif; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; + background-color: #f0f0f0; + } + + .quiz-container { + background: white; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + text-align: center; + } + + .hide { + display: none; + } + + button { + padding: 10px 20px; + margin: 10px; + border: none; + border-radius: 5px; + background-color: #007bff; + color: white; + cursor: pointer; + } + + button:hover { + background-color: #0056b3; + } + + #options-container { + display: flex; + flex-direction: column; + gap: 10px; + } + + #options-container button { + background-color: #f0f0f0; + color: black; + } + + #options-container button.selected { + background-color: #007bff; + color: white; + } + + #options-container button:not(.selected) { + background-color: #f0f0f0; + color: black; + } \ No newline at end of file diff --git a/week-3/solution/easy/quiz-app/server.js b/week-3/solution/easy/quiz-app/server.js new file mode 100644 index 000000000..45c031cfe --- /dev/null +++ b/week-3/solution/easy/quiz-app/server.js @@ -0,0 +1,16 @@ +// server.js +const express = require('express'); +const app = express(); +const data = require('./data.js'); + +app.use(express.static('public')); // Serve static files (HTML, CSS, JS) + +// Endpoint to get quiz data +app.get('/quiz-data', (req, res) => { + res.json(data); +}); + +const PORT = 3000; +app.listen(PORT, () => { + console.log(`Server is running on http://localhost:${PORT}`); +}); \ No newline at end of file diff --git a/week-3/solution/hard/taskify/README.md b/week-3/solution/hard/taskify/README.md new file mode 100644 index 000000000..f59186000 --- /dev/null +++ b/week-3/solution/hard/taskify/README.md @@ -0,0 +1,18 @@ + +# Taskify + +- Create a Task Management Application with drag-drop functionality between the category. + +- you can avoid time, and type of TODO (easy, medium, hard). + + +- The UI should resemble the example shown below.. + +![Image](https://utfs.io/f/c63f4dc5-6833-4c65-9b07-e1421d833ee2-ng18dw.png) + + + +### Don't copy UI as it is, only take reference from it. + + + diff --git a/week-3/solution/hard/taskify/public/index.html b/week-3/solution/hard/taskify/public/index.html new file mode 100644 index 000000000..dd1630765 --- /dev/null +++ b/week-3/solution/hard/taskify/public/index.html @@ -0,0 +1,47 @@ + + + + + + Taskify + + + +
+

Taskify

+
+ +
+

To Do

+
+
+ + +
+

In Progress

+
+
+ + +
+

Under Review

+
+
+ + +
+

Finished

+
+
+
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/week-3/solution/hard/taskify/public/script.js b/week-3/solution/hard/taskify/public/script.js new file mode 100644 index 000000000..cf992796f --- /dev/null +++ b/week-3/solution/hard/taskify/public/script.js @@ -0,0 +1,65 @@ +document.getElementById("add-task-btn").addEventListener("click", () => { + const taskInput = document.getElementById('task-input').value; + const parentBody = document.getElementById("todo-tasks"); + + if(taskInput){ + const taskElement = document.createElement("div") + taskElement.className = "task" + taskElement.draggable = true + taskElement.textContent = taskInput + + taskElement.addEventListener("dragstart", dragStart) + taskElement.addEventListener("dragend", dragEnd) + + parentBody.appendChild(taskElement) + + taskInput.value = ''; + } +}) + +let draggedTask = null; + +function dragStart(event) { + draggedTask = event.target; + setTimeout(() => { + event.target.style.display = 'none'; + }, 0); +} + +function dragEnd(event) { + setTimeout(() => { + event.target.style.display = 'block'; + draggedTask = null; + }, 0); +} + +function dragOver(event){ + event.preventDefault() +} + +function dragEnter(event){ + event.preventDefault() + event.target.classList.add("over") +} + +function dragLeave(event){ + event.target.classList.remove("over") +} + +function drop(event){ + event.preventDefault() + event.target.classList.remove("over") + + if(event.target.classList.contains("tasks")){ + event.target.appendChild(draggedTask) + } +} + +const taskContainers = document.querySelectorAll(".tasks") + +taskContainers.forEach((container) => { + container.addEventListener('dragover', dragOver); + container.addEventListener('dragenter', dragEnter); + container.addEventListener('dragleave', dragLeave); + container.addEventListener('drop', drop); +}) \ No newline at end of file diff --git a/week-3/solution/hard/taskify/public/styles.css b/week-3/solution/hard/taskify/public/styles.css new file mode 100644 index 000000000..f9c129871 --- /dev/null +++ b/week-3/solution/hard/taskify/public/styles.css @@ -0,0 +1,77 @@ +body{ + font-family: Arial, Helvetica, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 20px; +} + +.container{ + max-width: 1200px; + margin: 0 auto +} + +h1{ + text-align: center; + color: #333; +} + +.categories { + display: flex; + justify-content: space-between; + margin-top: 20px; + gap: 10px; /* Add some spacing between categories */ +} + +.category { + background-color: #fff; + border: 1px solid #ddd; + border-radius: 8px; + padding: 15px; + flex: 1 1 200px; /* Grow and shrink, but don't shrink below 200px */ + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.tasks { + min-height: 200px; /* Minimum height to prevent resizing */ + overflow-y: auto; /* Add a scrollbar if content overflows */ + border: 1px solid #ddd; /* Optional: Add a border for better visibility */ + margin-top: 10px; +} + +.task { + background-color: #f9f9f9; + border: 1px solid #ddd; + border-radius: 4px; + padding: 10px; + margin-bottom: 10px; + min-width: 100px +} + +.add-task{ + margin-top: 20px; + text-align:center +} + +#task-input { + padding: 10px; + width: 300-x; + border: 1px solid #ddd; + border-radius: 8px; +} + +#add-task-btn { + padding: 10px 20px; + background-color: #007bff; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; +} + +#add-task-btn:hover { + background-color: #0056b3; +} + +.tasks.over { + border: 2px dashed #007bff; /* Highlight the container */ +} \ No newline at end of file diff --git a/week-3/solution/hard/taskify/server.js b/week-3/solution/hard/taskify/server.js new file mode 100644 index 000000000..e69de29bb diff --git a/week-3/solution/medium/Form-Builder/README.md b/week-3/solution/medium/Form-Builder/README.md new file mode 100644 index 000000000..1972839f2 --- /dev/null +++ b/week-3/solution/medium/Form-Builder/README.md @@ -0,0 +1,16 @@ + +# Form-Builder + +- Your task is to a form builder that allows users to add different types of input fields dynamically. Include options for text inputs, checkboxes, and radio buttons. Each added field should be displayed in a preview area. + + +- The UI should resemble the example shown below.. + +![Image](https://utfs.io/f/9174ecc0-b9c4-454c-9db6-2d6f1ed6138d-ng35bm.png) + + + +### Don't copy UI as it is, only take reference from it. + + + diff --git a/week-3/solution/medium/Form-Builder/index.html b/week-3/solution/medium/Form-Builder/index.html new file mode 100644 index 000000000..31e7e9106 --- /dev/null +++ b/week-3/solution/medium/Form-Builder/index.html @@ -0,0 +1,39 @@ + + + + + + Document + + + +
+

Form Builder

+

Field type

+ + + +

Field Label

+ + +

Placeholder (for Input)

+ + +
+ +
+
+ +
+

Form Preview

+
+ + + + + \ No newline at end of file diff --git a/week-3/solution/medium/Form-Builder/script.js b/week-3/solution/medium/Form-Builder/script.js new file mode 100644 index 000000000..33f444f57 --- /dev/null +++ b/week-3/solution/medium/Form-Builder/script.js @@ -0,0 +1,89 @@ +document.getElementById("addButton").addEventListener("click", function () { + const elementToCreate = document.getElementById("type").value; + const labelToBeAttached = document.getElementById("labelName").value; + const placeholder = document.getElementById("placeholder").value; + + elementCreator(elementToCreate, labelToBeAttached, placeholder); + + // Clear input fields after adding an element + document.getElementById("labelName").value = ""; + document.getElementById("placeholder").value = ""; +}); + +function elementCreator(elementToCreate, labelToBeAttached, placeholder) { + const previewContainer = document.getElementById("preview"); + + // Create a container for the new element and its label + const elementContainer = document.createElement("div"); + elementContainer.className = "form-element"; + + // Create a label for the element + const labelElement = document.createElement("label"); + labelElement.textContent = labelToBeAttached; + + // Create the new element based on the selected type + let newElement; + switch (elementToCreate) { + case "h3": + newElement = document.createElement("h3"); + newElement.textContent = labelToBeAttached; + break; + + case "input": + newElement = document.createElement("input"); + newElement.type = "text"; + newElement.placeholder = placeholder || ""; + break; + + case "datalist": + newElement = document.createElement("input"); + newElement.type = "text"; + newElement.placeholder = placeholder || ""; + const datalist = document.createElement("datalist"); + datalist.id = "datalist-" + labelToBeAttached.replace(/\s+/g, "-").toLowerCase(); + newElement.setAttribute("list", datalist.id); + + // Add some example options to the datalist + const options = ["Option 1", "Option 2", "Option 3"]; + options.forEach(option => { + const optionElement = document.createElement("option"); + optionElement.value = option; + datalist.appendChild(optionElement); + }); + + elementContainer.appendChild(datalist); + break; + + case "radio": + newElement = document.createElement("div"); + const radioOptions = ["Option 1", "Option 2", "Option 3"]; + radioOptions.forEach((option, index) => { + const radioInput = document.createElement("input"); + radioInput.type = "radio"; + radioInput.id = "radio-" + labelToBeAttached.replace(/\s+/g, "-").toLowerCase() + "-" + index; + radioInput.name = labelToBeAttached.replace(/\s+/g, "-").toLowerCase(); + + const radioLabel = document.createElement("label"); + radioLabel.htmlFor = radioInput.id; + radioLabel.textContent = option; + + newElement.appendChild(radioInput); + newElement.appendChild(radioLabel); + newElement.appendChild(document.createElement("br")); + }); + break; + + default: + console.error("Invalid element type"); + return; + } + + // Append the label and the new element to the container + if (elementToCreate !== "h3") { + elementContainer.appendChild(labelElement); + } + elementContainer.appendChild(newElement); + + // Append the container to the preview section + previewContainer.appendChild(elementContainer); +} \ No newline at end of file diff --git a/week-3/solution/medium/Form-Builder/styles.css b/week-3/solution/medium/Form-Builder/styles.css new file mode 100644 index 000000000..800046079 --- /dev/null +++ b/week-3/solution/medium/Form-Builder/styles.css @@ -0,0 +1,37 @@ +.container { + margin: 20px; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; +} + +.form-element { + margin-bottom: 15px; +} + +label { + display: block; + margin-bottom: 5px; + font-weight: bold; +} + +input[type="text"] { + width: 100%; + padding: 8px; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 4px; +} + +button { + padding: 10px 20px; + background-color: #007bff; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} \ No newline at end of file