Giter VIP home page Giter VIP logo

Comments (8)

ducky avatar ducky commented on August 12, 2024 1

@erickrawczyk - Currently no, but at this point I think there definitely should be. I'll add a note to add an option for disabling it when I get to working on the next update.

from play-midnight.

ducky avatar ducky commented on August 12, 2024

That's actually really weird, haha. I just looked into it and I see why, though. Sadly, there's nothing I can do easily (that I know of) to fix that.

It's because I'm doing the zebra stripes (that Google doesn't do) and the way their playlist scroller works, it's actually removing and adding items as you scroll, which is causing the nth-child css selector to swap between as the items get added and removed.

The only way I know to fix it would be to manually add a class to the rows every time you go to a page which would probably just make Play Music slower than it already is. Or possibly add an option to disable zebra stripes.

Also, appreciate the visual reference, super helpful! 👍

from play-midnight.

geudrik avatar geudrik commented on August 12, 2024

I wouldn't call this a bug - the cause is out of your control. The even-odd class attributes are being added by Googles libs as you scroll, which gives the alternating row styles.

@chrisxclash You could look at the length of the table each time new rows are added and add an empty row if the number of rows would cause a background change

from play-midnight.

geudrik avatar geudrik commented on August 12, 2024

screen shot 2016-01-06 at 4 15 56 pm

<tbody data-count="34" data-start-index="7" data-end-index="34"> is the important bit. Just watch for changes in data-count, data-start-index, and data-end-index and modify as necessary to prevent the JS from auto-formatting the rows. The downside of doing it this way would be that you'll need to undo those changes when new rows are added (i think - I haven't tested).

These would the same attributes you monitor (onChange even) and add an empty row if the rowcount becomes its inverse (even vs. odd total count)

from play-midnight.

ducky avatar ducky commented on August 12, 2024

@geudrik - Yeah, I definitely had that idea in mind, but it seems like overkill for something as simple as zebra stripe styles. I didn't feel the benefit would outweigh the extra JavaScript that would have to watch and swap classes all the time since Play Music is already slow.

It seems really weird in general how they're using a heightened placeholder and just swapping rows, but I can see it be beneficial performance-wise, idk.

from play-midnight.

geudrik avatar geudrik commented on August 12, 2024

\shrug totally understand your hesitance here. I agree that it's probably not worth the extra effort

Just figured I'd throw my ideas out 😄

from play-midnight.

ducky avatar ducky commented on August 12, 2024

Haha yeah. I'll keep it open for now as a reminder.

I'm currently in the works of rewriting all my JavaScript anyways, so I'll have to look into it when I'm putting everything else together.

from play-midnight.

erickrawczyk avatar erickrawczyk commented on August 12, 2024

Is there any way to turn off the zebra stripes? I find the swapping when scrolling to be more detrimental to the experience than including them.

from play-midnight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.