Reputation: 61
I need a simple like button. It must allow visitors to vote without logging into their social networks accounts.
Any ideas?
Upvotes: 5
Views: 13735
Reputation: 26
One cannot simply create a like button :D Your button will have store the "likes" somewhere (usually a database), which is by definition a dynamic process and find a way to deal with a few security and UX issues.
If you are using React I created this service https://lyket.dev/, that will take care of everything.
Upvotes: 0
Reputation: 70160
I recreated a Medium-style applause button:
The button persists claps to a hosted back-end service, so no need to spin up your own database. Adding it is as simple as follows:
<head>
<!-- add the button style & script -->
<link rel="stylesheet" href="dist/applause-button.css" />
<script src="dist/applause-button.js"></script>
</head>
<body>
<!-- add the button! -->
<applause-button style="width: 58px; height: 58px;"/>
</body>
Upvotes: 4
Reputation: 778
I recreated the Kudos buttom from svbtle as an intependent widget.
To gain kudos is to earn respect and recognition. A one-element kudos widget with no dependencies.
<div class="kudos"
data-amount="0"
data-url="domain.tld/my-awesome-article"></div>
new KudosPlease({
el : '.kudos',
duration : 1500,
persistent : true,
status : {
alpha: 'fontelico-emo-shoot',
beta: 'fontelico-emo-shoot',
gamma: 'fontelico-emo-beer'
}
});
The amount of kudos for a specific url is saved in my backend, but you can also download it on GitHub: https://github.com/TimPietrusky/KudosPlease
Upvotes: 4
Reputation: 1026
You can store 'likes' in your own database. Just have a 'like' link that hits the server and updates a count in the database table. Of course this requires a database and server side language (PHP, Ruby, Python, etc).
The https://svbtle.com/ blog network has a cool little 'Kudos' button which anonymously likes when you hover over the kudos button. http://howtomakelightning.com/365/
I am not sure how you would do it on a static website though.
Upvotes: 0