Grow your CSS skills. Land your dream job.

CodePen Like/Heart Counter

  • # December 18, 2012 at 12:42 am

    Does anyone know how this works? I’ve been looking all over the place for something similar to ZillaLikes but I no longer use WordPress. I can’t find the Javascript that it’s using either.

    Would be pretty awesome if @chriscoyier put up the code on github.

    # December 18, 2012 at 6:41 am

    I think they built it on Rails which I have absolutely no experience with (apart from installing Ruby gems for SASS/Compass once).

    However, if you were to do it on PHP that would definitely be possible. For example, you could setup a button, when clicked it adds +1 to a field in a users account in the MySQL database.

    Then you could use AJAX to complete the like request and update the database and then reload the new count.

    # December 18, 2012 at 1:00 pm

    Yah essentially that’s it. Unfortunately there isn’t some modular component that makes sense to open source. Each Pen and each User have data models. When a user clicks a heart, it sends a little Ajax call to the server which updates information in the database about how many hearts something has and who hearted it.

    # December 18, 2012 at 1:07 pm

    Gotcha. Thanks guys. I think I’ll try to strip out ZillaLikes to fit Kirby.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".