Skip to content

Commit

Permalink
Donations Update
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderPopCat authored Jun 23, 2023
1 parent 3536540 commit 861f33f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
32 changes: 22 additions & 10 deletions assets/js/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

AOS.init();


window.addEventListener('scroll', e => {
if (document.documentElement.scrollTop > 20) {
const nav = document.getElementById('nav')
Expand Down Expand Up @@ -52,14 +53,14 @@ const container = document.querySelector('.project-content');
projects.forEach((project) => {
container.innerHTML +=
`<div class="card">
<div class="card-content">
<h3 class="card-heading">${project.name}</h3>
<p class="card-description">${project.description}</p>
<div class="buttons">
<button onclick="window.open('${project.url}', '_blank')" class="card-button">Visit&nbsp;<i class="fa-solid fa-arrow-up-right-from-square"></i></button>
</div>
</div>
</div>`
<div class="card-content">
<h3 class="card-heading">${project.name}</h3>
<p class="card-description">${project.description}</p>
<div class="buttons">
<button onclick="window.open('${project.url}', '_blank')" class="card-button">Visit&nbsp;<i class="fa-solid fa-arrow-up-right-from-square"></i></button>
</div>
</div>
</div>`
})


Expand Down Expand Up @@ -108,7 +109,7 @@ function add() {
document.body.classList.remove('mobile')
}
}
window.onload = add;
window.onload = init;
let hamburger = document.querySelector('.hamburger')
let mobileNav = document.querySelector('.nav-list')
let bars = document.querySelectorAll('.hamburger span')
Expand All @@ -134,4 +135,15 @@ kofiWidgetOverlay.draw('popcatdev', {
'floating-chat.donateButton.text': 'Support me',
'floating-chat.donateButton.background-color': '#ffffff',
'floating-chat.donateButton.text-color': '#323842'
});
});

// Counter
const init = () => {
add();
localStorage.setItem('visits', parseInt(localStorage.getItem('visits')) + 1);
const count = localStorage.getItem('visits');
document.querySelector('.stats-container').innerHTML += `<div class="stats-item">
<p data-purecounter-start="0" data-purecounter-end="${count}" class="highlight purecounter">${count}</p><span
class="stats-description>Portfolio Visits</span>
</div>`
}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ <h4 class="about-title c-white">About Me</h4>
class="stats-description">Completed Commissions</span>
</div>
<div class="stats-item">
<p class="highlight">$<span data-purecounter-start="0" data-purecounter-end="412"
class="highlight purecounter">412</span></p><span class="stats-description">Donations received</span>
<p class="highlight">$<span data-purecounter-start="0" data-purecounter-end="415"
class="highlight purecounter">415</span></p><span class="stats-description">Donations received</span>
</div>
<div class="stats-item">
<p data-purecounter-start="0" data-purecounter-end="7" class="highlight purecounter">7</p><span
Expand Down

1 comment on commit 861f33f

@vercel
Copy link

@vercel vercel bot commented on 861f33f Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.