Toggle between dark mode & light mode in Elementor using GSAP

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 28

  • @Brunomrd
    @Brunomrd Год назад +2

    This is the only real solution in the internet for elementor and wordpress, you are a monster, thank you!!! Btw, there is a way to the site detect the color user default (dark or light) and provide access already in dark or light mode?

  • @mhthmusicvideos
    @mhthmusicvideos Год назад

    Very well done and many thanks. Also very useful for accessibility. Many people with impaired vision find dark mode much easier to read.

  • @neolanderplays
    @neolanderplays Год назад

    Thanks Uriel! Great video to start 2023.

  • @dl9151
    @dl9151 Год назад +1

    This is a great technique. Would be cool to inherit the browser setting if dark mode is already on. If you can script it to maintain toggle across pages, refresh, and inherit from the browser, you literally created the only dark mode option any site would need. I really like the approach, because it does not apply any nonsense filters that whack images, videos, and other page assets. it allows you to target specific pages, sections, and classes. I'd like to see you improve it to retain the toggle selection on refresh or other page where the scripts target. It's not really very usable in this state, because it just triggers contact form submissions complaining about having to keep selecting dark mode. Also, when the page is refreshed and dark mode is toggled on, the toggle remains on dark mode but theme switches back to normal mode. People bombed the contact form and email to report it.
    I have never found a one size fits all Dark Mode, but this technique may be the one. Very good, bruh!

    • @UrielSoto
      @UrielSoto  Год назад +1

      Yeah I was thinking of just saving the state in the clients local storage. Basically with cookies. I can do it.

    • @dl9151
      @dl9151 Год назад +1

      @@UrielSoto Cookies will get the job done. You should improve it. You really have something here. It really solves the one size fits all dark mode. The apps all suck when you need things they can't do, or require hassle workarounds. Your approach really solves this problem.
      First we think, then we do, then we do better.

    • @UrielSoto
      @UrielSoto  Год назад +1

      @@dl9151 love that saying! I've updated the code to include local storage. Let me know what you think 🤔

    • @dl9151
      @dl9151 Год назад

      @@UrielSoto You rock! I will have some time tomorrow to check it out.

    • @dl9151
      @dl9151 Год назад +1

      @@UrielSoto I can't figure out why this isn't working. The original code works. The updated code with localStorage doesn't. Any ideas? What am I missing.

  • @zyshop1611
    @zyshop1611 Год назад

    youI am one of your followers. We miss you. You are a professional

  • @JohnXionidis
    @JohnXionidis 11 месяцев назад

    awesome tutorial! Do you also have any video to change header color when it reaches a specific section?

  • @uff3511
    @uff3511 Год назад

    This is amazing, really! Thank you so much. I will never understand why Elementor does not offer such an functionallity built in.
    I made on my website a tutorial how I have done it and refered to you and your video. I putted the toggle checkbox in my header and the js code into wpCode Lite. It works for 95%.
    There is one (horrible) bug - Flickering. When the browser saved "dark" and I switch to another page, the page first loads in light mode and one second later it switches to dark mode. I already made a lot of research, but fixing this seems quite hard :(

  • @NoraKlein-o9h
    @NoraKlein-o9h 5 месяцев назад

    Hey hey :)
    Great tutorial!
    I only have one problem, it doesn't work on my website.
    I can't click on the sun and the console says it can't find the targets.
    Has something been updated?
    I'm working with GSAP for the first time.

  • @hollandnr1453
    @hollandnr1453 Год назад +1

    Very nice video. I also like to see a offset card slider with code. Maybe you wanna do it in your next video👍🏼

  • @mortezaaghaahmadi7480
    @mortezaaghaahmadi7480 Год назад +1

    Hi .. nice video .. how can I save the state of toggle for other pages?

  • @eko2112
    @eko2112 Год назад

    Thanks Uriel! 😍

  • @itslocane412
    @itslocane412 Год назад

    We need at least 1 video a week :)

    • @UrielSoto
      @UrielSoto  Год назад

      I wish I could i have a long list of videos I want to make but I've just been so busy 😔

  • @rohantvillarosa4036
    @rohantvillarosa4036 28 дней назад

    problem with this is if you are in dark mode as default and you switch to light mode and go to another page it goes back to default.

  • @matiasarias6361
    @matiasarias6361 Год назад

    Hi, Can I put a specific color to a container?

  • @motivationwithme4150
    @motivationwithme4150 Год назад

    How can I make a woocommerce dropdown variation + quantity button in the same line instead of both in different lines in single product page

  • @fabrictexture4767
    @fabrictexture4767 Год назад

    Can I used the code in code snippet or suggest any plugin for gsap

  • @C-commerce
    @C-commerce 2 месяца назад

    Anyone know if this works anymore? I tried it and could not get it working?

  • @soyjosemillan
    @soyjosemillan Год назад

    Work on entre site?

  • @lushprod
    @lushprod 3 месяца назад

    Example 1 is not working.

  • @ahmadnahedh1849
    @ahmadnahedh1849 6 месяцев назад

    example 1 not working

  • @zyshop1611
    @zyshop1611 Год назад

    good luck