text
stringlengths
241
1.68k
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Sample Page</title> <style> .box { width: 100px; height: 100px; background-color: blue; } </style> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Sample Page - A blue box with a size of 100x100 pixels.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>My Website</title> </head> <body> <h1>Hello, World!</h1> </body> </html> [/INST] Here is the cleaned code My Website - Displays a heading "Hello, World!"
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Form Example</title> </head> <body> <form> <label for="name">Name:</label> <input type="text" id="name" name="name"> <input type="submit" value="Submit"> </form> </body> </html> [/INST] Here is the cleaned code Form Example - A form with a text input and a submit button.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Image Gallery</title> <style> .image { width: 200px; height: 150px; object-fit: cover; } </style> </head> <body> <img class="image" src="image1.jpg" alt="Image 1"> <img class="image" src="image2.jpg" alt="Image 2"> </body> </html> [/INST] Here is the cleaned code Image Gallery - Displays two images in a gallery style.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Responsive Design</title> <style> @media (max-width: 600px) { body { font-size: 14px; } } </style> </head> <body> <h1>Welcome to Our Website</h1> <p>This is a sample paragraph.</p> </body> </html> [/INST] Here is the cleaned code Responsive Design - A heading and a paragraph with responsive font size.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>JavaScript Example</title> <script> function showMessage() { alert("Hello, World!"); } </script> </head> <body> <button onclick="showMessage()">Click Me</button> </body> </html> [/INST] Here is the cleaned code JavaScript Example - A button that displays an alert on click.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Navigation Menu</title> <style> .menu-item { display: inline-block; margin: 0 10px; } </style> </head> <body> <nav> <a class="menu-item" href="#">Home</a> <a class="menu-item" href="#">About</a> <a class="menu-item" href="#">Services</a> <a class="menu-item" href="#">Contact</a> </nav> </body> </html> [/INST] Here is the cleaned code Navigation Menu - Navigation links: Home, About, Services, Contact.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Animated Button</title> <style> .btn { background-color: blue; color: white; padding: 10px 20px; border-radius: 5px; transition: background-color 0.3s ease; } .btn:hover { background-color: darkblue; } </style> </head> <body> <button class="btn">Click Me</button> </body> </html> [/INST] Here is the cleaned code Animated Button - A button with blue color, darkening on hover.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Embedded Video</title> </head> <body> <iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allowfullscreen></iframe> </body> </html> [/INST] Here is the cleaned code Embedded Video - Embeds a YouTube video using an iframe.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>CSS Grid Layout</title> <style> .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } </style> </head> <body> <div class="grid-container"> <!-- Grid items here --> </div> </body> </html> [/INST] Here is the cleaned code CSS Grid Layout - A grid container with 3 columns and a gap of 10 pixels.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Accordion</title> <style> .accordion { display: none; } </style> <script> function toggleAccordion() { const accordion = document.querySelector('.accordion'); accordion.style.display = (accordion.style.display === 'block') ? 'none' : 'block'; } </script> </head> <body> <button onclick="toggleAccordion()">Toggle Accordion</button> <div class="accordion"> <p>Hidden content that can be toggled.</p> </div> </body> </html> [/INST] Here is the cleaned code Explore an interactive accordion component in this HTML example. Clicking the "Toggle Accordion" button reveals hidden content with the ability to toggle its visibility.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Modal</title> <style> .modal { display: none; } </style> <script> function openModal() { const modal = document.querySelector('.modal'); modal.style.display = 'block'; } function closeModal() { const modal = document.querySelector('.modal'); modal.style.display = 'none'; } </script> </head> <body> <button onclick="openModal()">Open Modal</button> <div class="modal"> <div class="modal-content"> <span class="close" onclick="closeModal()">&times;</span> <p>This is a modal window.</p> </div> </div> </body> </html> [/INST] Here is the cleaned code Experience a modal window using this HTML example. Clicking the "Open Modal" button reveals a centered window with content, which can be closed by clicking the close icon.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Dropdown Menu</title> <style> .dropdown { display: none; } </style> <script> function toggleDropdown() { const dropdown = document.querySelector('.dropdown'); dropdown.style.display = (dropdown.style.display === 'block') ? 'none' : 'block'; } </script> </head> <body> <button onclick="toggleDropdown()">Toggle Dropdown</button> <ul class="dropdown"> <li>Option 1</li> <li>Option 2</li> <li>Option 3</li> </ul> </body> </html> [/INST] Here is the cleaned code Observe a simple dropdown menu implemented using HTML and JavaScript. The "Toggle Dropdown" button activates a list of options that can be displayed or hidden.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Carousel</title> <style> .carousel { width: 300px; overflow: hidden; } .carousel-inner { display: flex; transition: transform 0.5s; } .carousel-item { flex: 0 0 100%; } </style> <script> let currentIndex = 0; function showSlide(index) { const carouselInner = document.querySelector('.carousel-inner'); const slideWidth = document.querySelector('.carousel-item').clientWidth; carouselInner.style.transform = `translateX(-${slideWidth * index}px)`; currentIndex = index; } </script> </head> <body> <div class="carousel"> <div class="carousel-inner"> <div class="carousel-item">Slide 1</div> <div class="carousel-item">Slide 2</div> <div class="carousel-item">Slide 3</div> </div> </div> <button onclick="showSlide((currentIndex + 1) % 3)">Next Slide</button> </body> </html> [/INST] Here is the cleaned code Discover a basic image carousel in this HTML example. The "Next Slide" button advances through a series of slides, providing a simple slideshow experience.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Progress Bar</title> <style> .progress-bar { width: 100%; background-color: #ccc; } .progress { width: 0; height: 20px; background-color: #4caf50; transition: width 0.5s; } </style> <script> function increaseProgress() { const progressBar = document.querySelector('.progress'); if (progressBar.style.width === '') { progressBar.style.width = '10%'; } else { const currentWidth = parseFloat(progressBar.style.width); if (currentWidth < 100) { progressBar.style.width = (currentWidth + 10) + '%'; } } } </script> </head> <body> <div class="progress-bar"> <div class="progress"></div> </div> <button onclick="increaseProgress()">Increase Progress</button> </body> </html> [/INST] Here is the cleaned code Witness a dynamic progress bar with this HTML code. Clicking the "Increase Progress" button gradually fills the bar, demonstrating an interactive visual element.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Tooltip</title> <style> .tooltip { position: relative; display: inline-block; } .tooltip-text { visibility: hidden; width: 120px; background-color: #333; color: #fff; text-align: center; padding: 5px; border-radius: 5px; position: absolute; z-index: 1; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; } .tooltip:hover .tooltip-text { visibility: visible; opacity: 1; } </style> </head> <body> <div class="tooltip"> Hover over me <span class="tooltip-text">This is a tooltip.</span> </div> </body> </html> [/INST] Here is the cleaned code Observe a tooltip in action with this HTML example. When hovering over the designated area, a tooltip containing additional information becomes visible.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Scroll Animation</title> <style> .box { width: 50px; height: 50px; background-color: blue; } </style> <script> window.addEventListener('scroll', () => { const box = document.querySelector('.box'); const scrollTop = window.scrollY; box.style.transform = `translateY(${scrollTop}px)`; }); </script> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Experience a scroll animation effect using this HTML example. As you scroll down the page, the blue box moves vertically, creating a parallax-like effect.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Toggle Switch</title> <style> .toggle { width: 50px; height: 30px; background-color: #ccc; border-radius: 15px; position: relative; } .toggle-slider { width: 26px; height: 26px; background-color: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.3s; } .toggle.active .toggle-slider { transform: translateX(20px); } </style> <script> function toggleSwitch() { const toggle = document.querySelector('.toggle'); toggle.classList.toggle('active'); } </script> </head> <body> <div class="toggle" onclick="toggleSwitch()"> <div class="toggle-slider"></div> </div> </body> </html> [/INST] Here is the cleaned code Explore a toggle switch component using this HTML example. Clicking on the switch changes its state, moving the slider to indicate the active position.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Counter</title> <script> let count = 0; function increment() { count++; updateCount(); } function decrement() { if (count > 0) { count--; updateCount(); } } function updateCount() { const countDisplay = document.querySelector('.count-display'); countDisplay.textContent = count; } </script> </head> <body> <button onclick="decrement()">-</button> <span class="count-display">0</span> <button onclick="increment()">+</button> </body> </html> [/INST] Here is the cleaned code Explore a simple counter with this HTML example. The buttons allow you to increment or decrement the displayed count value.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Animated Background</title> <style> body { margin: 0; overflow: hidden; } .background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; animation: rotate 20s linear infinite; background: linear-gradient(-45deg, #3498db, #e74c3c, #2ecc71, #f39c12); } @keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </head> <body> <div class="background"></div> </body> </html> [/INST] Here is the cleaned code Experience an animated background using this HTML example. The background transitions between vibrant colors, creating a rotating gradient effect.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Drag and Drop</title> <style> .drag-container { width: 300px; height: 300px; border: 2px dashed #ccc; display: flex; align-items: center; justify-content: center; } .drag-item { width: 100px; height: 100px; background-color: #3498db; color: white; text-align: center; line-height: 100px; } </style> <script> const dragItem = document.querySelector('.drag-item'); dragItem.addEventListener('dragstart', (e) => { e.dataTransfer.setData('text/plain', 'dragging'); }); </script> </head> <body> <div class="drag-container"> <div class="drag-item" draggable="true">Drag Me</div> </div> </body> </html> [/INST] Here is the cleaned code Experiment with drag-and-drop functionality using this HTML example. The "Drag Me" box can be dragged within the designated area.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Sticky Navbar</title> <style> body { margin: 0; } .navbar { background-color: #333; color: white; position: sticky; top: 0; } </style> </head> <body> <div class="navbar"> <a href="#">Home</a> <a href="#">About</a> <a href="#">Services</a> <a href="#">Contact</a> </div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ac vestibulum libero.</p> </body> </html> [/INST] Here is the cleaned code Observe a sticky navigation bar using this HTML example. As you scroll down the page, the navigation bar remains fixed at the top of the viewport.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Audio Player</title> </head> <body> <audio controls> <source src="song.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> </body> </html> [/INST] Here is the cleaned code Immerse yourself in an audio experience with this HTML code. The embedded audio player allows you to listen to a song and control playback.
<s>[INST] Can you please clean the below code <!DOCTYPE html> <html> <head> <title>Video Player</title> </head> <body> <video controls> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </body> </html> [/INST] Here is the cleaned code Enjoy video content with this HTML example. The embedded video player lets you watch a video and control playback.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Accordion</title> <style> .accordion { display: none; } </style> <script> function toggleAccordion() { const accordion = document.querySelector('.accordion'); accordion.style.display = (accordion.style.display === 'block') ? 'none' : 'block'; } </script> </head> <body> <button onclick="toggleAccordion()">Toggle Accordion</button> <div class="accordion"> <p>Hidden content that can be toggled.</p> </div> </body> </html> [/INST] Here is the cleaned code Explore an interactive accordion component in this HTML example. Clicking the "Toggle Accordion" button reveals hidden content with the ability to toggle its visibility.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Modal</title> <style> .modal { display: none; } </style> <script> function openModal() { const modal = document.querySelector('.modal'); modal.style.display = 'block'; } function closeModal() { const modal = document.querySelector('.modal'); modal.style.display = 'none'; } </script> </head> <body> <button onclick="openModal()">Open Modal</button> <div class="modal"> <div class="modal-content"> <span class="close" onclick="closeModal()">&times;</span> <p>This is a modal window.</p> </div> </div> </body> </html> [/INST] Here is the cleaned code Experience a modal window using this HTML example. Clicking the "Open Modal" button reveals a centered window with content, which can be closed by clicking the close icon.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Dropdown Menu</title> <style> .dropdown { display: none; } </style> <script> function toggleDropdown() { const dropdown = document.querySelector('.dropdown'); dropdown.style.display = (dropdown.style.display === 'block') ? 'none' : 'block'; } </script> </head> <body> <button onclick="toggleDropdown()">Toggle Dropdown</button> <ul class="dropdown"> <li>Option 1</li> <li>Option 2</li> <li>Option 3</li> </ul> </body> </html> [/INST] Here is the cleaned code Observe a simple dropdown menu implemented using HTML and JavaScript. The "Toggle Dropdown" button activates a list of options that can be displayed or hidden.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Carousel</title> <style> .carousel { width: 300px; overflow: hidden; } .carousel-inner { display: flex; transition: transform 0.5s; } .carousel-item { flex: 0 0 100%; } </style> <script> let currentIndex = 0; function showSlide(index) { const carouselInner = document.querySelector('.carousel-inner'); const slideWidth = document.querySelector('.carousel-item').clientWidth; carouselInner.style.transform = `translateX(-${slideWidth * index}px)`; currentIndex = index; } </script> </head> <body> <div class="carousel"> <div class="carousel-inner"> <div class="carousel-item">Slide 1</div> <div class="carousel-item">Slide 2</div> <div class="carousel-item">Slide 3</div> </div> </div> <button onclick="showSlide((currentIndex + 1) % 3)">Next Slide</button> </body> </html> [/INST] Here is the cleaned code Discover a basic image carousel in this HTML example. The "Next Slide" button advances through a series of slides, providing a simple slideshow experience.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Progress Bar</title> <style> .progress-bar { width: 100%; background-color: #ccc; } .progress { width: 0; height: 20px; background-color: #4caf50; transition: width 0.5s; } </style> <script> function increaseProgress() { const progressBar = document.querySelector('.progress'); if (progressBar.style.width === '') { progressBar.style.width = '10%'; } else { const currentWidth = parseFloat(progressBar.style.width); if (currentWidth < 100) { progressBar.style.width = (currentWidth + 10) + '%'; } } } </script> </head> <body> <div class="progress-bar"> <div class="progress"></div> </div> <button onclick="increaseProgress()">Increase Progress</button> </body> </html> [/INST] Here is the cleaned code Witness a dynamic progress bar with this HTML code. Clicking the "Increase Progress" button gradually fills the bar, demonstrating an interactive visual element.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Tooltip</title> <style> .tooltip { position: relative; display: inline-block; } .tooltip-text { visibility: hidden; width: 120px; background-color: #333; color: #fff; text-align: center; padding: 5px; border-radius: 5px; position: absolute; z-index: 1; bottom: 125%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; } .tooltip:hover .tooltip-text { visibility: visible; opacity: 1; } </style> </head> <body> <div class="tooltip"> Hover over me <span class="tooltip-text">This is a tooltip.</span> </div> </body> </html> [/INST] Here is the cleaned code Experience a tooltip in action with this HTML example. When hovering over the designated area, a tooltip containing additional information becomes visible.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Scroll Animation</title> <style> .box { width: 50px; height: 50px; background-color: blue; } </style> <script> window.addEventListener('scroll', () => { const box = document.querySelector('.box'); const scrollTop = window.scrollY; box.style.transform = `translateY(${scrollTop}px)`; }); </script> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Immerse yourself in an audio experience with this HTML code. The embedded audio player allows you to listen to a song and control playback.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Video Player</title> </head> <body> <video controls> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </body> </html> [/INST] Here is the cleaned code Enjoy video content with this HTML example. The embedded video player lets you watch a video and control playback.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>SVG Icon</title> <style> .icon { fill: #333; width: 50px; height: 50px; } </style> </head> <body> <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"> <circle cx="25" cy="25" r="20"/> </svg> </body> </html> [/INST] Here is the cleaned code Utilize scalable vector graphics for icons that retain quality at any size.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Canvas Drawing</title> <style> canvas { border: 1px solid black; } </style> </head> <body> <canvas id="myCanvas" width="200" height="100"></canvas> <script> const canvas = document.getElementById('myCanvas'); const context = canvas.getContext('2d'); context.fillStyle = 'red'; context.fillRect(10, 10, 50, 50); </script> </body> </html> [/INST] Here is the cleaned code Use HTML5 canvas to create dynamic drawings and animations.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Local Storage</title> <script> localStorage.setItem('username', 'john_doe'); const savedUsername = localStorage.getItem('username'); </script> </head> <body> <p>Saved Username: <span id="savedUsername"></span></p> <script> document.getElementById('savedUsername').textContent = savedUsername; </script> </body> </html> [/INST] Here is the cleaned code Store data on the user's device using the browser's local storage.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Geolocation</title> <script> function showPosition(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; document.getElementById('location').textContent = `Latitude: ${latitude}, Longitude: ${longitude}`; } if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { document.getElementById('location').textContent = 'Geolocation is not supported by this browser.'; } </script> </head> <body> <p id="location">Fetching geolocation...</p> </body> </html> [/INST] Here is the cleaned code Access the user's geographic location through the browser.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Responsive Typography</title> <style> body { font-size: 16px; } @media (max-width: 768px) { body { font-size: 14px; } } </style> </head> <body> <p>This is a paragraph with responsive typography.</p> </body> </html> [/INST] Here is the cleaned code Adjust font sizes and styles for different screen sizes for a consistent and readable experience.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Collapsible Panels</title> <style> .panel { display: none; } </style> <script> function togglePanel() { const panel = document.querySelector('.panel'); panel.style.display = (panel.style.display === 'block') ? 'none' : 'block'; } </script> </head> <body> <button onclick="togglePanel()">Toggle Panel</button> <div class="panel"> <p>This is a collapsible panel.</p> </div> </body> </html> [/INST] Here is the cleaned code Create collapsible panels that expand or collapse to display or hide content as needed.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Scrollspy Navigation</title> <style> body { height: 2000px; } .nav-link { display: block; margin: 20px; } .section { height: 400px; border: 1px solid #ccc; margin-bottom: 20px; } </style> </head> <body> <nav> <ul> <li><a class="nav-link" href="#section1">Section 1</a></li> <li><a class="nav-link" href="#section2">Section 2</a></li> <li><a class="nav-link" href="#section3">Section 3</a></li> </ul> </nav> <div id="section1" class="section">Section 1</div> <div id="section2" class="section">Section 2</div> <div id="section3" class="section">Section 3</div> </body> </html> [/INST] Here is the cleaned code Highlight navigation links as users scroll to the corresponding sections of the page.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Dropdown Select</title> <select> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> </select> </head> <body> <p>Select an option:</p> </body> </html> [/INST] Here is the cleaned code Design a dropdown select menu to allow users to choose from various options.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Lightbox</title> <style> .lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); justify-content: center; align-items: center; } .lightbox img { max-width: 80%; max-height: 80%; } </style> <script> function openLightbox() { const lightbox = document.querySelector('.lightbox'); lightbox.style.display = 'flex'; } function closeLightbox() { const lightbox = document.querySelector('.lightbox'); lightbox.style.display = 'none'; } </script> </head> <body> <img src="image.jpg" alt="Image" onclick="openLightbox()"> <div class="lightbox" onclick="closeLightbox()"> <img src="image.jpg" alt="Image"> </div> </body> </html> [/INST] Here is the cleaned code Implement an image lightbox to display images in a larger overlay with navigation controls.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Multi-step Form</title> <style> .step { display: none; } </style> <script> let currentStep = 0; function showStep(stepNumber) { const steps = document.querySelectorAll('.step'); steps[currentStep].style.display = 'none'; currentStep = stepNumber; steps[currentStep].style.display = 'block'; } </script> </head> <body> <div class="step" id="step1"> Step 1 <button onclick="showStep(1)">Next</button> </div> <div class="step" id="step2"> Step 2 <button onclick="showStep(2)">Next</button> </div> <div class="step" id="step3"> Step 3 </div> </body> </html> [/INST] Here is the cleaned code Divide lengthy forms into smaller steps to guide users through the submission process.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>CSS Animations</title> <style> @keyframes slide { from { transform: translateX(0); } to { transform: translateX(200px); } } .animated-box { width: 100px; height: 100px; background-color: #4caf50; animation: slide 2s ease infinite alternate; } </style> </head> <body> <div class="animated-box"></div> </body> </html> [/INST] Here is the cleaned code Apply animations using CSS keyframes to enhance user interactions and visual appeal.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Progressive Web App (PWA)</title> <link rel="manifest" href="/manifest.json"> <script> if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js'); } </script> </head> <body> <p>This is a Progressive Web App.</p> </body> </html> [/INST] Here is the cleaned code Transform a website into an installable app-like experience with offline capabilities.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Web Accessibility (a11y)</title> <style> .visually-hidden { position: absolute; overflow: hidden; clip: rect(0 0 0 0); width: 1px; height: 1px; white-space: nowrap; } </style> </head> <body> <p>This is visible text.</p> <p class="visually-hidden">This text is hidden for screen readers.</p> </body> </html> [/INST] Here is the cleaned code Ensure your website is accessible to all users, including those with disabilities.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>WebSockets</title> <script> const socket = new WebSocket('ws://example.com'); socket.addEventListener('open', (event) => { console.log('WebSocket connection established.'); }); socket.addEventListener('message', (event) => { console.log('Message from server:', event.data); }); socket.addEventListener('close', (event) => { console.log('WebSocket connection closed.'); }); </script> </head> <body> <p>WebSocket communication example.</p> </body> </html> [/INST] Here is the cleaned code Establish bidirectional communication between a client and server for real-time updates.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Client-side Routing</title> <script> function loadContent(page) { fetch(page + '.html') .then(response => response.text()) .then(data => { document.getElementById('content').innerHTML = data; }) .catch(error => { console.error('Error loading content:', error); }); } </script> </head> <body> <button onclick="loadContent('page1')">Load Page 1</button> <button onclick="loadContent('page2')">Load Page 2</button> <div id="content">Default content.</div> </body> </html> [/INST] Here is the cleaned code Implement navigation without full page reloads using JavaScript-based routing.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Notification System</title> <style> .notification { background-color: #f2f2f2; border: 1px solid #ddd; padding: 10px; } .success { color: green; } .error { color: red; } </style> <script> function showNotification(type, message) { const notification = document.createElement('div'); notification.classList.add('notification'); if (type === 'success') { notification.classList.add('success'); } else if (type === 'error') { notification.classList.add('error'); } notification.textContent = message; document.body.appendChild(notification); setTimeout(() => { document.body.removeChild(notification); }, 3000); } </script> </head> <body> <button onclick="showNotification('success', 'Success message')">Show Success</button> <button onclick="showNotification('error', 'Error message')">Show Error</button> </body> </html> [/INST] Here is the cleaned code Display user notifications using HTML, CSS, and potentially JavaScript for dynamic content.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Lazy Loading</title> <style> img { width: 100%; height: auto; } </style> </head> <body> <img src="image.jpg" alt="Lazy Loaded Image" loading="lazy"> </body> </html> [/INST] Here is the cleaned code Delay the loading of images until they are within the user's viewport for improved performance.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Viewport Units (vh/vw)</title> <style> .box { width: 50vw; height: 50vh; background-color: #4caf50; } </style> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Utilize viewport-based units for responsive design that adapts to screen sizes.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Embed Maps</title> </head> <body> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3223.680245759502!2d-122.08385368429478!3d37.386051979849775!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x808580b9b84a206f%3A0xf724494fe5e50b54!2sGolden%20Gate%20Bridge!5e0!3m2!1sen!2sus!4v1634399150027!5m2!1sen!2sus" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe> </body> </html> [/INST] Here is the cleaned code Integrate interactive maps from providers like Google Maps to enhance location-based content.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>CSS Variables (Custom Properties)</title> <style> :root { --primary-color: #007bff; } .element { color: var(--primary-color); } </style> </head> <body> <div class="element">This text has a custom color.</div> </body> </html> [/INST] Here is the cleaned code Use CSS variables to store and reuse values for easier and more flexible styling.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Form Autocomplete</title> <style> input[type="text"] { width: 200px; padding: 5px; } </style> </head> <body> <label for="username">Username:</label> <input type="text" id="username" name="username" autocomplete="username"> </body> </html> [/INST] Here is the cleaned code Enable autocomplete suggestions for input fields to enhance user experience.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Responsive Images</title> </head> <body> <picture> <source media="(max-width: 600px)" srcset="image-small.jpg"> <source media="(max-width: 1200px)" srcset="image-medium.jpg"> <img src="image-large.jpg" alt="Responsive Image"> </picture> </body> </html> [/INST] Here is the cleaned code Provide different image sources based on device screen sizes for optimal performance.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Mouse Events</title> <style> .box { width: 100px; height: 100px; background-color: #4caf50; } </style> <script> const box = document.querySelector('.box'); box.addEventListener('mouseover', () => { box.style.backgroundColor = 'blue'; }); box.addEventListener('mouseout', () => { box.style.backgroundColor = '#4caf50'; }); </script> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Respond to mouse events such as hovering to trigger visual changes on elements.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Touch Events</title> <style> .box { width: 100px; height: 100px; background-color: #4caf50; } </style> <script> const box = document.querySelector('.box'); box.addEventListener('touchstart', () => { box.style.backgroundColor = 'blue'; }); box.addEventListener('touchend', () => { box.style.backgroundColor = '#4caf50'; }); </script> </head> <body> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Implement touch events to create interactions suitable for touchscreen devices.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Drag and Drop</title> <style> .drag-item { width: 100px; height: 100px; background-color: #4caf50; } </style> <script> const dragItem = document.querySelector('.drag-item'); dragItem.addEventListener('dragstart', (event) => { event.dataTransfer.setData('text/plain', 'Drag me!'); }); </script> </head> <body> <div class="drag-item" draggable="true"></div> </body> </html> [/INST] Here is the cleaned code Enable drag-and-drop functionality to move elements within a page.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Media Queries</title> <style> @media (max-width: 768px) { body { font-size: 14px; } } @media (min-width: 769px) and (max-width: 1024px) { body { font-size: 16px; } } </style> </head> <body> <p>Responsive font size using media queries.</p> </body> </html> [/INST] Here is the cleaned code Apply CSS styles based on different screen sizes to create responsive designs.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Custom Fonts</title> <style> @font-face { font-family: 'CustomFont'; src: url('custom-font.woff2') format('woff2'); } body { font-family: 'CustomFont', sans-serif; } </style> </head> <body> <p>This text uses a custom font.</p> </body> </html> [/INST] Here is the cleaned code Use custom fonts to enhance typography and maintain branding consistency.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Geometric Shapes</title> <style> .circle { width: 100px; height: 100px; background-color: #4caf50; border-radius: 50%; } .triangle { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid #4caf50; } </style> </head> <body> <div class="circle"></div> <div class="triangle"></div> </body> </html> [/INST] Here is the cleaned code Create geometric shapes using CSS properties like border-radius and borders.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Form Validation</title> <style> input:valid { border-color: green; } input:invalid { border-color: red; } </style> </head> <body> <form> <label for="email">Email:</label> <input type="email" id="email" name="email" required> <button type="submit">Submit</button> </form> </body> </html> [/INST] Here is the cleaned code Provide instant feedback on form input validity using CSS pseudo-classes.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>SVG Animations</title> <style> .animated { fill: #4caf50; animation: bounce 2s infinite; } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } } </style> </head> <body> <svg class="animated" xmlns="http://www.w3.org/2000/svg" width="100" height="100"> <circle cx="50" cy="50" r="40"/> </svg> </body> </html> [/INST] Here is the cleaned code Create animations within SVG elements using CSS keyframes.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Inline Styles</title> </head> <body> <h1 style="color: #4caf50;">Hello, World!</h1> <p style="font-size: 18px;">This is a paragraph with inline styles.</p> </body> </html> [/INST] Here is the cleaned code Apply styles directly to HTML elements using inline styles.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Geolocation Map</title> <style> #map { height: 400px; width: 100%; } </style> </head> <body> <div id="map"></div> <script> function initMap() { const map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 }); } </script> <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script> </body> </html> [/INST] Here is the cleaned code Integrate Google Maps API to display a customized map with markers and interaction.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Animated Background</title> <style> body { background: linear-gradient(45deg, #4caf50, #007bff); background-size: 400% 400%; animation: gradientAnimation 10s ease infinite; } @keyframes gradientAnimation { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } } </style> </head> <body> <p>This page has an animated background.</p> </body> </html> [/INST] Here is the cleaned code Create visually engaging animated backgrounds using CSS gradients and keyframes.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Draggable Elements</title> <style> .draggable { width: 100px; height: 100px; background-color: #4caf50; position: absolute; cursor: grab; } </style> <script> const draggable = document.querySelector('.draggable'); let offsetX, offsetY; draggable.addEventListener('mousedown', (event) => { offsetX = event.clientX - draggable.getBoundingClientRect().left; offsetY = event.clientY - draggable.getBoundingClientRect().top; draggable.style.cursor = 'grabbing'; document.addEventListener('mousemove', handleMouseMove); document.addEventListener('mouseup', handleMouseUp); }); function handleMouseMove(event) { const x = event.clientX - offsetX; const y = event.clientY - offsetY; draggable.style.left = x + 'px'; draggable.style.top = y + 'px'; } function handleMouseUp() { draggable.style.cursor = 'grab'; document.removeEventListener('mousemove', handleMouseMove); document.removeEventListener('mouseup', handleMouseUp); } </script> </head> <body> <div class="draggable"></div> </body> </html> [/INST] Here is the cleaned code Implement draggable elements using mouse events to enhance interactivity.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Page Transitions</title> <style> body { margin: 0; padding: 0; font-family: Arial, sans-serif; overflow-x: hidden; } .page { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; transition: transform 0.5s; } .page:nth-child(2) { background-color: #4caf50; transform: translateX(100vw); } .page:nth-child(3) { background-color: #007bff; transform: translateX(-100vw); } .page.show { transform: translateX(0); } </style> <script> const pages = document.querySelectorAll('.page'); let currentPage = 1; function showPage(pageNumber) { pages[currentPage - 1].classList.remove('show'); pages[pageNumber - 1].classList.add('show'); currentPage = pageNumber; } </script> </head> <body> <div class="page show" style="background-color: #f2f2f2;"> <button onclick="showPage(2)">Page 2</button> <button onclick="showPage(3)">Page 3</button> </div> <div class="page" style="background-color: #4caf50;"> <p>This is Page 2</p> <button onclick="showPage(1)">Back to Page 1</button> </div> <div class="page" style="background-color: #007bff;"> <p>This is Page 3</p> <button onclick="showPage(1)">Back to Page 1</button> </div> </body> </html> [/INST] Here is the cleaned code Create smooth page transitions using CSS transforms and JavaScript event listeners.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Form Styling</title> <style> input[type="text"], input[type="password"] { width: 300px; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; } input[type="submit"] { background-color: #4caf50; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; } </style> </head> <body> <form> <label for="username">Username:</label> <input type="text" id="username" name="username"> <br> <label for="password">Password:</label> <input type="password" id="password" name="password"> <br> <input type="submit" value="Login"> </form> </body> </html> [/INST] Here is the cleaned code Customize form inputs and buttons with CSS for a polished user interface.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Progress Bar</title> <style> .progress-container { width: 300px; background-color: #f2f2f2; border: 1px solid #ccc; border-radius: 5px; } .progress-bar { width: 0; height: 20px; background-color: #4caf50; border-radius: 5px; } </style> <script> const progressBar = document.querySelector('.progress-bar'); let progress = 0; function updateProgress() { progress += 10; if (progress <= 100) { progressBar.style.width = progress + '%'; } } </script> </head> <body> <button onclick="updateProgress()">Increase Progress</button> <div class="progress-container"> <div class="progress-bar"></div> </div> </body> </html> [/INST] Here is the cleaned code Display progress using a dynamic bar that updates with user interactions.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Tabbed Content</title> <style> .tabs { display: flex; } .tab-button { padding: 10px 20px; background-color: #f2f2f2; border: 1px solid #ccc; border-radius: 5px 5px 0 0; cursor: pointer; } .tab-button.active { background-color: #4caf50; color: white; } .tab-content { display: none; padding: 20px; border: 1px solid #ccc; border-radius: 0 0 5px 5px; } .tab-content.active { display: block; } </style> <script> const tabButtons = document.querySelectorAll('.tab-button'); const tabContents = document.querySelectorAll('.tab-content'); function showTab(tabIndex) { tabButtons.forEach((button, index) => { button.classList.remove('active'); tabContents[index].classList.remove('active'); }); tabButtons[tabIndex].classList.add('active'); tabContents[tabIndex].classList.add('active'); } </script> </head> <body> <div class="tabs"> <button class="tab-button active" onclick="showTab(0)">Tab 1</button> <button class="tab-button" onclick="showTab(1)">Tab 2</button> <button class="tab-button" onclick="showTab(2)">Tab 3</button> </div> <div class="tab-content active"> This is the content of Tab 1. </div> <div class="tab-content"> This is the content of Tab 2. </div> <div class="tab-content"> This is the content of Tab 3. </div> </body> </html> [/INST] Here is the cleaned code Implement tabbed content sections with dynamic switching between tabs.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>SVG Icons</title> <style> .icon { fill: #4caf50; width: 24px; height: 24px; } </style> </head> <body> <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M0 0h24v24H0z" fill="none"/> <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 16h-2v-6h2v6zm0-8h-2V7h2v3z"/> </svg> <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M0 0h24v24H0z" fill="none"/> <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 16c-2.67 0-5.19-.58-7.39-1.61-.46-.22-.77-.67-.77-1.19 0-.84.68-1.52 1.52-1.52.71 0 1.31.44 1.52 1.06.14.45.5.77.97.77.56 0 1.02-.46 1.02-1.02 0-.47-.31-.88-.77-1.02-1.45-.5-2.52-1.87-2.52-3.48 0-2.03 1.65-3.68 3.68-3.68 1.43 0 2.68.81 3.33 2 .1.23.35.39.62.39.39 0 .7-.32.7-.7 0-.43-.35-.78-.78-.78-.37 0-.66.31-.7.67-.15 1.05-.7 1.96-1.48 2.61-.68.52-1.5.84-2.36.84-1.91 0-3.48-1.56-3.48-3.48 0-.42-.32-.76-.74-.76-.41 0-.74.33-.74.74 0 2.24 1.82 4.06 4.06 4.06 1.46 0 2.75-.77 3.47-1.94.28-.42.76-.69 1.3-.69 1.05 0 1.9.86 1.9 1.9 0 .89-.66 1.64-1.52 1.82-1.12.22-2.02 1.09-2.02 2.23 0 1.26 1.03 2.29 2.29 2.29 1.08 0 2.04-.77 2.27-1.82.1-.45.48-.77.94-.77.6 0 1.08.48 1.08 1.08 0 .5-.42.92-.92.92z"/> </svg> </body> </html> [/INST] Here is the cleaned code Enhance your website with scalable vector icons using inline SVG.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Carousel</title> <style> .carousel { width: 300px; overflow: hidden; } .carousel-inner { display: flex; transition: transform 0.5s; } .carousel-item { flex: 0 0 100%; } </style> <script> let currentIndex = 0; const items = document.querySelectorAll('.carousel-item'); function showSlide(index) { const carouselInner = document.querySelector('.carousel-inner'); const slideWidth = items[0].clientWidth; carouselInner.style.transform = `translateX(-${slideWidth * index}px)`; currentIndex = index; } function nextSlide() { currentIndex = (currentIndex + 1) % items.length; showSlide(currentIndex); } function prevSlide() { currentIndex = (currentIndex - 1 + items.length) % items.length; showSlide(currentIndex); } </script> </head> <body> <div class="carousel"> <div class="carousel-inner"> <div class="carousel-item"><img src="image1.jpg" alt="Image 1"></div> <div class="carousel-item"><img src="image2.jpg" alt="Image 2"></div> <div class="carousel-item"><img src="image3.jpg" alt="Image 3"></div> </div> </div> <button onclick="prevSlide()">Previous</button> <button onclick="nextSlide()">Next</button> </body> </html> [/INST] Here is the cleaned code Implement an image carousel with sliding functionality and navigation buttons.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Hover Effects</title> <style> .card { width: 200px; height: 300px; background-color: #f2f2f2; overflow: hidden; position: relative; border-radius: 5px; } .image { width: 100%; height: 100%; transition: transform 0.3s; } .card:hover .image { transform: scale(1.2); } .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); color: white; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; } .card:hover .overlay { opacity: 1; } </style> </head> <body> <div class="card"> <img class="image" src="image.jpg" alt="Hover Effect"> <div class="overlay">Hover for details</div> </div> </body> </html> [/INST] Here is the cleaned code Add interactive hover effects to elements using CSS transitions and overlays.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Comparison Slider</title> <style> .image-container { position: relative; width: 500px; height: 300px; overflow: hidden; } .image-container img { width: 100%; height: auto; } .slider { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10px; height: 100%; background-color: #4caf50; cursor: ew-resize; } </style> <script> const slider = document.querySelector('.slider'); const container = document.querySelector('.image-container'); let isDragging = false; slider.addEventListener('mousedown', (e) => { e.preventDefault(); isDragging = true; container.classList.add('dragging'); }); document.addEventListener('mouseup', () => { isDragging = false; container.classList.remove('dragging'); }); document.addEventListener('mousemove', (e) => { if (!isDragging) return; let xPos = e.clientX - container.getBoundingClientRect().left; xPos = Math.max(0, Math.min(xPos, container.offsetWidth)); slider.style.left = xPos + 'px'; container.style.width = xPos + 'px'; }); </script> </head> <body> <div class="image-container"> <img src="image-before.jpg" alt="Before"> <img src="image-after.jpg" alt="After"> <div class="slider"></div> </div> </body> </html> [/INST] Here is the cleaned code Create an interactive image comparison slider that reveals before and after images.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Collapsible Sidebar</title> <style> body { margin: 0; font-family: Arial, sans-serif; } .sidebar { height: 100vh; width: 250px; position: fixed; top: 0; left: -250px; background-color: #333; transition: left 0.3s; } .sidebar.open { left: 0; } .content { margin-left: 250px; padding: 20px; } </style> <script> const sidebar = document.querySelector('.sidebar'); const content = document.querySelector('.content'); function toggleSidebar() { sidebar.classList.toggle('open'); content.classList.toggle('open'); } </script> </head> <body> <div class="sidebar"> <button onclick="toggleSidebar()">Toggle Sidebar</button> <ul> <li>Home</li> <li>About</li> <li>Services</li> <li>Contact</li> </ul> </div> <div class="content"> <p>This is the main content of the page.</p> </div> </body> </html> [/INST] Here is the cleaned code Add a collapsible sidebar to your webpage for navigation and content organization.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Sticky Header</title> <style> body { margin: 0; font-family: Arial, sans-serif; } .header { background-color: #333; color: white; padding: 10px; position: sticky; top: 0; } .content { padding: 20px; } </style> </head> <body> <div class="header"> Sticky Header </div> <div class="content"> <p>Scroll down to see the sticky header.</p> </div> </body> </html> [/INST] Here is the cleaned code Implement a sticky header that remains at the top of the page as the user scrolls.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Typing Animation</title> <style> .typing-text { font-size: 24px; font-family: Arial, sans-serif; overflow: hidden; border-right: 3px solid #4caf50; white-space: nowrap; margin: 0 auto; animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite; } @keyframes typing { from { width: 0; } to { width: 100%; } } @keyframes blink-caret { from, to { border-color: transparent; } 50% { border-color: #4caf50; } } </style> </head> <body> <div class="typing-text">Welcome to our website</div> </body> </html> [/INST] Here is the cleaned code Create a typing animation effect that simulates text being typed on a typewriter.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Lightbox</title> <style> .lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); justify-content: center; align-items: center; } .lightbox img { max-width: 90%; max-height: 90%; } .thumbnail { cursor: pointer; } </style> <script> const lightbox = document.querySelector('.lightbox'); const thumbnails = document.querySelectorAll('.thumbnail'); const image = document.querySelector('.lightbox img'); thumbnails.forEach(thumbnail => { thumbnail.addEventListener('click', () => { lightbox.style.display = 'flex'; image.src = thumbnail.src; }); }); lightbox.addEventListener('click', () => { lightbox.style.display = 'none'; }); </script> </head> <body> <img class="thumbnail" src="image1.jpg" alt="Thumbnail 1"> <img class="thumbnail" src="image2.jpg" alt="Thumbnail 2"> <img class="thumbnail" src="image3.jpg" alt="Thumbnail 3"> <div class="lightbox"> <img src="" alt="Lightbox Image"> </div> </body> </html> [/INST] Here is the cleaned code Create an image lightbox that displays larger images when thumbnails are clicked.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Video Background</title> <style> body { margin: 0; padding: 0; font-family: Arial, sans-serif; overflow: hidden; } .video-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; } video { width: 100%; height: 100%; object-fit: cover; } .content { position: relative; z-index: 1; text-align: center; padding: 100px 0; color: white; } </style> </head> <body> <div class="video-container"> <video autoplay loop muted> <source src="background-video.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </div> <div class="content"> <h1>Welcome to Our Website</h1> <p>Explore our services and offerings.</p> </div> </body> </html> [/INST] Here is the cleaned code Set a video as a background to add an engaging visual element to your webpage.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Lazy Loading</title> <style> img { max-width: 100%; height: auto; } </style> <script> const images = document.querySelectorAll('img[data-src]'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { const img = entry.target; img.src = img.getAttribute('data-src'); observer.unobserve(img); } }); }); images.forEach(img => { observer.observe(img); }); </script> </head> <body> <img data-src="image1.jpg" alt="Image 1"> <img data-src="image2.jpg" alt="Image 2"> <img data-src="image3.jpg" alt="Image 3"> </body> </html> [/INST] Here is the cleaned code Implement lazy loading for images to improve page load performance.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Custom Checkboxes</title> <style> .checkbox-container { display: flex; align-items: center; margin-bottom: 10px; } input[type="checkbox"] { display: none; } .custom-checkbox { width: 20px; height: 20px; border: 2px solid #4caf50; border-radius: 3px; margin-right: 10px; position: relative; } input[type="checkbox"]:checked + .custom-checkbox::after { content: '\2713'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #4caf50; } </style> </head> <body> <div class="checkbox-container"> <input type="checkbox" id="checkbox1"> <label class="custom-checkbox" for="checkbox1"></label> <span>Option 1</span> </div> <div class="checkbox-container"> <input type="checkbox" id="checkbox2"> <label class="custom-checkbox" for="checkbox2"></label> <span>Option 2</span> </div> <div class="checkbox-container"> <input type="checkbox" id="checkbox3"> <label class="custom-checkbox" for="checkbox3"></label> <span>Option 3</span> </div> </body> </html> [/INST] Here is the cleaned code Style checkboxes to match your website's design using custom CSS.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Responsive Navigation Menu</title> <style> body { margin: 0; font-family: Arial, sans-serif; } .navbar { background-color: #333; overflow: hidden; } .navbar a { float: left; display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } .navbar a:hover { background-color: #4caf50; } .menu-icon { display: none; } @media screen and (max-width: 600px) { .navbar a:not(:first-child) { display: none; } .navbar a.menu-icon { float: right; display: block; } .responsive { display: block; } } </style> <script> function toggleMenu() { const navLinks = document.querySelector('.navbar a:not(:first-child)'); navLinks.classList.toggle('responsive'); } </script> </head> <body> <div class="navbar"> <a href="#" class="menu-icon" onclick="toggleMenu()">&#9776;</a> <a href="#">Home</a> <a href="#">About</a> <a href="#">Services</a> <a href="#">Contact</a> </div> </body> </html> [/INST] Here is the cleaned code Create a responsive navigation menu that adapts to different screen sizes.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Animated Buttons</title> <style> .btn { display: inline-block; padding: 10px 20px; background-color: #4caf50; color: white; text-align: center; text-decoration: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; } .btn:hover { background-color: #45a049; } .btn-primary { background-color: #007bff; } .btn-danger { background-color: #dc3545; } .btn-warning { background-color: #ffc107; } </style> </head> <body> <button class="btn">Default Button</button> <button class="btn btn-primary">Primary Button</button> <button class="btn btn-danger">Danger Button</button> <button class="btn btn-warning">Warning Button</button> </body> </html> [/INST] Here is the cleaned code Add stylish and animated buttons to your webpage with CSS transitions.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Accordion Menu</title> <style> .accordion { display: none; } .accordion-label { cursor: pointer; } .accordion-content { display: none; padding: 10px; border: 1px solid #ccc; } .accordion-content.active { display: block; } </style> <script> const accordionLabels = document.querySelectorAll('.accordion-label'); accordionLabels.forEach(label => { label.addEventListener('click', () => { const content = label.nextElementSibling; content.classList.toggle('active'); }); }); </script> </head> <body> <div class="accordion"> <div class="accordion-label">Section 1</div> <div class="accordion-content"> Content for Section 1. </div> </div> <div class="accordion"> <div class="accordion-label">Section 2</div> <div class="accordion-content"> Content for Section 2. </div> </div> <div class="accordion"> <div class="accordion-label">Section 3</div> <div class="accordion-content"> Content for Section 3. </div> </div> </body> </html> [/INST] Here is the cleaned code Create an accordion-style menu with expandable sections using HTML and JavaScript.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Scroll Animations</title> <style> .box { width: 100px; height: 100px; background-color: #4caf50; opacity: 0; transform: translateY(50px); transition: opacity 0.5s, transform 0.5s; } .box.animate { opacity: 1; transform: translateY(0); } </style> <script> const boxes = document.querySelectorAll('.box'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate'); observer.unobserve(entry.target); } }); }); boxes.forEach(box => { observer.observe(box); }); </script> </head> <body> <div class="box"></div> <div class="box"></div> <div class="box"></div> </body> </html> [/INST] Here is the cleaned code Add scroll animations to elements as they come into view using Intersection Observer.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Hover Effects</title> <style> .image-container { position: relative; width: 300px; overflow: hidden; } .image { width: 100%; height: auto; } .image-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); color: white; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; } .image-container:hover .image-overlay { opacity: 1; } </style> </head> <body> <div class="image-container"> <img class="image" src="image.jpg" alt="Image"> <div class="image-overlay">Hover for details</div> </div> </body> </html> [/INST] Here is the cleaned code Apply attractive image hover effects with overlay text and color transitions.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Audio Player</title> <style> .audio-player { display: flex; align-items: center; } audio { margin-right: 10px; } .audio-controls button { background-color: #4caf50; color: white; border: none; border-radius: 5px; padding: 5px 10px; cursor: pointer; } </style> <script> const audio = document.querySelector('audio'); const playButton = document.querySelector('.play'); const pauseButton = document.querySelector('.pause'); playButton.addEventListener('click', () => { audio.play(); }); pauseButton.addEventListener('click', () => { audio.pause(); }); </script> </head> <body> <div class="audio-player"> <audio controls> <source src="audio.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> <div class="audio-controls"> <button class="play">Play</button> <button class="pause">Pause</button> </div> </div> </body> </html> [/INST] Here is the cleaned code Embed an audio player on your webpage with play and pause controls.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Responsive Tables</title> <style> table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } th, td { padding: 10px; text-align: left; border-bottom: 1px solid #ddd; } th { background-color: #f2f2f2; } @media screen and (max-width: 600px) { th, td { display: block; } th { text-align: center; } } </style> </head> <body> <table> <thead> <tr> <th>Name</th> <th>Age</th> <th>Location</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>25</td> <td>New York</td> </tr> <tr> <td>Jane</td> <td>30</td> <td>London</td> </tr> <tr> <td>Mark</td> <td>22</td> <td>Paris</td> </tr> </tbody> </table> </body> </html> [/INST] Here is the cleaned code Design responsive tables that adapt to different screen sizes by switching to vertical layout.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Form Validation</title> <style> .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; } .form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; } .form-group input.valid { border-color: #4caf50; } .form-group input.invalid { border-color: #dc3545; } .form-group .error-message { color: #dc3545; font-size: 12px; margin-top: 5px; display: none; } </style> <script> const form = document.querySelector('form'); const inputs = document.querySelectorAll('input'); form.addEventListener('submit', (e) => { inputs.forEach(input => { if (!input.checkValidity()) { e.preventDefault(); input.classList.add('invalid'); input.nextElementSibling.style.display = 'block'; } else { input.classList.remove('invalid'); input.nextElementSibling.style.display = 'none'; } }); }); </script> </head> <body> <form> <div class="form-group"> <label for="name">Name</label> <input type="text" id="name" required> <div class="error-message">Please enter your name.</div> </div> <div class="form-group"> <label for="email">Email</label> <input type="email" id="email" required> <div class="error-message">Please enter a valid email address.</div> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" id="password" minlength="6" required> <div class="error-message">Password must be at least 6 characters long.</div> </div> <button type="submit">Submit</button> </form> </body> </html> [/INST] Here is the cleaned code Validate user input in a form and provide visual feedback to users.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Parallax Scrolling</title> <style> body { margin: 0; font-family: Arial, sans-serif; } .parallax-container { height: 500px; background-image: url('background.jpg'); background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; } .content { padding: 100px; text-align: center; color: white; } </style> </head> <body> <div class="parallax-container"> <div class="content"> <h1>Welcome to Our Website</h1> <p>Scroll down for more information.</p> </div> </div> <div class="content"> <h2>About Us</h2> <p>We are a dedicated team...</p> </div> </body> </html> [/INST] Here is the cleaned code Create a parallax scrolling effect that gives the illusion of depth to your webpage.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Tooltip</title> <style> .tooltip { position: relative; display: inline-block; } .tooltip-text { display: none; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background-color: #333; color: white; padding: 5px 10px; border-radius: 5px; white-space: nowrap; } .tooltip:hover .tooltip-text { display: block; } </style> </head> <body> <div class="tooltip"> Hover over me <span class="tooltip-text">This is a tooltip.</span> </div> </body> </html> [/INST] Here is the cleaned code Implement tooltips that provide additional information when hovering over elements.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Gradient Background</title> <style> body { margin: 0; font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(45deg, #4caf50, #007bff); color: white; } </style> </head> <body> <h1>Welcome to Our Website</h1> <p>Discover our amazing services.</p> </body> </html> [/INST] Here is the cleaned code Create a gradient background for your webpage using CSS.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Image Slider</title> <style> .slider { width: 500px; overflow: hidden; } .slider-inner { display: flex; transition: transform 0.5s; } .slide { flex: 0 0 100%; } img { width: 100%; height: auto; } </style> <script> let currentIndex = 0; const slides = document.querySelectorAll('.slide'); function showSlide(index) { const sliderInner = document.querySelector('.slider-inner'); const slideWidth = slides[0].clientWidth; sliderInner.style.transform = `translateX(-${slideWidth * index}px)`; currentIndex = index; } function nextSlide() { currentIndex = (currentIndex + 1) % slides.length; showSlide(currentIndex); } function prevSlide() { currentIndex = (currentIndex - 1 + slides.length) % slides.length; showSlide(currentIndex); } </script> </head> <body> <div class="slider"> <div class="slider-inner"> <div class="slide"> <img src="slide1.jpg" alt="Slide 1"> </div> <div class="slide"> <img src="slide2.jpg" alt="Slide 2"> </div> <div class="slide"> <img src="slide3.jpg" alt="Slide 3"> </div> </div> </div> <button onclick="prevSlide()">Previous</button> <button onclick="nextSlide()">Next</button> </body> </html> [/INST] Here is the cleaned code Build an image slider that displays a sequence of images with navigation buttons.
<s>[INST] Can you please clean the below code html <!DOCTYPE html> <html> <head> <title>Form Styling</title> <style> body { margin: 0; font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f2f2f2; } .form-container { background-color: white; padding: 20px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } input[type="text"], input[type="email"], textarea, select { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; } button { background-color: #4caf50; color: white; border: none; border-radius: 5px; padding: 10px 20px; cursor: pointer; } </style> </head> <body> <div class="form-container"> <h1>Contact Us</h1> <form> <input type="text" placeholder="Name" required> <input type="email" placeholder="Email" required> <textarea placeholder="Message" required></textarea> <select> <option value="general">General Inquiry</option> <option value="support">Customer Support</option> <option value="feedback">Feedback</option> </select> <button type="submit">Submit</button> </form> </div> </body> </html> [/INST] Here is the cleaned code Style a contact form with various input types and a dropdown select menu.

No dataset card yet

New: Create and edit this dataset card directly on the website!

Contribute a Dataset Card
Downloads last month
16
Add dataset card