HTML5 28
Gab button By Random on 4th February 2021 07:38:45 PM
  1.     <style type="text/css">
  2.       a.gab-share-btn {
  3.         display: inline-block;
  4.         padding: 8px 12px;
  5.         background: #00d178;
  6.         color: #ffffff;
  7.         border: solid 1px transparent;
  8.         border-radius: 8px;
  9.         font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  10.         text-decoration: none;
  11.         font-weight: bold;
  12.         font-size: inherit;
  13.         cursor: pointer;
  14.         -webkit-touch-callout: none;
  15.         -webkit-user-select: none;
  16.         -khtml-user-select: none;
  17.         -moz-user-select: none;
  18.         -ms-user-select: none;
  19.         user-select: none;
  20.       }
  21.       a.gab-share-btn:hover {
  22.         border-color: black;
  23.       }
  24.       a.gab-share-btn:active {
  25.         border-color: #e8e8e8;
  26.         background: #01854b;
  27.         box-shadow: 0 0 4px rgba(0,0,0,0.2) inset;
  28.       }
  29.     </style>
  30.  
  31.     <a
  32.      id="gab-share-btn"
  33.      class="gab-share-btn"
  34.      title="Share to Gab"
  35.      target="_blank"
  36.    >Share to Gab</a>
  37.  
  38.     <script>
  39.       (async function ( ) {
  40.         const button = document.getElementById('gab-share-btn');
  41.         const title = document.querySelector('head title');
  42.         if (!title) { button.setAttribute('hidden', true); }
  43.         let description = document.querySelector('head meta[name="description"]');
  44.         let text = title.textContent + '\n';
  45.         if (description) { text += description.getAttribute('content') + '\n\n'; }
  46.         button.setAttribute('href', `https://gab.com/compose?url=${encodeURIComponent(window.location.href)}&text=${encodeURIComponent(text)}`);
  47.       })();
  48.     </script>

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Share to Gab
Raw Paste

Login or Register to edit or fork this paste. It's free.