Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

14 changes: 0 additions & 14 deletions img/Mask group-1.svg

This file was deleted.

14 changes: 0 additions & 14 deletions img/Mask group-2.svg

This file was deleted.

14 changes: 0 additions & 14 deletions img/Mask group-3.svg

This file was deleted.

14 changes: 0 additions & 14 deletions img/Mask group.svg

This file was deleted.

Binary file added img/adopt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions img/arrow 1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions img/arrow 2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/cat&dog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
290 changes: 154 additions & 136 deletions index.html

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const accordion_item = document.querySelectorAll(".accordion_item");

accordion_item.forEach((item) => {
const accordion_header_item = item.querySelector(".accordion_header");

accordion_header_item.addEventListener("click", () => {
const accordion_content_item = item.querySelector(".accordion_content");

const item_actived = document.querySelector(".active");

VerifyActive(item, accordion_content_item, item_actived);
});
});

function VerifyActive(item, content, content_actived) {
const icon_item = item.querySelector(".icon");
const icon_item_active = document.querySelectorAll(".icon");

icon_item_active.forEach((item) => (item.innerHTML = "^"));

if (content_actived) {
content_actived.style.height = 0;
content_actived.classList.remove("active");
}

if (content !== content_actived) {
icon_item.innerHTML = "v";
content.classList.add("active");
content.style.height = content.scrollHeight + 10 + "px";
}
}

let valueDisplays = document.querySelectorAll(".number-counter");
let interval = 5000;

function isElementVisible(element) {
const rect = element.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}

function animateCounter(element) {
let startValue = 0;
let endValue = parseInt(element.getAttribute("finalValue"));
let duration = Math.floor(interval / endValue);
let counter = setInterval(function() {
startValue += 5;
element.textContent = startValue + "+";
if (startValue >= endValue) {
clearInterval(counter);
}
}, duration);
}

let observer = new IntersectionObserver(function(entries, observer) {
entries.forEach(entry => {
if (entry.isIntersecting) {
animateCounter(entry.target);
observer.unobserve(entry.target);
}
});
});

valueDisplays.forEach(valueDisplay => {
observer.observe(valueDisplay);
});
31 changes: 0 additions & 31 deletions scripts/script.js

This file was deleted.

Loading