ElementorPortfolioWordPress

How To Make A Dark-Light Portfolio Website Using WordPress 2024

Tools and Links Used

Hostinger Fast, beginner friendly WordPress hosting.
Get Hosting
Elementor The free page builder this tutorial is built with.
Get Elementor
Elementor Pro The Pro upgrade used throughout this tutorial.
Get Elementor Pro
Project Files Download the resources used in this tutorial.
Download Files
Kitpapa Ready made Elementor template kits.
Get Templates

Prompt Used in This Tutorial

My Portfolio CSS
<style>

    .recent-work .eael-gallery-grid-item{
        background: #151C28;
    }
    .recent-work .eael-gallery-grid-item img, .recent-work-light .eael-gallery-grid-item img {
        border-radius: 20px;
    }

</style>
My Portfolio Class
recent-work
Form Section CSS
.label-bg label.mf-input-label{
        background: #0B111E !important;
        z-index: 10 !important;
        display: inline !important;
        top: 12px;
        position: relative;
}
Form Section Class
label-bg
Testimonial Section Light CSS
.testmonial-light .elementskit-single-testimonial-slider {
        margin: 10px 0px;
 }
Testimonial Section Light Class
testmonial-light
Form Section Light CSS
.label-bg-light label.mf-input-label{
        background: #fff !important;
        z-index: 10 !important;
        display: inline !important;
        top: 12px;
        position: relative;
}
Form Section Light Class
label-bg-light
Nav Section CSS
.menu-highlight .elementor-grid-item.active a{
        background: linear-gradient(180deg, hsla(255, 66%, 75%, 1), hsla(255, 66%, 75%, .2) ) !important;
        box-shadow: 0 0 16px hsla(255, 66%, 75%, .4) !important;
    }
    .menu-highlight .elementor-grid-item.active svg{
        fill: #f0f2f4 !important;
}
Nav Section Class
***Main container of the Dark version and Light version***
main-wrapper

***Social icon widget Dark version and Light version***
menu-highlight active-button
Light/Dark Toggle CSS
.light-version{
        display: none;
    }
    .hide{
        display none !important;
    }
    .show{
        display:block !important;
}
Light/Dark Toggle Class
***Main container of the Dark version***
dark-version

***Main container of the Light version***
light-version
JS Snippet
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
var darkMode = true

$(document).ready(function(){
  $(".dark-button").click(function(){
    darkMode = false
    $(".dark-version").addClass("hide");
    $(".light-version").addClass("show");
    autoHighlight()
  });
  $(".light-button").click(function(){
    darkMode = true
    $(".dark-version").removeClass("hide");
    $(".light-version").removeClass("show");
    autoHighlight()
  });
});

var className = 'menu-highlight',
    $ = jQuery,
    clickLock = false

$(document).ready(function(){

autoHighlight()

$('.' + className + ' .elementor-icon-list-item, .' + className + ' .elementor-grid-item').on('click', function(){
    $('.' + className + ' .elementor-icon-list-item, .' + className + ' .elementor-grid-item').removeClass('active')
    $(this).addClass('active')
    clickLock = true
    setTimeout(function(){
        clickLock = false
    },600)
})
})

function autoHighlight(){
    
    if( clickLock ) return
    
    var ids = [],
        id,
        darkClass = darkMode ? 'dark-version' : 'light-version',
        targetContainer = $('.main-wrapper').length ? '.main-wrapper.' + darkClass + ' > .e-con, .main-wrapper.' + darkClass + ' > .e-container, .main-wrapper.' + darkClass + ' > .e-con-inner > .e-con, .main-wrapper > .e-con-inner > .e-container' : '.elementor-top-section, [data-elementor-type="wp-page"] > .e-con, [data-elementor-type="wp-page"] > .e-container'
    
    $(targetContainer).each(function(){
        if($(window).scrollTop() + $(window).height() - 350 > $(this).offset().top){
            ids.push($(this).attr('id'))
        }
    })
    
    ids = ids.filter(element => {
      return element !== undefined
    })
    
    id = ids[ids.length - 1]
    
    $('.' + className + ' .elementor-icon-list-item, .' + className + ' .elementor-grid-item').removeClass('active')
    $('[href="#'+id+'"]').parent().addClass('active')  
}

$(window).on('load scroll', autoHighlight)


</script>

Get Your FREE Freelancing Roadmap

Stop hopping between tutorials. Grab the Freelancing Mastery Handbook to learn how to choose a skill, build your foundation, find clients, and confidently start your freelancing journey.

Free eBook Download

Related Tutorials

From learning the right skills to building a stronger digital presence, we help you turn ideas into practical, professional results.

Vibe Code a REAL Animated WordPress Website with Claude + Elementor

21.8K views

View Tutorial

Vibe Coding Full Course for Beginners – Build & Launch a Real SaaS

3.3K views

View Tutorial

Edit Videos with ChatGPT Codex — Raw Clips to Finished Reel

3.4K views

View Tutorial

Browse All Tutorials