diff --git a/AI Quote Generator/index.html b/AI Quote Generator/index.html
index 5c505851a..9c1150e07 100644
--- a/AI Quote Generator/index.html
+++ b/AI Quote Generator/index.html
@@ -1,21 +1,48 @@
-
-
-
+
+
+
+ AI Quotes Generator
+
+
+
+
+
+
+
Press the button to get an inspirational quote.
+
-
+
+
+
+
+
diff --git a/AI Quote Generator/script.js b/AI Quote Generator/script.js
index 18672ae5e..4b2f42f17 100644
--- a/AI Quote Generator/script.js
+++ b/AI Quote Generator/script.js
@@ -1,28 +1,47 @@
-const getQuoteBtn = document.getElementById("getQuoteBtn");
-const quoteText = document.getElementById("quoteText");
+// your code goes here
+// script.js
-getQuoteBtn.addEventListener("click", () => {
- getQuoteBtn.classList.add("loading");
- getQuoteBtn.textContent = "Loading...";
- getQuote();
-});
+const btn = document.getElementById('getQuoteBtn');
+const quoteText = document.getElementById('quoteText');
+const quoteContainer = document.getElementById('quoteContainer');
-// Initially, remove loading state
-getQuoteBtn.classList.remove("loading");
-getQuoteBtn.textContent = "Get Quote";
+// Util: set loading state with a spinner icon on the button
+function setLoading(isLoading) {
+ quoteContainer.setAttribute('aria-busy', String(isLoading));
+ if (isLoading) {
+ btn.setAttribute('disabled', 'true');
+ // Replace wand icon with spinner
+ btn.innerHTML = `
Loading...`;
+ } else {
+ btn.removeAttribute('disabled');
+ btn.innerHTML = `
Get Quote`;
+ }
+}
+
+// Fetch a random quote from Quotable
+async function fetchQuote() {
+ try {
+ setLoading(true);
+ // Quotable: GET https://api.quotable.io/random
+ const res = await fetch('https://api.quotable.io/random', { cache: 'no-store' });
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
+ const data = await res.json();
+
+ // Expecting { content, author }
+ const content = data.content?.trim() || 'No quote available right now.';
+ const author = data.author ? ` — ${data.author}` : '';
-function getQuote() {
- fetch("https://api.quotable.io/random")
- .then((response) => response.json())
- .then((data) => {
- quoteText.innerHTML = `"${data.content}" - ${data.author}`;
- getQuoteBtn.classList.remove("loading");
- getQuoteBtn.textContent = "Get Quote";
- })
- .catch((error) => {
- console.error("Error fetching quote:", error);
- quoteText.innerHTML = "Failed to fetch a quote. Please try again later.";
- getQuoteBtn.classList.remove("loading");
- getQuoteBtn.textContent = "Get Quote";
- });
+ quoteText.textContent = `${content}${author}`;
+ } catch (err) {
+ console.error(err);
+ quoteText.textContent = 'Could not fetch a quote. Please try again.';
+ } finally {
+ setLoading(false);
+ }
}
+
+// Events
+btn.addEventListener('click', fetchQuote);
+
+// Initial fetch on page load
+window.addEventListener('DOMContentLoaded', fetchQuote);
diff --git a/AI Quote Generator/styles.css b/AI Quote Generator/styles.css
index 9517d8672..ad439e2ef 100644
--- a/AI Quote Generator/styles.css
+++ b/AI Quote Generator/styles.css
@@ -1,56 +1,98 @@
+/* styles.css */
+:root {
+ --accent: #3498db;
+ --bg: #0f172a;
+ --card: #111827;
+ --text: #e5e7eb;
+ --muted: #9ca3af;
+}
+
+* { box-sizing: border-box; }
+
body {
- font-family: Arial, sans-serif;
- background-color: #3498db;
- margin: 0;
- padding: 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-start; /* Adjusted to align header at the top */
- height: 100vh;
+ margin: 0;
+ background:
+ radial-gradient(1200px 600px at 10% -10%, #1e293b, transparent),
+ radial-gradient(1200px 600px at 90% -20%, #0b3a67, transparent),
+ var(--bg);
+ color: var(--text);
+ font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
+ min-height: 100vh;
+ display: grid;
+ place-items: center;
}
header {
- background-color: #2c3e50;
- color: #ecf0f1;
- text-align: center;
- padding: 10px;
- width: 100%;
+ text-align: center;
+ margin-top: 2rem;
+}
+
+header h1 {
+ font-family: "Dancing Script", cursive;
+ font-weight: 700;
+ font-size: 2.4rem;
+ letter-spacing: 0.5px;
+ margin: 0 1rem;
+}
+
+header h1 .fa-robot {
+ color: var(--accent);
+ margin-right: 0.5rem;
}
.container {
- text-align: center;
- background-color: #fff;
- padding: 20px;
- margin-left: 2%;
- margin-right: 2%;
- border-radius: 5px;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
+ width: min(680px, 92vw);
+ margin: 2rem auto 4rem;
+ display: grid;
+ gap: 1rem;
}
-button {
- padding: 10px 20px;
- font-size: 18px;
- cursor: pointer; /* Set default cursor to pointer */
- background-color: #3498db; /* Default background color */
- color: #fff;
- border: none;
- border-radius: 5px;
- transition: background-color 0.3s, transform 0.3s, filter 0.3s;
+#quoteContainer {
+ background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
+ border: 1px solid rgba(255,255,255,0.06);
+ border-radius: 16px;
+ padding: 1.5rem 1.25rem;
+ position: relative;
+ box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
-button.loading {
- background-color: #ddd;
- cursor: not-allowed;
+#quoteContainer .fa-quote-left,
+#quoteContainer .fa-quote-right {
+ color: var(--muted);
+ font-size: 1rem;
+ opacity: 0.9;
}
-button:hover {
- background-color: #2980b9;
- transform: scale(1.05); /* Zoom in effect on hover */
- filter: brightness(0.9); /* Darken the button on hover */
+#quoteContainer .fa-quote-right {
+ float: right;
}
-#quoteContainer {
- margin-top: 20px;
- font-size: 20px;
+#quoteText {
+ font-family: "Dancing Script", cursive;
+ font-size: 1.8rem;
+ line-height: 1.5;
+ margin: 0.5rem 0;
+ color: var(--text);
+ text-wrap: pretty;
+}
+
+#getQuoteBtn {
+ background-color: var(--accent);
+ color: white;
+ border: none;
+ border-radius: 12px;
+ padding: 0.9rem 1.1rem;
+ font-size: 1rem;
+ cursor: pointer;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.6rem;
+ justify-self: start;
+ transition: transform 0.05s ease, filter 0.2s ease, opacity 0.2s ease;
}
+
+#getQuoteBtn:hover { filter: brightness(1.05); }
+#getQuoteBtn:active { transform: translateY(1px); }
+#getQuoteBtn[disabled] { opacity: 0.7; cursor: not-allowed; }
+
+#getQuoteBtn .fa-wand-magic-sparkles { font-size: 1.05rem; }
diff --git a/Age Calculator/index.html b/Age Calculator/index.html
index 0b682201a..b7cef1427 100644
--- a/Age Calculator/index.html
+++ b/Age Calculator/index.html
@@ -4,20 +4,78 @@
+
Age Calculator - Calculate Your Age
+
+
+
+
+
+
+
+
+
-
Age Calculator
-
-
Enter the DOB badri in format : (MM/DD/YYYY)
-
-
+
+
+
+
+
+
+
Loading current date...
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+