Skip to content

Commit

Permalink
Adding latest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Aug 6, 2024
1 parent 5d9b880 commit c6418f3
Show file tree
Hide file tree
Showing 24 changed files with 259 additions and 1,068 deletions.
46 changes: 32 additions & 14 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import focus from '@alpinejs/focus'
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";


window.TOCoffset = 150;

gsap.registerPlugin(ScrollTrigger);

Expand Down Expand Up @@ -252,6 +252,20 @@ function domReadyLoop(){
}
}

document.addEventListener('DOMContentLoaded', function() {
const proseLinks = document.querySelectorAll('.prose ul li a');
proseLinks.forEach(link => {
link.addEventListener('click', function(event) {
if(link.getAttribute('href').startsWith('#')) {
event.preventDefault();
renderLinkAsTOC(link);
}
//console.log(`Link clicked: ${this.href}`);
// Add any additional functionality as needed
});
});
});


document.addEventListener("DOMContentLoaded", function() {
hljs.highlightAll();
Expand Down Expand Up @@ -291,17 +305,7 @@ window.renderTocFunctionality = function(){
tocALinks.forEach(link => {
link.addEventListener('click', (event) => {
event.preventDefault();
const targetId = link.getAttribute('href').substring(1);
const offset = 99; // Adjust the offset value as per your requirement
const targetElement = document.getElementById(targetId);

if (targetElement) {
const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset;
window.scrollTo({
top: targetPosition - offset,
behavior: 'smooth'
});
}
renderLinkAsTOC(link);
});
});

Expand Down Expand Up @@ -335,14 +339,28 @@ window.renderTocFunctionality = function(){
});
}

window.renderLinkAsTOC = function(link){
const targetId = link.getAttribute('href').substring(1);
const offset = TOCoffset; // Adjust the offset value as per your requirement
const targetElement = document.getElementById(targetId);

if (targetElement) {
const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset;
window.scrollTo({
top: targetPosition - offset,
behavior: 'smooth'
});
}
}

// Helper function to check if an element is in the viewport
function isElementAtTopAndNotReachedNextSection(element) {
const rect = element.getBoundingClientRect();
const nextSection = document.querySelector('section + section');

return (
rect.top <= 100 &&
(!nextSection || rect.bottom < (nextSection.offsetTop +100))
rect.top <= TOCoffset &&
(!nextSection || rect.bottom < (nextSection.offsetTop +TOCoffset))
);
}

Expand Down
21 changes: 21 additions & 0 deletions content/docs/features/auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Authentication
description: Learn how the authentication works with-in Wave
nextTitle: 'Roles'
nextURL: '/docs/features/roles'
prevTitle: 'Local Development'
prevURL: '/docs/local-dev'
---

# Authentication

Wave provides you with all the authentication features you need for most use-cases. Here are the login pages that you get out of the box:

- Login
- Register
- Verify Email
- Password Confirmation
- Password Reset Request
- Password Reset
- Two-Factor Challenge

185 changes: 0 additions & 185 deletions content/docs/features/collections.md

This file was deleted.

34 changes: 0 additions & 34 deletions content/docs/features/configurations.md

This file was deleted.

Loading

0 comments on commit c6418f3

Please sign in to comment.