Skip to content

Commit

Permalink
Profile, Portfolio Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-rajan committed Mar 2, 2024
1 parent 726b0b1 commit ef71ded
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
10 changes: 8 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@
</div>
</div>
<div class="buttons">
<button class="btn btn-dark profile" id="js-profile">Profile</button>
<button class="btn btn-dark portfolio" id="js-portfolio">Portfolio</button>
<button class="btn btn-dark" id="js-profile">Profile</button>
<button class="btn btn-dark" id="js-portfolio">Portfolio</button>
</div>
</main>
<div class="profile">
<button class="js-main-btn btn-dark">Back</button>
</div>
<div class="portfolio">
<button class="js-main-btn btn-dark">Back</button>
</div>
<script src="index.js"></script>
</body>
</html>
30 changes: 27 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,31 @@ function animateSkills() {
};

function displayProfile() {
// Hide and Show elements
document.querySelector('main').style.opacity = 0;
document.querySelector('.portfolio').style.opacity = 0;
document.querySelector('.profile').style.opacity = 1;
console.log('Profile');
}

function displayPortfolio() {
// Hide and Show elements
document.querySelector('main').style.opacity = 0;
document.querySelector('.profile').style.opacity = 0;
document.querySelector('.portfolio').style.opacity = 1;

console.log('Portfolio');
}

function displayMain() {
// Hide and Show elements
document.querySelector('.profile').style.opacity = 0;
document.querySelector('.portfolio').style.opacity = 0;
document.querySelector('main').style.opacity = 1;

console.log('Main');
}

document.addEventListener('DOMContentLoaded', () => {
// Main Content
document.querySelector('.main').style.opacity = 1;
Expand All @@ -37,7 +55,13 @@ document.addEventListener('DOMContentLoaded', () => {
animateSkills();

// Profile
document.querySelector('.profile').addEventListener('click', displayProfile);
document.querySelector('#js-profile').addEventListener('click', displayProfile);

// Portfolio
document.querySelector('.portfolio').addEventListener('click', displayPortfolio);
});
document.querySelector('#js-portfolio').addEventListener('click', displayPortfolio);

// Display Main
document.querySelectorAll('.js-main-btn').forEach(button =>
button.addEventListener('click', displayMain)
);
});
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,8 @@ body {
margin: 10px;
width: 150px;
/* width: 100%; */
}

.portfolio, .profile {
opacity: 0;
}

0 comments on commit ef71ded

Please sign in to comment.