Skip to content

Commit

Permalink
fixed whatever ghosh broke
Browse files Browse the repository at this point in the history
  • Loading branch information
gSayak committed Sep 18, 2023
1 parent 0588c5c commit 86105c2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 75 deletions.
1 change: 1 addition & 0 deletions assets/js/insights.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ fetch(
)
.then((response) => response.json())
.then((data) => {
console.log(data)
const container = document.getElementById("fact-check-list");
data.articles.forEach((article) => {
const listItem = document.createElement("li");
Expand Down
44 changes: 31 additions & 13 deletions assets/js/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,7 @@ fetch("https://vartapratikriya-api.vercel.app/articles/top_keywords", {
fetch("https://vartapratikriya-api.vercel.app/config")
.then((response) => response.json())
.then((data) => {
const outlets = Object.keys(data.outlets);
document.querySelectorAll(".channel h3").forEach((h3, index) => {
h3.textContent = outlets[index] || h3.textContent;
});
})
.catch((error) => {
console.error("Error:", error);
});

fetch("https://vartapratikriya-api.vercel.app/config")
.then((response) => response.json())
.then((data) => {
const languages = Object.values(data.outlets);
const languages = Object.keys(data.outlets);
const languageTitleContainer = document.getElementById("language_title");

if (languageTitleContainer) {
Expand All @@ -130,3 +118,33 @@ fetch("https://vartapratikriya-api.vercel.app/config")
.catch((error) => {
console.error("Error:", error);
});

fetch("https://vartapratikriya-api.vercel.app/config")
.then((response) => response.json())
.then((data) => {
const channels = Object.values(data.outlets);
const channelTitleContainer = document.getElementById("channel_title");

if (channelTitleContainer) {
channels.forEach((channel) => {
const channelBlock = document.createElement("div");
channelBlock.classList.add(
"d-flex",
"align-items-stretch",
"p-2",
"language-block"
);
channelBlock.innerHTML = `
<div class="icon-box" data-aos="fade-up" data-aos-delay="100">
<h4 class="title"><a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">${channel}</a></h4>
</div>
`;
channelTitleContainer.appendChild(channelBlock);
});

$(channelTitleContainer).owlCarousel({});
}
})
.catch((error) => {
console.error("Error:", error);
});
68 changes: 6 additions & 62 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,73 +126,21 @@ <h2 class="text-[#FF4560] flex flex-row justify-center font-bold mb-4 px-4 py-2"


<!-- ======= channels Section ======= -->

<section id="channels" class="channels">
<div class="container" data-aos="fade-up">
<div class="d-flex align-items-center justify-content-between bg-gray-200 py-2 px-4 mb-3">
<h3 class="m-0">Channels</h3>
<a class="text-secondary font-weight-medium text-decoration-none" href="">View All</a>
</div>
<div id="myCarousel" class="owl-carousel owl-theme my-3">
<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap"></h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
<div id="channel_title" class="owl-carousel owl-theme my-3"></div>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap"></h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap"></h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap">Aaj Tak</h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap">Aaj Tak</h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap">Aaj Tak</h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

<div class="channel bg-gray-500 shadow flex items-center p-2 lg:p-3 rounded-lg hover:bg-light-900">
<a href="language.html?language=malayalam" class="flex items-center space-x-2 ">
<i class="fas fa-newspaper fa-lg"></i>
<h3 class=" leading-5 font-medium text-white flex text-[11px] whitespace-nowrap">Aaj Tak</h3>
<i class="fa-regular fa-circle-dot fa-beat-fade fa-xs" style="color: #f50000;"></i>
</a>
</div>

</div>

</div>
</section><!-- End channels Section -->
</section>

<!-- End channels Section -->



Expand All @@ -205,11 +153,7 @@ <h3 class="m-0">Language</h3>
<a class="text-secondary font-weight-medium text-decoration-none" href="">View All</a>
</div>
<div id= "language_title" class="owl-carousel owl-theme">
<div class="d-flex align-items-stretch p-2">
<div class="icon-box" data-aos="fade-up" data-aos-delay="100">
<h4 class="title"><a href=""></a></h4>
</div>
</div>
</div>
</div>
</div>
</section>
Expand Down

0 comments on commit 86105c2

Please sign in to comment.