diff --git a/assets/css/custom.css b/assets/css/custom.css index dab6f2b..d6534f8 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -1,9 +1,11 @@ +/* General section container styles */ .section-container { position: relative; padding-left: 150px; /* Adjust as needed */ margin-bottom: 4rem; /* Space between sections */ } +/* Section title styles */ .section-title { position: absolute; left: 0; @@ -16,13 +18,16 @@ color: inherit !important; } +/* Section content styles */ .section-content { width: 100%; } -.flex.flex-col.items-center.max-w-prose.mx-auto, -.flex.flex-col.items-center.max-w-prose.mx-auto .flex.flex-col.lg\:gap-x-6.w-100.px-6.sm\:px-0 { - align-items: center !important; - padding-left: 0 !important; +/* 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 0738104..02b9c63 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -40,46 +40,49 @@ window.addEventListener('load', function() { }); // MOVE SECTION TITLES TO LEFT OF HOME SCREEN -console.log('Custom JS file loaded'); - document.addEventListener('DOMContentLoaded', function() { - console.log('DOM fully loaded and parsed'); - - const sections = document.querySelectorAll('.mb-6.text-3xl.font-bold.text-gray-900.dark\\:text-white, .text-3xl.font-bold'); - console.log('Found', sections.length, 'section headings'); - - sections.forEach((section, index) => { - // Skip the CV section by checking the parent elements' class list - if (section.closest('.flex.flex-col.items-center.max-w-prose.mx-auto')) return; - - console.log(`Processing section ${index}:`, section.textContent); - - 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()}"`); - }); + console.log('DOM fully loaded and parsed'); + + const sections = document.querySelectorAll('.mb-6.text-3xl.font-bold.text-gray-900.dark\\:text-white, .text-3xl.font-bold'); + 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; - console.log('Finished processing all sections'); + // 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'); + } + + console.log(`Processed: "${section.textContent.trim()}"`); + }); + + console.log('Finished processing all sections'); }); +