From af06b8d8d8e74baa8cb8f356df37a7f5fa46535e Mon Sep 17 00:00:00 2001 From: AsifQamar Date: Thu, 7 Nov 2024 23:27:58 +0530 Subject: [PATCH 1/2] done --- blog.html | 1207 ++++++++++++++++++----------------------------------- 1 file changed, 405 insertions(+), 802 deletions(-) diff --git a/blog.html b/blog.html index 0f28d38c..b0c76666 100644 --- a/blog.html +++ b/blog.html @@ -721,54 +721,45 @@

Discover Travel Tips, Stories, and Inspiration

+ - - - addEventListeners(); - - function addEventListeners() { - // Add event listeners for read more links - document.querySelectorAll('.read-more').forEach(link => { - link.addEventListener('click', (e) => { - e.preventDefault(); - const article = e.target.closest('.blog-post'); - const content = article.querySelector('.content'); - const fullContent = article.querySelector('.full-content'); - - if (content.style.display !== 'none') { - content.style.display = 'none'; - fullContent.style.display = 'block'; - e.target.textContent = 'Read Less'; - } else { - content.style.display = 'block'; - fullContent.style.display = 'none'; - e.target.textContent = 'Read More'; - } - }); - }); - - // Add event listeners for comment forms - document.querySelectorAll('.comment-form').forEach(form => { - form.addEventListener('submit', (e) => { - e.preventDefault(); - const postId = parseInt(e.target.getAttribute('data-post-id')); - const comment = e.target.querySelector('textarea').value; - addComment(postId, comment); - e.target.reset(); - }); - }); - } - - function populateFilters() { - const categoryFilter = document.getElementById('categoryFilter'); - const tagFilter = document.getElementById('tagFilter'); - const categories = getLocalData('categories'); - const tags = getLocalData('tags'); - - categoryFilter.innerHTML = ''; - tagFilter.innerHTML = ''; - - categories.forEach(category => { - const option = document.createElement('option'); - option.value = category; - option.textContent = category; - categoryFilter.appendChild(option); - }); - - tags.forEach(tag => { - const option = document.createElement('option'); - option.value = tag; - option.textContent = tag; - tagFilter.appendChild(option); - }); - - // Add event listeners for filters - categoryFilter.addEventListener('change', filterPosts); - tagFilter.addEventListener('change', filterPosts); - } - - function filterPosts() { - const selectedCategory = document.getElementById('categoryFilter').value; - const selectedTag = document.getElementById('tagFilter').value; - const posts = getLocalData('blogPosts'); - - const filteredPosts = posts.filter(post => { - const categoryMatch = !selectedCategory || post.category === selectedCategory; - const tagMatch = !selectedTag || post.tags.includes(selectedTag); - return categoryMatch && tagMatch; - }); - - renderFilteredPosts(filteredPosts); - } - - function renderFilteredPosts(filteredPosts) { - const container = document.querySelector('.blog-container'); - container.innerHTML = ''; - - filteredPosts.forEach(post => { - const article = document.createElement('article'); - article.className = 'blog-post'; - article.innerHTML = ` -

${post.title}

-
Posted on ${post.date} by ${post.author}
-
${post.category}
-
${post.tags.map(tag => `${tag}`).join('')}
-
-

${post.content.substring(0, 150)}...

-
- - Read More -
-

Comments (${post.comments.length})

-
- ${post.comments.slice(0, 2).map(comment => ` -
-

${comment.text}

- ${comment.date} -
- `).join('')} -
-
- - -
-
- `; - container.appendChild(article); - }); - + - + - + - - - -
- - - - + + + + + + // + + + +
+ + + + + + + + + - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - animateCircles(); - - - - - +
+ + + + + + + +
+ + + +
+ 🗨️ +
+ + +
+ +
+
+ + + + +

+ + +
+
Visitor
+
+
+ + + + + + + + + \ No newline at end of file From bd7c2a44854829f318f7b4ed5f7098e1c7bc11f3 Mon Sep 17 00:00:00 2001 From: AsifQamar Date: Thu, 7 Nov 2024 23:39:33 +0530 Subject: [PATCH 2/2] done --- contact.html | 656 ++++++++++++++++----------------------------------- 1 file changed, 209 insertions(+), 447 deletions(-) diff --git a/contact.html b/contact.html index 3935c0d2..80139f82 100644 --- a/contact.html +++ b/contact.html @@ -1,478 +1,240 @@ - + Contact Us Form + + + - - - - - -
-
-