To make the footer stay exclusively beneath the editor and preview side frames without overlapping them, you need to adjust the layout slightly. This will ensure that the footer is placed correctly, likely by modifying its positioning and the styling of the main container.
Here’s how you can do this while keeping all the existing functionalities intact:
- Change the
position of the footer from fixed to relative.
- Update the height of the main container to account for the footer height while maintaining component integrity.
Here's the modified HTML & CSS portion required to make this adjustment:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IPCE IDE</title>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
background: #1e1e1e;
color: white;
overflow: hidden; /* Prevents scrollbars from appearing */
}
/* Main Editor/Preview Layout */
.main-container {
display: flex;
flex: 1;
overflow: hidden;
position: relative;
padding-bottom: 40px; /* Added space for footer height */
}
.editor-pane, .preview-pane {
flex: 1;
min-width: 300px;
display: flex;
flex-direction: column;
}
.editor-pane {
background: #282a36;
}
.preview-pane {
background: #1e1e1e;
}
textarea {
flex: 1;
font-family: "Courier New", monospace;
font-size: 14px;
color: white;
background: #333842;
border: none;
outline: none;
resize: none;
padding: 10px;
}
iframe {
flex: 1;
border: none;
background: white;
}
/* Y-Bisector (Editor/Preview Resizer) */
.resizer {
width: 8px;
background: #61afef;
cursor: ew-resize;
flex-shrink: 0;
}
/* Console Overlay */
.console-overlay {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 300px; /* Adjust as needed */
background: black;
color: limegreen;
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.4);
overflow: hidden;
transition: transform 0.3s, height 0.3s;
transform: translateY(100%);
z-index: 1000;
}
.console-overlay.open {
transform: translateY(0);
}
/* Console Header */
.console-header {
height: 40px;
background: #282a36;
display: flex;
justify-content: flex-end;
align-items: center;
padding: 0 10px;
position: relative;
box-shadow: 0 -1px 5px rgba(255, 255, 255, 0.1);
}
/* Buttons (Aligned to Viewport Edge) */
.console-header .footer-button, .footer .footer-button {
width: 40px;
height: 40px;
margin-left: 10px;
background: #61afef;
color: black;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 18px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
position: relative;
}
.console-header .footer-button:hover, .footer .footer-button:hover {
background: #5ea2d1;
}
/* Console Resizer */
.console-resizer {
height: 8px;
background: #61afef;
cursor: ns-resize;
width: 100%;
}
.console-content {
padding: 10px;
font-family: monospace;
font-size: 12px;
overflow-y: auto;
height: calc(100% - 48px); /* Adjust height to fit resizer and header */
}
/* Footer Bar */
.footer {
position: relative; /* Changed from fixed to relative */
bottom: 0;
left: 0;
width: 100%;
height: 40px;
background: #282a36;
display: flex;
justify-content: flex-end;
align-items: center;
padding: 0 10px;
z-index: 2;
}
/* Tighten Buttons Near Right Border */
.footer-button {
margin: 0 5px;
flex-shrink: 0;
}
</style>
</head>
<body>
Key Changes:
- Main Container Padding - Added
padding-bottom: 40px to the .main-container to ensure the contents do not overlap with the footer.
- Footer Positioning - Changed the
position of the footer from fixed to relative, allowing the footer to stay in its place without overlapping other content.
Additional Notes:
- The above changes maintain all existing functionalities of the script, including resizing and the console behavior.
- This adjustment will prevent any potential overlap of the footer with the editing or preview sections.
Feel free to integrate this into your existing code to achieve the desired layout.