Neon Glow Code Block - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Neon Glow Code Block</title> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #1a1a1a; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .code-block { position: relative; width: 90%; max-width: 600px; background: #141414; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); transition: transform 0.3s ease, box-shadow 0.3s ease; } .code-block:hover { transform: translateY(-10px); box-shadow: 0 8px 20px rgba(0, 255, 255, 0.5); } .code-header { display: flex; align-items: center; padding: 10px 15px; background: #0e0e0e; border-bottom: 2px solid #00ffff; } .code-header .icons i { margin-right: 10px; color: #00ffff; font-size: 18px; } .code-header .copy-btn { background: #00ffff; border: none; color: black; padding: 5px 10px; cursor: pointer; border-radius: 5px; font-size: 14px; } .code-header .copy-btn:hover { background: #00e5e5; } .code-content { padding: 20px; position: relative; } .code-content pre { margin: 0; color: #ffffff; font-size: 14px; line-height: 1.5; font-family: 'Courier New', Courier, monospace; } .code-content pre .keyword { color: #ff00ff; } .code-content pre .string { color: #00ff00; } .code-content pre .comment { color: #999999; font-style: italic; } .code-content::after { content: '⚡'; position: absolute; top: -30px; right: -30px; font-size: 60px; color: rgba(0, 255, 255, 0.1); transform: rotate(-15deg); } </style> </head> <body> <div class="code-block"> <div class="code-header"> <div class="icons"> <i class="fas fa-circle"></i> <i class="fas fa-circle"></i> <i class="fas fa-circle"></i> </div> <button type="button" class="copy-btn" onclick="copyCode()">Copy</button> </div> <div class="code-content"> <pre><span class="comment">// Neon Glow Example</span> <span class="keyword">function</span> <span class="string">neonGlow</span>() { <span class="keyword">console</span>.<span class="string">log</span>(<span class="string">'Neon Glow Activated!'</span>); }</pre> </div> </div> <script src="https://kit.fontawesome.com/a076d05399.js"></script> <script> function copyCode() { const codeContent = document.querySelector('.code-content pre').innerText; navigator.clipboard.writeText(codeContent).then(() => { alert('Code copied to clipboard! ⚡'); }).catch(err => { alert('Failed to copy code: ', err); }); } </script> </body> </html>