-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite Terminal to fix issues #533
Comments
Step 1: Fix FOUC (Flash of Unstyled Content)Add the following CSS to ensure the terminal container has a defined initial height: /* CSS to prevent FOUC */
.terminal-container {
height: 400px; /* Set a reasonable default height */
transition: height 0.3s ease-in-out; /* Smooth transition for height changes */
} Step 2: Adjust Terminal Window Width for TabletsModify the CSS media queries to handle tablet widths: /* CSS for tablet widths */
@media (max-width: 800px) {
.terminal-container {
max-width: 100%; /* Ensure terminal doesn't exceed the screen width */
width: 100%;
}
.terminal-text {
width: 100%; /* Ensure text fills the container */
}
} Step 3: Safari CompatibilityApply specific CSS fixes for Safari: /* CSS hacks for Safari */
@media not all and (min-resolution:.001dpcm) {
@supports (-webkit-appearance:none) {
/* Safari specific styles */
.terminal-container {
overflow: hidden; /* Ensure content doesn't overflow */
}
.terminal-text {
white-space: pre-wrap; /* Ensure text wraps properly */
}
}
} Step 4: Ensure JavaScript Initializes CorrectlyModify the JavaScript to ensure the terminal initializes with the correct height and width: // JavaScript initialization
document.addEventListener('DOMContentLoaded', function() {
const terminalContainer = document.querySelector('.terminal-container');
// Set initial height to prevent FOUC
terminalContainer.style.height = '400px';
// Adjust height based on content
window.addEventListener('resize', function() {
terminalContainer.style.height = window.innerHeight + 'px';
});
// Additional initialization code if necessary
});
|
Current terminal has the following problems:
The text was updated successfully, but these errors were encountered: