forked from Suchitra-Sahoo/AgriLearnNetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Added Tailwind And Effects on blog page"
- Loading branch information
1 parent
48133c9
commit df29043
Showing
12 changed files
with
513 additions
and
2,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,30 @@ | ||
|
||
// document.addEventListener('DOMContentLoaded', () => { | ||
// gsap.from(".fcard", { | ||
// opacity: 0, | ||
// y: 50, | ||
// duration: 1, | ||
// stagger: 0.2 | ||
// }); | ||
|
||
// // Optional: Animate search bar focus | ||
// const searchBar = document.querySelector('.search-bar'); | ||
// searchBar.addEventListener('focus', () => { | ||
// gsap.to(searchBar, { scale: 1.05, duration: 0.3 }); | ||
// }); | ||
// searchBar.addEventListener('blur', () => { | ||
// gsap.to(searchBar, { scale: 1, duration: 0.3 }); | ||
// }); | ||
// }); | ||
|
||
// function search() { | ||
// let box = [...document.querySelectorAll(".fcard")]; | ||
// let val = document.getElementById('input'); | ||
// let filter = val.value.toUpperCase().trim(); | ||
|
||
// for (let i = 0; i < box.length; i++) { | ||
// let component = box[i]; | ||
// let h2 = component.querySelector('h2'); | ||
// let componentName = h2.textContent || h2.innerText; | ||
|
||
// if (componentName.toUpperCase().indexOf(filter) > -1) { | ||
// component.style.display = "flex"; | ||
// } else { | ||
// component.style.display = "none"; | ||
// } | ||
// } | ||
// } | ||
// function search() { | ||
// let box=[...document.querySelectorAll(".fcard")] | ||
// let val=document.getElementById('input'); | ||
function search(){ | ||
let box=[...document.querySelectorAll(".fcard")] | ||
let val=document.getElementById('input'); | ||
|
||
|
||
// let filter=val.value.toUpperCase().trim(); | ||
// console.log(filter) | ||
// console.log(box) | ||
let filter=val.value.toUpperCase().trim(); | ||
console.log(filter) | ||
console.log(box) | ||
|
||
// for(let i=0;i<box.length;i++){ | ||
// let component=box[i]; | ||
// let h2=component.querySelector('h2'); | ||
// let componentName=h2.textContent|| h2.innerText; | ||
// console.log(componentName) | ||
// console.log((componentName.toUpperCase().indexOf(filter))) | ||
for(let i=0;i<box.length;i++){ | ||
let component=box[i]; | ||
let h2=component.querySelector('h2'); | ||
let componentName=h2.textContent|| h2.innerText; | ||
console.log(componentName) | ||
console.log((componentName.toUpperCase().indexOf(filter))) | ||
|
||
// if(componentName.toUpperCase().indexOf(filter)>-1){ | ||
// console.log(`Showing card ${i}: ${componentName}`); | ||
// component.style.display="flex"; | ||
if(componentName.toUpperCase().indexOf(filter)>-1){ | ||
console.log(`Showing card ${i}: ${componentName}`); | ||
component.style.display="flex"; | ||
|
||
|
||
// } | ||
// else{ | ||
// console.log(`Hiding card ${i}: ${componentName}`); | ||
// component.style.display="none"; | ||
} | ||
else{ | ||
console.log(`Hiding card ${i}: ${componentName}`); | ||
component.style.display="none"; | ||
|
||
// } | ||
// } | ||
// } | ||
document.addEventListener('DOMContentLoaded', () => { | ||
gsap.from(".fcard", { | ||
opacity: 0, | ||
y: 50, | ||
duration: 1, | ||
stagger: 0.2 | ||
}); | ||
|
||
// Animate search bar focus | ||
const searchBar = document.querySelector('.search-bar'); | ||
searchBar.addEventListener('focus', () => { | ||
gsap.to(searchBar, { scale: 1.05, duration: 0.3 }); | ||
}); | ||
searchBar.addEventListener('blur', () => { | ||
gsap.to(searchBar, { scale: 1, duration: 0.3 }); | ||
}); | ||
|
||
// Add hover effect to blog cards | ||
const cards = document.querySelectorAll('.fcard'); | ||
cards.forEach(card => { | ||
card.addEventListener('mouseenter', () => { | ||
gsap.to(card, { scale: 1.05, duration: 0.3 }); | ||
}); | ||
card.addEventListener('mouseleave', () => { | ||
gsap.to(card, { scale: 1, duration: 0.3 }); | ||
}); | ||
}); | ||
}); | ||
|
||
function search() { | ||
let box = [...document.querySelectorAll(".fcard")]; | ||
let val = document.getElementById('input'); | ||
let filter = val.value.toUpperCase().trim(); | ||
console.log(filter); | ||
console.log(box); | ||
|
||
for (let i = 0; i < box.length; i++) { | ||
let component = box[i]; | ||
let h2 = component.querySelector('h2'); | ||
let componentName = h2.textContent || h2.innerText; | ||
console.log(componentName); | ||
console.log((componentName.toUpperCase().indexOf(filter))); | ||
|
||
if (componentName.toUpperCase().indexOf(filter) > -1) { | ||
console.log(`Showing card ${i}: ${componentName}`); | ||
component.style.display = "flex"; | ||
} else { | ||
console.log(`Hiding card ${i}: ${componentName}`); | ||
component.style.display = "none"; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
Oops, something went wrong.