From 0300d3c08c67ba3760b811216dba10df3f395350 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 21 Oct 2024 12:33:07 +0100 Subject: [PATCH] Add code to allow terminal in BangleApps --- android.html | 16 ++++++++----- core | 2 +- css/main.css | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++-- index.html | 10 +++++--- 4 files changed, 81 insertions(+), 12 deletions(-) diff --git a/android.html b/android.html index a0bc6075a..900376bfb 100644 --- a/android.html +++ b/android.html @@ -187,14 +187,18 @@ - + @@ -416,7 +420,7 @@ if (el) el.addEventListener("click", event=>{ if (webrtc) showWebRTCID(webrtc.peerId); else { webrtc = webrtcInit({ - bridge:true, + bridge:true, onStatus : function(s) { showToast(s); }, @@ -432,7 +436,7 @@ if (el) el.addEventListener("click", event=>{ onPortDisconnect : function(serialPort) { }, onPortWrite : function(data, cb) { - Puck.write(data, cb); + Puck.write(data, cb); } }); connection.on("data", function(d) { diff --git a/core b/core index 8f4b43bab..7e5ac0271 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 8f4b43bab57ddc482533b1a00bb03601dc7ead79 +Subproject commit 7e5ac0271f794bcacda3a5a692cfa479457eb4dd diff --git a/css/main.css b/css/main.css index ce27a0eb7..be1040d84 100644 --- a/css/main.css +++ b/css/main.css @@ -81,8 +81,8 @@ a.btn.btn-link.dropdown-toggle { min-height: 8em; } -.tile-content { - position: relative; +.tile-content { + position: relative; overflow-wrap: anywhere; /* stop long text like links pushing the width out too far*/ } .link-github { @@ -141,3 +141,64 @@ Not sure how to get 'normal' wrap behaviour (eg fill up until max-width, then wr white-space: normal; min-width: 160px; }*/ + +/* Terminal */ +/* ----------------------------------------------------- */ +.terminal +{ + font-size: 12px; + background-color: #222; + color: white; + display: block; + border: 0; + padding: 10px; + overflow: auto; /* adds scrollbar if needed */ + + position: absolute; + left: 0px; + top: 0px; + bottom: 0px; + right: 0px; + + -o-user-select: text; + -moz-user-select: text; + -webkit-user-select: text; + user-select: text; +} + +.termLine { + font-family: Fixed, monospace; + tab-size: 4; + min-height: 1em; +} + +.terminal.focus +{ + background-color: #333; +} + +.terminal__focus +{ + position: absolute; + top: -100px; /* hide it */ +} + +.terminal a +{ + color:#88F; +} +.terminal a:visited +{ + color:#88F; +} + +.terminal--connected.focus .terminal__cursor +{ + animation: blink 1s step-end 0s infinite; +} + +.terminal--webcam.focus .terminal__cursor +{ + text-shadow: none; + animation: blink_webcam 1s step-end 0s infinite; +} \ No newline at end of file diff --git a/index.html b/index.html index c8c34db66..608c90f91 100644 --- a/index.html +++ b/index.html @@ -190,14 +190,18 @@