Skip to content

Commit

Permalink
Merge pull request #12 from Hilda-Enyioko/hillary
Browse files Browse the repository at this point in the history
Hillary
  • Loading branch information
ChikenduHillary authored Jun 9, 2024
2 parents 57796c0 + 2a82d80 commit d9f75e8
Show file tree
Hide file tree
Showing 10 changed files with 866 additions and 644 deletions.
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSCRIBE_TOKEN=ab448096-dfd4-4e36-a433-7141de8ce724
21 changes: 11 additions & 10 deletions About Page/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="bar"></div>
<div class="bar"></div>
</div>
<a href="https://hilda-enyioko.github.io/Inclusive-Talks/"
<a href="https://www.inclusivetalks.org/"
><li class="nav-link">Home</li></a
>
<a href="../Blog Page/blog.html"><li class="nav-link">Blog</li></a>
Expand Down Expand Up @@ -274,15 +274,15 @@ <h2>Subscribe To Our Blog via Email</h2>
notifications of new posts by email.
</p>
<input
type="text"
name=""
id="input-email"
placeholder="Email address"
/><br />
<button class="cta-btn" id="sub-btn" type="button">
SUBSCRIBE
</button>
</div>
type="text"
name=""
id="input-email"
placeholder="Email address"
/><br />
<div id="feedback" style="display: none; color: red"></div>
<button class="cta-btn" id="sub-btn" type="button">
SUBSCRIBE
</button>
</div>
</section>

Expand Down Expand Up @@ -391,5 +391,6 @@ <h2>About Us</h2>
});
});
</script>
<script src="../subscribe.js"></script>
</body>
</html>
6 changes: 4 additions & 2 deletions Blog Page/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="bar"></div>
<div class="bar"></div>
</div>
<a href="https://hilda-enyioko.github.io/Inclusive-Talks/"
<a href="https://www.inclusivetalks.org/"
><li class="nav-link">Home</li></a
>
<a href="blog.html"><li class="nav-link active">Blog</li></a>
Expand Down Expand Up @@ -153,7 +153,7 @@ <h4>Written By: John Doe</h4>
</div>
</section>

<section class="blog-section">
<section class="blog-section" id="posts-container">
<div class="blog-post">
<h1>Blog Posts</h1>
<h2>Gratitude For Diversity</h2>
Expand Down Expand Up @@ -227,6 +227,7 @@ <h2>Subscribe To Our Blog via Email</h2>
id="input-email"
placeholder="Email address"
/><br />
<div id="feedback" style="display: none; color: red"></div>
<button class="cta-btn" id="sub-btn" type="button">
SUBSCRIBE
</button>
Expand Down Expand Up @@ -328,5 +329,6 @@ <h2>About Us</h2>
</div>

<script src="script.js"></script>
<script src="../subscribe.js"></script>
</body>
</html>
91 changes: 77 additions & 14 deletions Blog Page/script.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,83 @@
const hambugerMenu = document.querySelector(".hambuger-menu")
const navMenu = document.querySelector(".nav-menu")
const closeBtn = document.querySelector(".close-button")
const hambugerMenu = document.querySelector(".hambuger-menu");
const navMenu = document.querySelector(".nav-menu");
const closeBtn = document.querySelector(".close-button");

hambugerMenu.addEventListener("click", () =>{
navMenu.classList.toggle("active")
})
hambugerMenu.addEventListener("click", () => {
navMenu.classList.toggle("active");
});

closeBtn.addEventListener("click", () => {
navMenu.classList.toggle("active")
})
navMenu.classList.toggle("active");
});

const questions = document.querySelectorAll(".the-questions");

const questions = document.querySelectorAll(".the-questions")
questions.forEach((questions) => {
questions.addEventListener("click", () => {
questions.classList.toggle("active");
});
});

questions.forEach(questions => {
questions.addEventListener("click", () => {
questions.classList.toggle("active");
})
})
// Fetching of blog post
document.addEventListener("DOMContentLoaded", () => {
// Function to fetch posts from the API
async function fetchPosts() {
try {
// Send a GET request to the API endpoint
const response = await fetch(
"https://inclusive-talks.vercel.app/api/trpc/getAllPost"
);
console.log(response);

// Check if the request was successful
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}

// Parse the JSON response
const res = await response.json();
console.log({ res });
const { data } = res.result;
console.log(data);

const postsContainer = document.getElementById("posts-container");

// Clear the container
postsContainer.innerHTML = "";

// Iterate over the posts and create HTML for each post
data.forEach((post) => {
const postElement = document.createElement("div");
postElement.className = "blog-section";
postElement.innerHTML = `
<div class="blog-post">
<h1>Blog Posts</h1>
<h2>${post.title}</h2>
<div class="post">
<div class="post-text">
<h4>Written By: ${post.writtenBy}</h4>
<p>
${post.text}
<a href="../Blog Page/Gratitude for diversity/post.html"
>CONTINUE READING....</a
>
</p>
</div>
<div class="post-img">
<img src=${post.imgUrl} alt="" />
</div>
</div>
</div>
`;
postsContainer.appendChild(postElement);
});
} catch (error) {
console.error("Error fetching posts:", error);
}
}

// Call the fetchPosts function to load the posts when the page loads
fetchPosts();
});
10 changes: 6 additions & 4 deletions Contact Page/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="bar"></div>
<div class="bar"></div>
</div>
<a href="https://hilda-enyioko.github.io/Inclusive-Talks/"
<a href="https://www.inclusivetalks.org/"
><li class="nav-link">Home</li></a
>
<a href="../Blog Page/blog.html"><li class="nav-link">Blog</li></a>
Expand Down Expand Up @@ -180,12 +180,13 @@ <h3 id="subscribe-title">Subscribe To Our Blog Via Email</h3>
notifications of new posts by email.
</p>
<input
type="email"
placeholder="Email address"
type="text"
name=""
id="input-email"
placeholder="Email address"
/><br />
<button class="cta-button" type="button" action="">SUBSCRIBE</button>
<div id="feedback" style="display: none; color: red"></div>
<button class="cta-button" id="sub-btn" type="button">SUBSCRIBE</button>
</div>
</section>

Expand Down Expand Up @@ -273,5 +274,6 @@ <h3 class="footer-header">About Us</h3>
</footer>

<script src="./script.js"></script>
<script src="../subscribe.js"></script>
</body>
</html>
10 changes: 6 additions & 4 deletions Program Page/Programs_Main Page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="bar"></div>
<div class="bar"></div>
</div>
<a href="https://hilda-enyioko.github.io/Inclusive-Talks/"
<a href="https://www.inclusivetalks.org/"
><li class="nav-link">Home</li></a
>
<a href="../../Blog Page/blog.html"><li class="nav-link">Blog</li></a>
Expand Down Expand Up @@ -150,12 +150,13 @@ <h3 id="subscribe-title">Subscribe To Our Blog Via Email</h3>
notifications of new posts by email.
</p>
<input
type="email"
placeholder="Email address"
type="text"
name=""
id="input-email"
placeholder="Email address"
/><br />
<button class="cta-button" type="button" action="">SUBSCRIBE</button>
<div id="feedback" style="display: none; color: red"></div>
<button class="cta-button" id="sub-btn" type="button">SUBSCRIBE</button>
</div>
</section>

Expand Down Expand Up @@ -237,5 +238,6 @@ <h3 class="footer-header">About Us</h3>
</div>
</footer>
<script src="./script.js"></script>
<script src="../../subscribe.js"></script>
</body>
</html>
50 changes: 24 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="bar"></div>
<div class="bar"></div>
</div>
<a href="https://hilda-enyioko.github.io/Inclusive-Talks/"
<a href="https://www.inclusivetalks.org/"
><li class="nav-link active">Home</li></a
>
<a href="./Blog Page/blog.html"><li class="nav-link">Blog</li></a>
Expand Down Expand Up @@ -147,13 +147,6 @@ <h1>About Us</h1>
</section>
<!-- slider show section -->
<section class="slide-section">
<!-- slider navigation button -->
<div class="slide-navigation-btn">
<input type="radio" name="slide" class="radio-btn" id="radio1" />
<input type="radio" name="slide" class="radio-btn" id="radio2" />
<input type="radio" name="slide" class="radio-btn" id="radio3" />
</div>

<div class="slide-show">
<!-- first slide -->
<div class="slide">
Expand All @@ -164,26 +157,29 @@ <h1>
</h1>
</div>

<div class="sliders">
<div class="slides main">
<h2 class="our-reach">2000+</h2>
<p class="slide-text">reach across all platforms</p>
</div>
<div class="slides-container">
<div class="sliders">
<div class="slides">
<h2 class="our-reach">2000+</h2>
<p class="slide-text">reach across all platforms</p>
</div>

<!-- <div class="slides">
<h2 class="our-reach">150+</h2>
<p class="slide-text">
subscribers across all networks
</p>
</div>
<div class="slides">
<h2 class="our-reach">150+</h2>
<p class="slide-text">subscribers across all networks</p>
</div>

<div class="slides">
<h2 class="our-reach">2500+</h2>
<p class="slide-text">
impact across the globe
</p>
</div> -->
<div class="slides">
<h2 class="our-reach">2500+</h2>
<p class="slide-text">impact across the globe</p>
</div>
</div>
<!-- slider navigation button -->
<div class="slide-navigation-btn">
<div class="radio-btn" id="radio1"></div>
<div class="radio-btn" id="radio2"></div>
<div class="radio-btn" id="radio3"></div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -253,6 +249,7 @@ <h2>Subscribe To Our Blog via Email</h2>
id="input-email"
placeholder="Email address"
/><br />
<div id="feedback" style="display: none; color: red"></div>
<button class="cta-btn" id="sub-btn" type="button">
SUBSCRIBE
</button>
Expand Down Expand Up @@ -354,5 +351,6 @@ <h2>About Us</h2>
</div>

<script src="script.js"></script>
<script src="subscribe.js"></script>
</body>
</html>
59 changes: 45 additions & 14 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
const hambugerMenu = document.querySelector(".hambuger-menu")
const navMenu = document.querySelector(".nav-menu")
const closeBtn = document.querySelector(".close-button")
const hambugerMenu = document.querySelector(".hambuger-menu");
const navMenu = document.querySelector(".nav-menu");
const closeBtn = document.querySelector(".close-button");

hambugerMenu.addEventListener("click", () =>{
navMenu.classList.toggle("active")
})
hambugerMenu.addEventListener("click", () => {
navMenu.classList.toggle("active");
});

closeBtn.addEventListener("click", () => {
navMenu.classList.toggle("active")
})
navMenu.classList.toggle("active");
});

const questions = document.querySelectorAll(".the-questions");

const questions = document.querySelectorAll(".the-questions")
questions.forEach((questions) => {
questions.addEventListener("click", () => {
questions.classList.toggle("active");
});
});

questions.forEach(questions => {
questions.addEventListener("click", () => {
questions.classList.toggle("active");
})
})
// slide show
const slides = document.querySelectorAll(".slides");
const radioButtons = document.querySelectorAll(".radio-btn");
let currentSlide = 2;

function showSlide(index) {
slides.forEach((slide, i) => {
slide.classList.remove("active", "inactive");
radioButtons[i].classList.remove("active");
if (i === index) {
slide.classList.add("active");
radioButtons[i].classList.add("active");
} else if (i === (index + slides.length - 1) % slides.length) {
slide.classList.add("inactive");
}
});
}

function nextSlide() {
currentSlide = (currentSlide + 1) % slides.length;
showSlide(currentSlide);
}

setInterval(nextSlide, 5000);

radioButtons.forEach((btn, i) => {
btn.addEventListener("click", () => {
currentSlide = i;
showSlide(currentSlide);
});
});
Loading

0 comments on commit d9f75e8

Please sign in to comment.