eimkasp

VAT.BusinessPress.io - iFrame VAT Widget Embed Demo

Apr 21st, 2026
77
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>EU VAT Widget — Embed Demo</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. </head>
  9. <body class="bg-gray-50 min-h-screen font-sans">
  10.  
  11.   <div class="max-w-2xl mx-auto px-4 py-12">
  12.  
  13.     <!-- Header -->
  14.     <div class="mb-8 text-center">
  15.       <span class="inline-block bg-blue-100 text-blue-700 text-xs font-semibold px-3 py-1 rounded-full mb-4">Free widget · No signup</span>
  16.       <h1 class="text-3xl font-bold text-gray-900 tracking-tight mb-2">EU VAT Calculator Widget</h1>
  17.       <p class="text-gray-500">Embed real-time EU VAT rates on any site. Pick a layout, copy the code.</p>
  18.     </div>
  19.  
  20.     <!-- Style toggle -->
  21.     <div class="flex gap-3 mb-5">
  22.       <button id="btn-vertical" onclick="setMode('vertical')"
  23.        class="flex-1 py-2.5 rounded-lg text-sm font-semibold transition-all bg-blue-600 text-white shadow-sm">
  24.         ▥ Vertical
  25.       </button>
  26.       <button id="btn-horizontal" onclick="setMode('horizontal')"
  27.        class="flex-1 py-2.5 rounded-lg text-sm font-semibold transition-all bg-white text-gray-600 border border-gray-200 hover:border-gray-300">
  28.         ▤ Horizontal
  29.       </button>
  30.     </div>
  31.  
  32.     <!-- Widget preview -->
  33.     <div class="bg-white border border-gray-200 rounded-xl overflow-hidden shadow-sm mb-5">
  34.       <div class="flex items-center gap-1.5 px-4 py-2.5 border-b border-gray-100 bg-gray-50">
  35.         <span class="w-2.5 h-2.5 rounded-full bg-red-400"></span>
  36.         <span class="w-2.5 h-2.5 rounded-full bg-yellow-400"></span>
  37.         <span class="w-2.5 h-2.5 rounded-full bg-green-400"></span>
  38.         <span id="url-label" class="ml-3 text-xs text-gray-400 font-mono truncate">
  39.           https://vat.businesspress.io/public/embed/united-kingdom
  40.         </span>
  41.       </div>
  42.       <iframe
  43.        id="widget-iframe"
  44.        src="https://vat.businesspress.io/public/embed/united-kingdom"
  45.        height="400"
  46.        width="100%"
  47.        style="border:none;display:block;"
  48.        frameborder="0"
  49.        loading="lazy"
  50.      ></iframe>
  51.     </div>
  52.  
  53.     <!-- Embed code -->
  54.     <div class="bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden mb-6">
  55.       <div class="flex items-center justify-between px-4 py-3 border-b border-gray-100">
  56.         <span class="text-sm font-semibold text-gray-700">Embed code</span>
  57.         <button id="copy-btn" onclick="copyCode()"
  58.          class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold text-white bg-gray-900 hover:bg-gray-700 transition-colors">
  59.           <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
  60.           Copy
  61.         </button>
  62.       </div>
  63.       <pre id="code-block" class="text-xs text-gray-700 p-4 overflow-x-auto leading-relaxed bg-gray-50">&lt;iframe
  64.   src="https://vat.businesspress.io/public/embed/united-kingdom"
  65.   width="100%"
  66.   height="400"
  67.   style="border:none;"
  68.   frameborder="0"
  69. &gt;&lt;/iframe&gt;</pre>
  70.     </div>
  71.  
  72.     <!-- Footer link -->
  73.     <p class="text-center text-sm text-gray-400">
  74.       Widget by <a href="https://vat.businesspress.io/embed" target="_blank" class="text-blue-600 font-medium hover:underline">EU VAT Info</a> &middot; always free, always up to date
  75.     </p>
  76.  
  77.   </div>
  78.  
  79. <script>
  80.   var mode = 'vertical';
  81.   var BASE = 'https://vat.businesspress.io/public/embed/united-kingdom';
  82.  
  83.   function setMode(m) {
  84.     mode = m;
  85.     var src = BASE + (m === 'horizontal' ? '?style=horizontal' : '');
  86.     var height = m === 'horizontal' ? '320' : '400';
  87.  
  88.     document.getElementById('widget-iframe').src = src;
  89.     document.getElementById('widget-iframe').height = height;
  90.     document.getElementById('url-label').textContent = src;
  91.     document.getElementById('code-block').textContent =
  92.       '<iframe\n  src="' + src + '"\n  width="100%"\n  height="' + height + '"\n  style="border:none;"\n  frameborder="0"\n></iframe>';
  93.  
  94.     var active   = 'bg-blue-600 text-white shadow-sm';
  95.     var inactive = 'bg-white text-gray-600 border border-gray-200 hover:border-gray-300';
  96.     document.getElementById('btn-vertical').className   = 'flex-1 py-2.5 rounded-lg text-sm font-semibold transition-all ' + (m === 'vertical'   ? active : inactive);
  97.     document.getElementById('btn-horizontal').className = 'flex-1 py-2.5 rounded-lg text-sm font-semibold transition-all ' + (m === 'horizontal' ? active : inactive);
  98.   }
  99.  
  100.   function copyCode() {
  101.     var text = document.getElementById('code-block').textContent;
  102.     navigator.clipboard.writeText(text).then(function() {
  103.       var btn = document.getElementById('copy-btn');
  104.       btn.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg> Copied!';
  105.       btn.classList.replace('bg-gray-900', 'bg-green-500');
  106.       btn.classList.remove('hover:bg-gray-700');
  107.       setTimeout(function() {
  108.         btn.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg> Copy';
  109.         btn.classList.replace('bg-green-500', 'bg-gray-900');
  110.         btn.classList.add('hover:bg-gray-700');
  111.       }, 2000);
  112.     });
  113.   }
  114. </script>
  115. </body>
  116. </html>
  117.  
Advertisement
Comments
  • eimkasp
    187 days
    # text 0.12 KB | 0 0
    1. Open source VAT Calculator available here: https://vat.businesspress.io/
    2.  
    3. VAT.BusinessPress.io - iFrame VAT Widget Embed Demo
Add Comment
Please, Sign In to add comment