sapbot

Live HTML Editor

Feb 14th, 2026 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.67 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>Live HTML Editor</title>
  7.     <style>
  8.         * {
  9.             margin: 0;
  10.             padding: 0;
  11.             box-sizing: border-box;
  12.         }
  13.  
  14.         body {
  15.             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  16.             height: 100vh;
  17.             display: flex;
  18.             flex-direction: column;
  19.             background: #1e1e1e;
  20.             color: #d4d4d4;
  21.         }
  22.  
  23.         .header {
  24.             background: #252526;
  25.             padding: 10px 20px;
  26.             display: flex;
  27.             justify-content: space-between;
  28.             align-items: center;
  29.             border-bottom: 1px solid #3e3e42;
  30.         }
  31.  
  32.         .header h1 {
  33.             font-size: 18px;
  34.             font-weight: 500;
  35.             color: #fff;
  36.         }
  37.  
  38.         .credits {
  39.             font-size: 12px;
  40.             color: #858585;
  41.             font-style: italic;
  42.         }
  43.  
  44.         .container {
  45.             display: flex;
  46.             flex: 1;
  47.             overflow: hidden;
  48.         }
  49.  
  50.         .editor-pane {
  51.             width: 50%;
  52.             display: flex;
  53.             flex-direction: column;
  54.             border-right: 2px solid #3e3e42;
  55.         }
  56.  
  57.         .pane-header {
  58.             background: #2d2d30;
  59.             padding: 8px 15px;
  60.             font-size: 12px;
  61.             text-transform: uppercase;
  62.             letter-spacing: 1px;
  63.             color: #cccccc;
  64.             border-bottom: 1px solid #3e3e42;
  65.         }
  66.  
  67.         #htmlInput {
  68.             flex: 1;
  69.             width: 100%;
  70.             background: #1e1e1e;
  71.             color: #d4d4d4;
  72.             border: none;
  73.             padding: 20px;
  74.             font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  75.             font-size: 14px;
  76.             line-height: 1.6;
  77.             resize: none;
  78.             outline: none;
  79.         }
  80.  
  81.         .preview-pane {
  82.             width: 50%;
  83.             display: flex;
  84.             flex-direction: column;
  85.             background: #fff;
  86.         }
  87.  
  88.         #preview {
  89.             flex: 1;
  90.             width: 100%;
  91.             border: none;
  92.             background: #fff;
  93.         }
  94.  
  95.         /* Scrollbar styling */
  96.         ::-webkit-scrollbar {
  97.             width: 10px;
  98.             height: 10px;
  99.         }
  100.  
  101.         ::-webkit-scrollbar-track {
  102.             background: #1e1e1e;
  103.         }
  104.  
  105.         ::-webkit-scrollbar-thumb {
  106.             background: #424242;
  107.             border-radius: 5px;
  108.         }
  109.  
  110.         ::-webkit-scrollbar-thumb:hover {
  111.             background: #4f4f4f;
  112.         }
  113.     </style>
  114. </head>
  115. <body>
  116.     <div class="header">
  117.         <h1>📝 Live HTML Editor</h1>
  118.         <span class="credits">written by sapbot with help of Kimi K2.5</span>
  119.     </div>
  120.    
  121.     <div class="container">
  122.         <div class="editor-pane">
  123.             <div class="pane-header">HTML Code</div>
  124.             <textarea id="htmlInput" placeholder="Type your HTML code here..."><!DOCTYPE html>
  125. <html>
  126. <head>
  127.     <style>
  128.         body {
  129.             font-family: Arial, sans-serif;
  130.             padding: 20px;
  131.             background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  132.             color: white;
  133.             min-height: 100vh;
  134.             display: flex;
  135.             align-items: center;
  136.             justify-content: center;
  137.         }
  138.         .card {
  139.             background: rgba(255,255,255,0.1);
  140.             padding: 40px;
  141.             border-radius: 20px;
  142.             backdrop-filter: blur(10px);
  143.             text-align: center;
  144.         }
  145.         h1 { margin-bottom: 10px; }
  146.         p { opacity: 0.9; }
  147.     </style>
  148. </head>
  149. <body>
  150.     <div class="card">
  151.         <h1>Hello World! 🚀</h1>
  152.         <p>Edit the code on the left to see changes instantly!</p>
  153.     </div>
  154. </body>
  155. </html></textarea>
  156.         </div>
  157.        
  158.         <div class="preview-pane">
  159.             <div class="pane-header">Live Preview</div>
  160.             <iframe id="preview"></iframe>
  161.         </div>
  162.     </div>
  163.  
  164.     <script>
  165.         const htmlInput = document.getElementById('htmlInput');
  166.         const preview = document.getElementById('preview');
  167.  
  168.         function updatePreview() {
  169.             const code = htmlInput.value;
  170.             const doc = preview.contentDocument || preview.contentWindow.document;
  171.             doc.open();
  172.             doc.write(code);
  173.             doc.close();
  174.         }
  175.  
  176.         // Update preview on input
  177.         htmlInput.addEventListener('input', updatePreview);
  178.        
  179.         // Initial load
  180.         updatePreview();
  181.     </script>
  182. </body>
  183. </html>
Advertisement
Add Comment
Please, Sign In to add comment