CSS Theme Switcher by Reverse-Engineering Alligator.io

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ •

  • @Fireship
    @Fireship  4 роки тому +66

    🔥 🐊 Here's how to reverse-engineer the cool UI tricks on alligator.io. Which website should we breakdown next?
    1:40 Setup
    4:18 Polygon Header
    5:13 CSS Dropdown Menu
    7:56 Theme Switcher
    12:59 Rainbow Animation

    • @GottZ
      @GottZ 4 роки тому +3

      big oof.. you made this in 2020 without mentioning prefers-color-scheme wich essentially allows visitors to have a set default based on their system settings.

    • @Fireship
      @Fireship  4 роки тому +7

      @@GottZ I mentioned it in the last video "100 seconds of CSS variables". It's useful, but this was more about site-specific theme controls. I could have duplicated some of the vars in to a media query, but too late now :)

    • @criskrzysiu
      @criskrzysiu 4 роки тому

      If You use CSS Hudini You can also animate gradients, that's cool thing to show.

    • @andrews3386
      @andrews3386 4 роки тому +1

      This is really cool - thanks for the video. I'd be interested in seeing how the login page at discord (discord.com/login) achieves that animated squiggly thing at the top left corner upon page load. Just a thought..

    • @SpaghettDev
      @SpaghettDev 4 роки тому

      @@andrews3386 good, crunchy, epic css

  • @DjCtavia
    @DjCtavia 4 роки тому +217

    I've learn 2 things today, variables in CSS are really useful, and "clip-path", this is golden. Always learning new tricks and stuff here ;)

    • @rin.k
      @rin.k 4 роки тому +6

      Make sure to practice, you'll forget soon if you only absorb knowledge without practice, happy coding 💪

    • @KhmerTutorials
      @KhmerTutorials 4 роки тому +2

      clip-path still not support in all browsers yet

    • @-leovinci
      @-leovinci 4 роки тому +6

      And :focus-within is useful, else we want JS

    • @zpacula
      @zpacula 4 роки тому +1

      @@-leovinci oh, and focus within isn't generally supported neither xD
      Sadly as much as the new functionality is handy, in most cases you still need to use old ways to ensure anyone can see your website

  • @bossssssist
    @bossssssist 4 роки тому +185

    Thank god he told me I was free to pause the vid

  • @lucasfelipe-ze5sy
    @lucasfelipe-ze5sy 4 роки тому +43

    Hi dude, I'm from Brazil. I'm learning English and study to be Full stack developer and go to work in canada. Your vídeos help me a lot in both, English and programming. Thanks a lot ♥️

  • @akshatjain2222
    @akshatjain2222 4 роки тому +10

    Hands down one of the best developer who is teaching meaningful things. I find a huge gap in the teaching industry where all the focus is on the foundation and understanding the basics but the problem is that they don't take it a step further and explain how would you build something having learned those skills or breaking down an existing product to go step by step to reverse engineer certain topic. Absolutely love your content, it's concise and just spot on. Definitely gonna watch all your videos and share :)

  • @nmanikiran
    @nmanikiran 4 роки тому +8

    Excellent video as always. 135min content in just 13.5min. *hue-rotate* is the highlight of the video for me 👍

    • @Fireship
      @Fireship  4 роки тому +3

      Thank you! Hue-rotate is a cool one

  • @rkd-me
    @rkd-me 4 роки тому +1

    I really like the straight forward presentation type, quickly to the point and no unnecessary talking, great job!

  • @leonardojaques6586
    @leonardojaques6586 4 роки тому

    It's for videos like this that I don't waste my time watching other random tutorials. Good quality and straight to the point.

  • @srijanpaul
    @srijanpaul 4 роки тому +4

    I learned a lot of new things from this video, clip path, localStorage , transitioning the color etc

  • @M4yji
    @M4yji 4 роки тому +38

    Legend has it if you set the playback speed to 0.01 you can actually see him typing all of the code letter by letter.

  • @ayoubbelouadah7195
    @ayoubbelouadah7195 4 роки тому +10

    Your css videos are actually on a whole new level , please make more of these

  • @johntzulik
    @johntzulik 4 роки тому +3

    Hey Dude, I'm from Mexico, I've learned a lot with your videos! and always I can, I shared your videos with my fellas!!! Thanks!

  • @tacticalassaultanteater9678
    @tacticalassaultanteater9678 2 роки тому

    This reverse engineering series is great, easily my favourite webdev content on UA-cam

  • @andreschubert4400
    @andreschubert4400 4 роки тому +5

    Right when I need it most you come up with a new video, solving my problems. Thanks! ☺️👍🏼

  • @pauldudley1273
    @pauldudley1273 4 роки тому

    holy moly that :focus-within drop down css changed my life.. I have been doing stuff like the css checkbox menu trick or javascript. Thank you for the pro tips

  • @Joel-yp4yt
    @Joel-yp4yt 4 роки тому +1

    I rarely make time for CSS so these short tutorials are great.

  • @bohuslavpavlyshynets
    @bohuslavpavlyshynets 4 роки тому +1

    Nice video. There is a lot of useful stuff. It is also recommended for hidden things like switcher use `visibility: hidden` to prevent invisible switcher from catching clicks, and for accessibility

    • @mikaelgross6588
      @mikaelgross6588 4 роки тому

      Or one could use display none.

    • @bohuslavpavlyshynets
      @bohuslavpavlyshynets 4 роки тому

      @@mikaelgross6588 It is hard to animate fading of the element when you set display none

  • @pnogas
    @pnogas 3 роки тому

    I really enjoy these types of videos more than the 100seconds ones you're making more often now.

  • @MuhammadbinYusrat
    @MuhammadbinYusrat 4 роки тому

    At 3:10 you can use Emmet to generate ipsum for you by simply typing lorem So something like lorem50 would generate 50 words.

  • @adamandom
    @adamandom 4 роки тому +1

    5:01
    Can we just appreciate how fucking insanely cool this is?

  • @bonniesimon14
    @bonniesimon14 4 роки тому

    Man your the BEST!!
    Noone out there make such great content with such high production value.
    Plus this thing were you introduce new stuff, like the -webkit-scrollbar in the navbar video and the clippath , rainbow animation in this video are super nice. Like I searched how to create wave shape for divs using css the other day and didn't get any helpful answers. But surprisingly this video taught me how to make triangle shape ( Can I make wavy shapes too? I'll try to if yes).
    Please keep making content like this. Love this Channel.

  • @mateja176
    @mateja176 4 роки тому

    The hue rotate rainbow effect rocks!

  • @mmuneebajaz
    @mmuneebajaz 3 роки тому

    this series is perfect to watch with breakfast 😅

  • @Rayan-bk3fn
    @Rayan-bk3fn 3 роки тому +1

    I love you as kid I dreamed to make that for my website and you inspired me a lot thank you very much!

  • @CodingJourney
    @CodingJourney 4 роки тому

    Tried to set video speed back to normal cause I thought it was on 2x...😉 This was absolutely brilliant!! 🙏🙂

  • @_pr0xy
    @_pr0xy 4 роки тому +9

    lets hope we learn invaluable experience and lession during this lockdown through your channel....

  • @x9wozz
    @x9wozz 4 роки тому

    This is soo cool!
    I needed to know that clip-rect property for my current personal project and that theme switching is neat to know!

  • @hamzaradouan4074
    @hamzaradouan4074 4 роки тому

    Man , your videos are so simple yet very rich with informations , KEEP UP this good work 😘

  • @blakeingle8922
    @blakeingle8922 3 роки тому

    1 second in: Shift + 1 + Tab to make boilerplate html and I'm already impressed

  • @bryanlee6065
    @bryanlee6065 4 роки тому

    Learned so many things during this video. Great job !!

  • @piltonswrangbrahma5140
    @piltonswrangbrahma5140 3 роки тому

    haha everytime i watch his video i smile in enjoy learning new things it's crazy he never ceases to amaze me

  • @mohsinejaz6882
    @mohsinejaz6882 3 роки тому

    Great fan of your work . Its really hard to learn and save someones time and you done it superbly .... thanks for your cool content 😎

  • @mysretro
    @mysretro 4 роки тому

    Wow, this is genius idea for theme switcher! Just change css variables in classes!

  • @SudhanshuIGI
    @SudhanshuIGI 4 роки тому

    Really nailed it.... The best tutorial I’ve seen in a while.

  • @dantecavallin8229
    @dantecavallin8229 4 місяці тому

    body.classlist also has a toggle function that you can use for solarized. Though you would have to change the innerText in the css.

  • @omaralexandro2928
    @omaralexandro2928 4 роки тому

    Jeff, awesome as always! I really would like a full course about NgRx + Firebase!

  • @HSDevStudio
    @HSDevStudio 4 роки тому

    As always an awesome one Jeff👍. Would be great if you could add a quick side-note on the video about browser compatibility, whenever you use a cool CSS property. Will be a real plus.
    Thanks for all the work you put in.

    • @pulga961
      @pulga961 4 роки тому

      I used google analytics on my website and none of my visitors use legacy browsers. 80% of them uses chrome becouse it is default on most android phones,rest is samsung internet and safari

    • @HSDevStudio
      @HSDevStudio 4 роки тому

      @@pulga961 it's not just about mobile. We have huge enterprise customers who end up using IE a lot. It's always good to know a compatibility score while watching before getting too excited about features like clip-path. caniuse.com is always there but a quick compatibility view is a feature that can be an awesome addition.

  • @beratcimen1954
    @beratcimen1954 4 роки тому

    Best tutorial i've ever watched so far. You should make one about responsive structure.

  • @bechari1709
    @bechari1709 4 роки тому

    Best explanatory channel ever

  • @inflame1994
    @inflame1994 4 роки тому

    Your videos are so interesting ..always brings smile and happiness when the new video is out..love it

  • @chma0
    @chma0 3 роки тому

    We need more of this man

  • @youssefmuhamad3213
    @youssefmuhamad3213 4 роки тому +1

    I love this extra cool tricks that you always bring, keep it up

  • @abhinav.sharma
    @abhinav.sharma 4 роки тому +5

    Awesome tutorial dude!!🔥🔥🔥🔥🔥🔥🔥🔥

  • @dianrahmaji
    @dianrahmaji 4 роки тому

    This is exactly what i'm looking for. Thanks, man.

  • @riddheshganatra2223
    @riddheshganatra2223 4 роки тому

    Css is super cool when you teach!

  • @unknown_channel_name
    @unknown_channel_name 4 роки тому

    That was a awesome video. Do make more videos like this bro.

  • @vinothv1720
    @vinothv1720 3 роки тому

    Extremely useful... Thanks brother!!!

  •  4 роки тому

    Oh myself! I do looove this channel, man!

  • @lcalazansl
    @lcalazansl 2 роки тому

    Thanks for the video. I learned a lot!

  • @sankasanjeeva1182
    @sankasanjeeva1182 4 роки тому

    Fantastic idea, thank you Fireship

  • @smert1937
    @smert1937 4 роки тому

    Лучший из лушчих! Я подписался, шикарный канал.

  • @Davidlavieri
    @Davidlavieri Рік тому

    over 10 years in the web development, not specialized front dev, im still using BEM lol

  • @xurify
    @xurify 4 роки тому

    Thanks for the video Jeff, sooo useful for me

  • @blacklotus1606
    @blacklotus1606 4 роки тому

    amazing work, i always struggled with theming, now i know everything 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @zach4216
    @zach4216 4 роки тому

    So much value in one video!!!!!!

  • @CodeWithAndrea
    @CodeWithAndrea 4 роки тому

    Top notch as usual! Thanks!

  • @s4f4y4t9
    @s4f4y4t9 4 роки тому

    Oh my god this is full of knowledge

  • @gingergoat3027
    @gingergoat3027 4 роки тому

    You could have used the classList.toggle method to toggle the solarized class. It also returns true or false depending on the value, so you would still be able to have if statement with just one line referencing the solarized class.

  • @Soremwar
    @Soremwar 4 роки тому +15

    My phylosophy: Animations and UI, should be CSS only
    JS to program events and request data only in web, and obviously for doing your server

    • @Fireship
      @Fireship  4 роки тому +6

      I agree, more you can rely on CSS for animation the better, but it has limitations if tied to the state of your app.

    • @-leovinci
      @-leovinci 4 роки тому

      Some wonderful animation must use canvas, but we can do it with Houdini in the future

    • @1001-w5q
      @1001-w5q 4 роки тому

      @@-leovinci yeah, if it requires a large number of objects, canvas is the best choice

    • @MYMPSWORLD
      @MYMPSWORLD 4 роки тому

      Mostly yes but CSS has a bad reputation of behaving differently across browsers & OS and by any chance if you have to support IE, good luck with that.

    • @abednegosteven-4423
      @abednegosteven-4423 4 роки тому

      @@MYMPSWORLD IE is such a problem:(

  • @mitch7w
    @mitch7w 4 роки тому

    Beautiful video, thanks!

  • @TheCodeJourney247
    @TheCodeJourney247 Рік тому

    Instead of "const theme" use "var theme" 11:55
    Because theme is not a fixed one, it keep on changing when user change the theme.

  • @xOwn3r95
    @xOwn3r95 4 роки тому +1

    Great content! Some topics I'd like to see covered are SVGs and parallax effect. Oh, and a question: can you use the same dropdown trick to implement a mobile, hamburger-style, version of the menu?

  • @patmcroin
    @patmcroin 4 роки тому

    Curious why you've been doing so much vanilla recently. (still my fav dev channel btw)

  • @delta4v
    @delta4v 4 роки тому

    I did see that you are a backer of a masonry project. It will be interesting if you could make a video about that.

  • @mukundm2023
    @mukundm2023 4 роки тому

    Undo stuff and then record while you redo stuff...classic!

  • @SteCee90
    @SteCee90 4 роки тому +2

    nice video as always :D but I think there's a little issue when creating a dropdown like that.. the elements are still there and are clickable .. they're just not visible to the user.

    • @miklosbanyacski2260
      @miklosbanyacski2260 4 роки тому

      I noticed that too, any fix for that?
      Im thinking to make those theme changing "buttons" insert right on to nav bar and visible all the time with no text just the circles

    • @javierflores09
      @javierflores09 4 роки тому +1

      Change the display to hidden

  • @qoobes
    @qoobes 4 роки тому

    What was that piece of code on 12:16, the `isSolar && body....`?

  • @tomershechner
    @tomershechner 4 роки тому +4

    Firegator.io with another video!

    • @Fireship
      @Fireship  4 роки тому +3

      🔥 🐊 I think that has a better right to it than gatorship.io

  • @codecrumbs
    @codecrumbs 4 роки тому

    hey, great tutorial! super easy to follow!

  • @ana91591
    @ana91591 4 роки тому

    Inspired by you angular + firebase course, I started making my own app. I'm having too much fun and your resources are very very useful, but what's my weakest side is the architecture design, principles and common mistakes in a more complex angular pwa, so I was wondering would you be interested in making a video about that :-)))

  • @dennisbarzanoff9025
    @dennisbarzanoff9025 4 роки тому

    The CSS looked really nice, but some of the JS did not look good. Especially that part where you added a string to the styles. Flutter FTW!
    Awesome to-the-point video though! ✌️ Love your channel

  • @ioshaven436
    @ioshaven436 4 роки тому

    Welp, I guess I need to change my server-rendered themes to this. I didn't realize these features are supported in a majority of browsers.

  • @zenahrb8316
    @zenahrb8316 4 роки тому

    Wonderful! So many gems packed into so little time, it's amazing and I don't know how you do it but I love it!

    • @zenahrb8316
      @zenahrb8316 4 роки тому

      Also, showing us more than one way of doing things is very helpful too.

  • @pushkar_lifts
    @pushkar_lifts 4 роки тому

    Which editing software you use?
    Btw that's a really good video

  • @MarkBelain
    @MarkBelain 2 роки тому

    For the dropdown menu, why did you choose "opacity: 0" when you could have chosen "display: none"?
    Is there a best practice in there or is it simply preference?

    • @ieatthighs
      @ieatthighs 2 роки тому

      you can't animate the display property, it would just pop without any animations

  • @theblackharted
    @theblackharted 4 роки тому

    Would you know why the CSS opacity 0 to 1 trick isn't working on Safari? (works fine on Chrome)

  • @rayantovi
    @rayantovi 4 роки тому

    If these tutorials are not perfect then I don’t know what is

  • @bertvanbaelen7676
    @bertvanbaelen7676 4 роки тому

    hey i had an idea for making a homepage for my chrome for when i make like new tabs and stuff. i want to make a start page with like a clock, links to websites and i'd like to make the background photos of my google photos, or make like a little box where there are pictures from my google photos library (kind of like when a chromecast is displaying nothing there is a photo wall). any tips on how to do this?

  • @gusbemacbe
    @gusbemacbe 4 роки тому

    I do not want to use normalise and solarise. I tried to replace with the similar code, but the toggle did not work.

  • @jacoblockwood4034
    @jacoblockwood4034 3 роки тому

    I always see you use `element.onclick` with arrow functions for event listeners, but I usually use `element.addEventListener()`. The `onclick` syntax is a little nicer, but I've always believed there was some downside to it. Is there a reason to use `addEventListener` over `onclick`?

    • @muddycalendar3292
      @muddycalendar3292 2 роки тому

      You can’t use addEventListener on some ie versions and you can only add one event with onclick which is the only downside I can think of

  • @gabriel06123
    @gabriel06123 4 роки тому

    Great video as always!!
    Which are the extensions you use for VSCode when doing this html and CSS videos?
    Thanks!

  • @h4nzo692
    @h4nzo692 4 роки тому

    Awesome learn sir...

  • @skillfulactor09
    @skillfulactor09 4 роки тому

    i wanted to know if its hard to build a site just like alligator io just the layout and functionaily not much the logos those boxes on the site are containers i think are link to differbt routes but not sure

  • @deathdefier45
    @deathdefier45 3 роки тому

    Some S tier content my guy

  • @snoozemonster5669
    @snoozemonster5669 4 роки тому

    Really awesome tutorial. :D any reason why we didn't use element.classList.toggle for the solar theme thingy?

  • @tarearnaut3502
    @tarearnaut3502 2 роки тому

    how do you transition the background property, i can only transition background-color

  • @aravkc5204
    @aravkc5204 4 роки тому

    Can someone tell me why don't scss variables work? I tried this in my react project. Css variables work perfectly fine however, scss variables don't.

  • @fonncatalina6464
    @fonncatalina6464 4 роки тому

    Please help, light theme and light solar theme not working! But dark theme is doing fine, WHYYYYY

  • @sawcondeez
    @sawcondeez 4 роки тому

    Wow, this is amazing!

  • @MarioPineda94
    @MarioPineda94 4 роки тому

    Is there a way create different themes but with sass variables instead of css variables?

  • @samuelfischer3764
    @samuelfischer3764 4 роки тому

    i used this to make my portifolio

  • @СвиленТопузов
    @СвиленТопузов 4 роки тому

    Hello, @Fireship! Could you show us how to implement responsive carousel? Thank you!

  • @sidhant19
    @sidhant19 4 роки тому

    I'm getting body is not defined when using onclick property in js

  • @rafadydkiemmacha7543
    @rafadydkiemmacha7543 4 роки тому +1

    I didn't know there was classList.replace() method. Mozilla's docs of classList didn't list that with other methods 😡

  • @samuelmatheson9655
    @samuelmatheson9655 4 роки тому

    BRILLIANT SIMPLY BRILLIANT

  • @ildaranikin2890
    @ildaranikin2890 4 роки тому

    Is it possible in condition of using SCSS or SASS variables in my project?

  • @idontwanttostealausername9497
    @idontwanttostealausername9497 4 роки тому

    but if you make the opacity 0 it doesnt mean that it is not clickable
    you can still click on the area

  • @davipegoraro7124
    @davipegoraro7124 4 роки тому

    wow man, your content is FUCKING AWESOME

  • @srcarova7117
    @srcarova7117 3 роки тому

    I'm using SASS and when I try to compile it's says undefined variable. What should I do?

    • @Taramushi
      @Taramushi 2 роки тому

      I got it to work by creating a @mixin for the color and background, using the --variables like from the example and added those to .light and .dark.
      Then in body, I added an @extend of whichever theme was my default.

  • @DavidSmith-ef4eh
    @DavidSmith-ef4eh 4 роки тому

    Nice, but are css variables supported by the majority of browsers?