Skip to content

Commit

Permalink
Add wallet connect theme switch option, disable particle effects in l…
Browse files Browse the repository at this point in the history
…ight theme
  • Loading branch information
Phillweston committed Mar 28, 2024
1 parent bff6918 commit 1856c3f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/wallet-connect.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h5 class="modal-title" id="walletAddressTitle">Notes Before Connecting</h5>
</div>
<div class="modal-footer">
<button type="button" id='connectDecline' class="dropboxx" data-dismiss="modal">Decline</button>
<button type="submit" id="connectAccept" class="dropboxx2" data-dismiss="modal" data-param="dark">Accept and Continue</button>
<button type="submit" id="connectAccept" class="dropboxx2" data-dismiss="modal" data-param="light">Accept and Continue</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -466,7 +466,7 @@ <h5 class="modal-title">Subscription</h5>

<!-- BANNER AREA START -->
<section id="banner">
<div class=".particles-js-canvas-el" id="particles-js"></div>
<div class=".particles-js-canvas-el" id="particles-js" style="visibility: hidden;"></div>
<div class="design-layer"></div>
<div class="backtotop">
<a href="#banner"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
Expand Down Expand Up @@ -1240,7 +1240,7 @@ <h3>Stay Connected With Us</h3>
<div class="footer-social">
<a href="https://x.com/LotsoFandom"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="https://t.me/lotso_onbase"><i class="fa fa-telegram" aria-hidden="true"></i></a>
<a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a>
<a href="https://www.youtube.com/@LotsoNFT"><i class="fa fa-youtube-play" aria-hidden="true"></i></a>
<a href="https://www.disney.com/"><i class="fa fa-globe" aria-hidden="true"></i></a>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions js/theme-switch.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
document.querySelector('.theme-switch-button').addEventListener('click', function() {
var themeLink = document.getElementById('theme-link');
var themeLinkResponsive = document.getElementById('theme-link-responsive');
var connectAcceptButton = document.getElementById('connectAccept');
var particlesElement = document.getElementById('particles-js');

if (themeLink.getAttribute('href').includes('css/style.css') &&
themeLinkResponsive.getAttribute('href').includes('css/responsive.css')) {
themeLink.setAttribute('href', 'css/light-version/style.css');
themeLinkResponsive.setAttribute('href', 'css/light-version/responsive.css');
document.body.setAttribute("data-theme", "light"); // Set data-theme to light
connectAcceptButton.setAttribute('data-param', 'light');
particlesElement.style.visibility = 'hidden';
} else {
themeLink.setAttribute('href', 'css/style.css');
themeLinkResponsive.setAttribute('href', 'css/responsive.css');
document.body.setAttribute("data-theme", "dark"); // Set data-theme to dark
connectAcceptButton.setAttribute('data-param', 'dark');
particlesElement.style.visibility = 'visible';
}
});
14 changes: 12 additions & 2 deletions js/wallet-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,18 @@ const airdrop = document.getElementById('airdrop')

if (acceptBtn) {
acceptBtn.addEventListener('click', function() {
var param = this.getAttribute('data-param');
connect(param);
// Get the responsive menu element
var responsiveMenu = document.querySelector('.navbar-collapse');

// Close the responsive menu if it's open
if (responsiveMenu.classList.contains('show')) {
responsiveMenu.classList.remove('show');
responsiveMenu.setAttribute('aria-expanded', 'false');
}

// Get the data-param attribute and proceed with the connect function
var param = this.getAttribute('data-param');
connect(param);
});
}

Expand Down

0 comments on commit 1856c3f

Please sign in to comment.