sexycullen

like button/text

Dec 28th, 2020 (edited)
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. *** SCRIPTS SE FOR USAR ICONS DO FEATHER!
  2. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  3. <script src="https://unpkg.com/feather-icons"></script>
  4.  
  5. (essa parte é bom colocar no final do theme, antes do </html>)
  6. <script>
  7. feather.replace();
  8. </script>
  9.  
  10.  
  11. *** CSS PARA O LIKE (se for texto)
  12. .like-b {
  13. position:relative;
  14. display:inline-block;
  15. height:1em;
  16. line-height:1.5em;
  17. padding: 0 1px;
  18. }
  19.  
  20. .like-b .like_button iframe {
  21. position:absolute;
  22. top:0;
  23. left:0;
  24. bottom:0;
  25. right:0;
  26. z-index:2;
  27. opacity:0;
  28. }
  29.  
  30. /* cor e estilo do texto depois do like */
  31. .like-b .liked + .b {
  32. color: #ed2715;
  33. font-weight:bold;
  34. }
  35.  
  36. /* muda o texto de like pra liked quando clicado */
  37. .like-b .liked + .b:after {
  38. content:'d';
  39. }
  40.  
  41. .like-b a:hover {
  42. color:#eaeaea;
  43. }
  44.  
  45.  
  46. *** CSS DO LIKE (se for usar icon)
  47. mesmo de cima, mas não tem: .like-b .liked + .b:after e o: .like-b .liked + .b tem que ser igual o de baixo
  48. .like-b .liked + .b {
  49. color: #ed2715;
  50. stroke: #ed2715;
  51. }
  52.  
  53. /* estilo e tamanho do icon */
  54. .like-b .feather {
  55. width: 10px;
  56. height: 10px;
  57. stroke: #000;
  58. }
  59.  
  60. *** ADICIONAR id="{PostID}" NA DIV QUE ENVOLVE OS POSTS (pode estar como div, section, article, depende do theme)
  61. <div class="post" id="{PostID}">
  62.  
  63. *** ADICIONAR O LIKE ICON/TEXTO NO HTML ONDE TU QUER QUE APAREÇA
  64. (se for icon)
  65. <a class="like-b" href="#" title="Like">
  66. {LikeButton}
  67. <i data-feather="heart" class="b feather"></i>
  68. </a>
  69.  
  70. (se for texto)
  71. <a class="like-b" href="#" title="Like">
  72. {LikeButton}
  73. <span class="b">like</span>
  74. </a>
Add Comment
Please, Sign In to add comment