Skip to content

Commit

Permalink
Bug Fix!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Saheel-Raj committed Jan 12, 2024
1 parent f87d0c9 commit f15f809
Show file tree
Hide file tree
Showing 12 changed files with 2,045 additions and 0 deletions.
1,541 changes: 1,541 additions & 0 deletions assets/css/styles.css

Large diffs are not rendered by default.

Binary file added assets/img/about-perfil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/img/curved-arrow.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 assets/img/favicon.jpg
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 assets/img/home-perfil.jpeg
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 assets/img/project-1.jpeg
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 assets/img/project-2.jpg
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 assets/img/project-3.jpg
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 assets/img/random-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
const navMenu = document.getElementById('nav-menu'),
navToggle = document.getElementById('nav-toggle'),
navClose = document.getElementById('nav-close')

if (navToggle) {
navToggle.addEventListener('click',()=>{
navMenu.classList.add('show-menu')
})
}

if(navClose){
navClose.addEventListener('click', ()=>{
navMenu.classList.remove('show-menu')
})
}


const navLink = document.querySelectorAll('.nav__link')

const linkAction = () =>{
const navMenu = document.getElementById('nav-menu')

navMenu.classList.remove('show-menu')
}
navLink.forEach(n => n.addEventListener('click', linkAction))


const shadowHeader = () =>{
const header = document.getElementById('header')

this.scrollY >= 50 ? header.classList.add('shadow-header')
: header.classList.remove('shadow-header')
}
window.addEventListener('scroll', shadowHeader)

/*=============== EMAIL JS ===============*/
const contactForm = document.getElementById('contact-form'),
contactMessage = document.getElementById('contact-message')

const sendEmail = (e) =>{
e.preventDefault()

emailjs.sendForm('service_pkdtlsb','template_ujjnnvg','#contact-form','HvoUcQ8Jg5dGOM9ej')
.then(() =>{
contactMessage.textContent = 'Message sent Successfully ✅'

setTimeout(() =>{
contactMessage.textContent = ''
}, 5000)

contactForm.reset()
}, () =>{
contactMessage.textContent = 'Message not sent (service error) ❌'
})
}

contactForm.addEventListener('submit', sendEmail)

/*=============== SHOW SCROLL UP ===============*/
const scrollUp = () =>{
const scrollUp = document.getElementById('scroll-up')

this.scrollY >= 350 ? scrollUp.classList.add('show-scroll')
: scrollUp.classList.remove('show-scroll')
}
window.addEventListener('scroll', scrollUp)

/*=============== DARK LIGHT THEME ===============*/
const themeButton = document.getElementById('theme-button')
const darkTheme = 'dark-theme'
const iconTheme = 'ri-sun-line'

const selecredTheme = localStorage.getItem('selected-theme')
const selecredIcon = localStorage.getItem('selected-icon')

const getCurrentTheme = () => document.body.classList.contains(darkTheme) ? 'dark' : 'light'
const getCurrentIcon = () => themeButton.classList.contains(iconTheme) ? 'ri-moon-line' : 'ri-sun-line'

if (selecredTheme) {
document.body.classList[selecredTheme === 'dark' ? 'add' : 'remove'](darkTheme)
themeButton.classList[selecredIcon === 'ri-moon-line' ? 'add' : 'remove'](iconTheme)
}

themeButton.addEventListener('click', () =>{
document.body.classList.toggle(darkTheme)
themeButton.classList.toggle(iconTheme)

localStorage.setItem('selected-theme', getCurrentTheme())
localStorage.setItem('selected-icon', getCurrentIcon())
})

/*=============== SCROLL REVEAL ANIMATION ===============*/

const sr = ScrollReveal({
origin: 'top',
distance: '60px',
duration: 2500,
delay: 400
})

sr.reveal('.home__perfil, .about__image, .contact__mail', {origin: 'right'})
sr.reveal('.home__name, .home__info, .about__container, .section__title-1, .about__info, .contact__social, .contact__data', {origin: 'left'})
sr.reveal('.services__card, .projects__card', {interval: 100})
12 changes: 12 additions & 0 deletions assets/js/scrollreveal.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f15f809

Please sign in to comment.