diff --git a/assets/css/custom.css b/assets/css/custom.css index d6534f8..5917f46 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -22,12 +22,3 @@ .section-content { width: 100%; } - -/* Center alignment for CV page content */ -.cv-content-center { - display: flex; - flex-direction: column; - align-items: center; - max-width: initial !important; - padding-left: 0 !important; -} diff --git a/assets/js/custom.js b/assets/js/custom.js index 02b9c63..8e1762f 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -47,37 +47,34 @@ document.addEventListener('DOMContentLoaded', function() { console.log('Found', sections.length, 'section headings'); sections.forEach((section, index) => { - // Skip sections on the home page - if (document.body.classList.contains('home-page')) return; + // Exclude CV sections based on their container's ID or class + if (section.closest('#cv-page') || section.closest('.blox-resume-skills') || section.closest('.blox-resume-awards')) { + return; + } - // Specific handling for CV page sections - if (section.closest('#cv-page')) { - const container = document.createElement('div'); - container.className = 'section-container'; - - // Move the section title into the container - container.appendChild(section.cloneNode(true)); - section.classList.add('section-title'); - - // Create a div for the content - const contentDiv = document.createElement('div'); - contentDiv.className = 'section-content'; - container.appendChild(contentDiv); - - // Move all following siblings until the next section into this container - let nextElement = section.nextElementSibling; - while (nextElement && !nextElement.matches('.mb-6.text-3xl.font-bold.text-gray-900.dark\\:text-white, .text-3xl.font-bold')) { - const temp = nextElement.nextElementSibling; - contentDiv.appendChild(nextElement); - nextElement = temp; - } - - // Replace the original section with our new container - section.parentNode.replaceChild(container, section); - } else { - // Ensure CV sections have centered content - section.closest('.flex.flex-col.items-center.max-w-prose.mx-auto').classList.add('cv-content-center'); + // Proceed with modifications for other sections + const container = document.createElement('div'); + container.className = 'section-container'; + + // Move the section title into the container + container.appendChild(section.cloneNode(true)); + section.classList.add('section-title'); + + // Create a div for the content + const contentDiv = document.createElement('div'); + contentDiv.className = 'section-content'; + container.appendChild(contentDiv); + + // Move all following siblings until the next section into this container + let nextElement = section.nextElementSibling; + while (nextElement && !nextElement.matches('.mb-6.text-3xl.font-bold.text-gray-900.dark\\:text-white, .text-3xl.font-bold')) { + const temp = nextElement.nextElementSibling; + contentDiv.appendChild(nextElement); + nextElement = temp; } + + // Replace the original section with our new container + section.parentNode.replaceChild(container, section); console.log(`Processed: "${section.textContent.trim()}"`); }); @@ -86,3 +83,4 @@ document.addEventListener('DOMContentLoaded', function() { }); +