mirror of
https://github.com/basnijholt/compose-farm.git
synced 2026-02-05 23:12:18 +00:00
Compare commits
1 Commits
main
...
web/mobile
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
772b0518ed |
@@ -31,7 +31,29 @@
|
||||
.editor-wrapper.env-wrapper { height: 250px; }
|
||||
.editor-wrapper.viewer-wrapper { height: 300px; }
|
||||
|
||||
/* Terminal - no custom CSS needed, using h-full class in HTML */
|
||||
/* Terminal - mobile touch scrolling improvements */
|
||||
.xterm-viewport {
|
||||
/* Allow native scroll momentum on mobile */
|
||||
-webkit-overflow-scrolling: touch;
|
||||
/* Prevent pull-to-refresh from interfering */
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
/* Mobile-specific terminal adjustments */
|
||||
@media (max-width: 1023px) {
|
||||
#terminal-container,
|
||||
#console-terminal,
|
||||
#exec-terminal {
|
||||
/* Use viewport height on mobile for better sizing */
|
||||
min-height: 200px;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
/* Ensure terminal content is scrollable within container */
|
||||
.xterm-screen {
|
||||
touch-action: pan-y;
|
||||
}
|
||||
}
|
||||
|
||||
/* Prevent save button resize when text changes */
|
||||
#save-btn, #save-config-btn {
|
||||
|
||||
@@ -14,6 +14,9 @@ const ANSI = {
|
||||
CRLF: '\r\n'
|
||||
};
|
||||
|
||||
// Detect mobile/touch device
|
||||
const IS_TOUCH_DEVICE = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||
|
||||
// Terminal color theme (dark mode matching PicoCSS)
|
||||
const TERMINAL_THEME = {
|
||||
background: '#1a1a2e',
|
||||
@@ -136,12 +139,19 @@ function whenXtermReady(callback, maxAttempts = 20) {
|
||||
function createTerminal(container, extraOptions = {}, onResize = null) {
|
||||
container.innerHTML = '';
|
||||
|
||||
// Mobile-optimized terminal options
|
||||
const mobileOptions = IS_TOUCH_DEVICE ? {
|
||||
smoothScrollDuration: 125, // Smoother scroll animation on touch
|
||||
scrollSensitivity: 3, // Increased sensitivity for touch scrolling
|
||||
} : {};
|
||||
|
||||
const term = new Terminal({
|
||||
convertEol: true,
|
||||
theme: TERMINAL_THEME,
|
||||
fontSize: 13,
|
||||
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
||||
scrollback: 5000,
|
||||
...mobileOptions,
|
||||
...extraOptions
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<!-- Terminal -->
|
||||
{% call collapse("Terminal", checked=True, icon=terminal(), subtitle="Full shell access to selected host") %}
|
||||
<div id="console-terminal" class="w-full bg-base-300 rounded-lg overflow-hidden resize-y" style="height: 384px; min-height: 200px;"></div>
|
||||
<div id="console-terminal" class="w-full bg-base-300 rounded-lg overflow-hidden resize-y" style="height: 384px; min-height: 200px; touch-action: pan-y;"></div>
|
||||
{% endcall %}
|
||||
|
||||
<!-- Editor -->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<span id="terminal-spinner" class="loading loading-spinner loading-sm hidden"></span>
|
||||
</div>
|
||||
<div class="collapse-content">
|
||||
<div id="terminal-container" class="bg-[#1a1a2e] rounded-lg h-[300px] border border-white/10 resize-y overflow-hidden">
|
||||
<div id="terminal-container" class="bg-[#1a1a2e] rounded-lg h-[300px] lg:h-[300px] border border-white/10 resize-y overflow-hidden" style="touch-action: pan-y;">
|
||||
<div id="terminal-output" class="h-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
hx-swap="innerHTML">
|
||||
<span class="loading loading-spinner loading-sm"></span> Loading containers...
|
||||
</div>
|
||||
<div id="exec-terminal-container" class="bg-[#1a1a2e] rounded-lg h-[400px] border border-white/10 hidden">
|
||||
<div id="exec-terminal-container" class="bg-[#1a1a2e] rounded-lg h-[400px] border border-white/10 hidden" style="touch-action: pan-y;">
|
||||
<div id="exec-terminal" class="h-full"></div>
|
||||
</div>
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user