From f0a1a657a35de6ed700144b734450debd183a0a1 Mon Sep 17 00:00:00 2001 From: Alvin <524715@vistacollege.nl> Date: Wed, 4 Jun 2025 09:38:33 +0200 Subject: [PATCH] Revamp index.html with Bootstrap and Tailwind CSS integration, add navigation and main content structure, and implement JavaScript for interactivity. Remove unused style.css file. --- css/style.css | 0 css/styles.css | 186 +++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 49 ++++++++++++- js/script.js | 20 ++++++ 4 files changed, 252 insertions(+), 3 deletions(-) delete mode 100644 css/style.css create mode 100644 css/styles.css diff --git a/css/style.css b/css/style.css deleted file mode 100644 index e69de29..0000000 diff --git a/css/styles.css b/css/styles.css new file mode 100644 index 0000000..cebdbe8 --- /dev/null +++ b/css/styles.css @@ -0,0 +1,186 @@ +/* Fallback styles in case CDN links fail */ +:root { + --primary-color: #0d6efd; + --dark-bg: #212529; + --light-bg: #f8f9fa; + --text-dark: #212529; + --text-light: #6c757d; + --white: #ffffff; + --shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +/* Reset and base styles */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + line-height: 1.5; + background-color: var(--light-bg); + color: var(--text-dark); +} + +/* Container fallback */ +.container { + width: 100%; + max-width: 1200px; + margin: 0 auto; + padding: 0 15px; +} + +/* Navbar fallback */ +.navbar { + background-color: var(--dark-bg); + padding: 1rem 0; + box-shadow: var(--shadow); +} + +.navbar-brand { + color: var(--white); + text-decoration: none; + font-size: 1.25rem; + font-weight: bold; +} + +.navbar-nav { + list-style: none; + display: flex; + gap: 1rem; +} + +.nav-link { + color: var(--white); + text-decoration: none; + opacity: 0.8; + transition: opacity 0.3s ease; +} + +.nav-link:hover, +.nav-link.active { + opacity: 1; +} + +/* Button fallback */ +.btn { + display: inline-block; + padding: 0.5rem 1rem; + border: none; + border-radius: 0.25rem; + cursor: pointer; + text-decoration: none; + transition: all 0.3s ease; +} + +.btn-primary { + background-color: var(--primary-color); + color: var(--white); +} + +.btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 4px 6px rgba(0,0,0,0.1); +} + +/* Grid fallback */ +.row { + display: flex; + flex-wrap: wrap; + margin: -15px; +} + +.col-md-8 { + flex: 0 0 66.666667%; + max-width: 66.666667%; + padding: 15px; +} + +.mx-auto { + margin-left: auto; + margin-right: auto; +} + +/* Utility classes fallback */ +.py-8 { + padding-top: 2rem; + padding-bottom: 2rem; +} + +.mt-4 { + margin-top: 1rem; +} + +.mb-4 { + margin-bottom: 1rem; +} + +.text-3xl { + font-size: 1.875rem; +} + +.font-bold { + font-weight: 700; +} + +.text-gray-600 { + color: var(--text-light); +} + +.bg-white { + background-color: var(--white); +} + +.rounded-lg { + border-radius: 0.5rem; +} + +.shadow-md { + box-shadow: var(--shadow); +} + +.p-6 { + padding: 1.5rem; +} + +/* Custom styles */ +.navbar { + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +.btn-primary { + transition: all 0.3s ease; +} + +.btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 4px 6px rgba(0,0,0,0.1); +} + +/* Custom animations */ +@keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } +} + +.fade-in { + animation: fadeIn 0.5s ease-in; +} + +/* Responsive fallback */ +@media (max-width: 768px) { + .navbar-nav { + flex-direction: column; + display: none; + } + + .navbar-nav.show { + display: flex; + } + + .col-md-8 { + flex: 0 0 100%; + max-width: 100%; + } +} \ No newline at end of file diff --git a/index.html b/index.html index d01f779..d7e1d76 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,52 @@ - Document + My Website + + + + + + - - + + + +
+
+
+
+

Welcome to My Website

+

This is a basic website using both Bootstrap and Tailwind CSS for styling.

+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/js/script.js b/js/script.js index e69de29..f095e57 100644 --- a/js/script.js +++ b/js/script.js @@ -0,0 +1,20 @@ +// Add fade-in animation to main content +document.addEventListener('DOMContentLoaded', () => { + const mainContent = document.querySelector('main'); + mainContent.classList.add('fade-in'); + + // Add click event to the Learn More button + const learnMoreBtn = document.querySelector('.btn-primary'); + learnMoreBtn.addEventListener('click', () => { + alert('Thanks for your interest! This is a demo website.'); + }); + + // Add active class to current nav item + const navLinks = document.querySelectorAll('.nav-link'); + navLinks.forEach(link => { + link.addEventListener('click', (e) => { + navLinks.forEach(l => l.classList.remove('active')); + e.target.classList.add('active'); + }); + }); +});