Minimalist Iframe - 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>Minimalist Iframe</title> <style> body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .iframe-container-minimalist { width: 60%; height: 60%; position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); border-radius: 5px; overflow: hidden; background: #fff; transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; } .iframe-container-minimalist:hover { transform: scale(1.02); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); } .iframe-header-minimalist { position: absolute; top: 0; width: 100%; height: 30px; background: #e0e0e0; color: #333; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 16px; } .iframe-header-minimalist .title { display: flex; align-items: center; } .iframe-header-minimalist .title span { margin-right: 10px; } .iframe-header-minimalist .icons { display: flex; align-items: center; } .iframe-header-minimalist .icons i { margin: 0 5px; cursor: pointer; transition: color 0.3s; } .iframe-header-minimalist .icons i:hover { color: #ff5f5f; } .iframe-content-minimalist { width: 100%; height: calc(100% - 30px); } .iframe-container-minimalist iframe { width: 100%; height: 100%; border: none; } </style> </head> <body> <div class="iframe-container-minimalist"> <div class="iframe-header-minimalist"> <div class="title"> <span>📄</span> <span>Minimalist Iframe</span> </div> <div class="icons"> <i class="fas fa-expand"></i> <i class="fas fa-sync"></i> <i class="fas fa-times"></i> </div> </div> <div class="iframe-content-minimalist"> <iframe src="https://example.com" title="Iframe"></iframe> </div> </div> <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script> <script> document.querySelector('.fa-expand').addEventListener('click', function() { const iframeContainer = document.querySelector('.iframe-container-minimalist'); iframeContainer.style.position = 'fixed'; iframeContainer.style.top = '0'; iframeContainer.style.left = '0'; iframeContainer.style.width = '100%'; iframeContainer.style.height = '100%'; iframeContainer.style.zIndex = '1000'; }); document.querySelector('.fa-sync').addEventListener('click', function() { document.querySelector('.iframe-content-minimalist iframe').contentWindow.location.reload(); }); document.querySelector('.fa-times').addEventListener('click', function() { document.querySelector('.iframe-container-minimalist').style.display = 'none'; }); </script> </body> </html>