diff --git a/README.txt b/README.txt index f9caa78..3f3a115 100644 --- a/README.txt +++ b/README.txt @@ -58,7 +58,7 @@ If you have a "goodtft LCD-show" LCD screen and you installed it's drivers, you You may need to adjust the initial chromium web browser scale size if your screen is NOT 3.5". This can be edited with a text editor in: -/home/pi/dfd-crypto-ticker/scripts/start-chromium.bash +/home/pi/dfd-crypto-ticker/scripts/ticker-init.bash If ticker autostart on system boot fails for any reason, the ticker can be started MANUALLY (after system boot) with this command: diff --git a/TICKER-INSTALL.bash b/TICKER-INSTALL.bash index f1efbbf..4dc4d20 100644 --- a/TICKER-INSTALL.bash +++ b/TICKER-INSTALL.bash @@ -197,8 +197,9 @@ echo " " echo "Proceeding with required component installation..." echo " " - -/usr/bin/sudo /usr/bin/apt-get install xdotool unclutter raspberrypi-ui-mods rpi-chromium-mods -y + +# ttf-ancient-fonts provides needed unicode font coverage in chromium +/usr/bin/sudo /usr/bin/apt-get install xdotool unclutter raspberrypi-ui-mods rpi-chromium-mods ttf-ancient-fonts -y echo " " @@ -351,8 +352,9 @@ select opt in $OPTIONS; do mkdir -p /home/$SYS_USER/.config/lxsession/$LXDE_PROFILE/ /usr/bin/touch /home/$SYS_USER/.config/lxsession/$LXDE_PROFILE/autostart - - echo -e "$GLOBAL_LXDE \n@/bin/bash /home/pi/dfd-crypto-ticker/scripts/ticker-init.bash & \n" > /home/$SYS_USER/.config/lxsession/$LXDE_PROFILE/autostart + + # Play it safe and be sure their is a newline after each entry + echo -e "$GLOBAL_LXDE \n@bash /home/$SYS_USER/dfd-crypto-ticker/scripts/ticker-init.bash &>/dev/null & \n" > /home/$SYS_USER/.config/lxsession/$LXDE_PROFILE/autostart /bin/chown -R $SYS_USER:$SYS_USER /home/$SYS_USER/.config diff --git a/dfd-crypto-ticker/Misc.Docs.Etc/changelog.txt b/dfd-crypto-ticker/Misc.Docs.Etc/changelog.txt index a9e4e8a..03af116 100644 --- a/dfd-crypto-ticker/Misc.Docs.Etc/changelog.txt +++ b/dfd-crypto-ticker/Misc.Docs.Etc/changelog.txt @@ -158,6 +158,17 @@ v2.05.1 --------------------------------------------------------- +--------------------------------------------------------- +v2.05.2 +-Fix for buy / sell arrow +-Fix for autostart (still finicky though) +-UI / UX improvements +--------------------------------------------------------- + + + + + diff --git a/dfd-crypto-ticker/apps/ticker/config.js b/dfd-crypto-ticker/apps/ticker/config.js index 09f649f..2057381 100644 --- a/dfd-crypto-ticker/apps/ticker/config.js +++ b/dfd-crypto-ticker/apps/ticker/config.js @@ -18,3 +18,9 @@ var slideshow_speed = 20; var screen_position = 'flip'; // 'upright' or 'flip' +// Bottom margin +var bottom_margin = '55px'; // '[number]px' example: '55px' + + + + diff --git a/dfd-crypto-ticker/apps/ticker/css/style.css b/dfd-crypto-ticker/apps/ticker/css/style.css index b17f3b3..c46c4b5 100644 --- a/dfd-crypto-ticker/apps/ticker/css/style.css +++ b/dfd-crypto-ticker/apps/ticker/css/style.css @@ -4,8 +4,9 @@ body, html { - margin: 0px; - padding: 0px; + margin: 0px; + padding: 0px; + font-family: serif; } @@ -21,27 +22,28 @@ html { .title { white-space: nowrap; position: relative; - Font-family: Montserrat; + font-family: serif; font-weight: 350; - font-size:50px; + font-size:48px; margin: 0; } .small { font-weight: 350; - font-size:37px; + font-size: 29px; } p { position: relative; - Font-family: Montserrat; + font-family: serif; } #ticker_window { + font-family: serif; border: 0px solid red; position:absolute; text-align: center; @@ -54,7 +56,7 @@ p { background: black; color: #c6c6c6; padding: 1em; - padding-bottom: 40px; + padding-bottom: 55px; } @@ -80,7 +82,7 @@ p { white-space: nowrap; overflow: hidden; font-weight: 350; - font-size: 70px; + font-size: 60px; } @@ -111,12 +113,41 @@ span { } -span.sell { - background-color: rgb(105, 199, 115); +span.arrow { +border: 0px solid white; +position: relative; +vertical-align: middle; +margin-right: 10px; } + span.buy { - background-color: rgb(199, 105, 105); + /*background-color: solid rgb(105, 199, 115);*/ + position: relative; + bottom: 35px; + width: auto; + height: 58px; + border-left: 24px solid transparent; + border-right: 24px solid transparent; + border-bottom: 58px solid rgb(105, 199, 115); + font-size: 0px; + line-height: 0px; +} + + +span.sell { + /*background-color: rgb(199, 105, 105);*/ + position: relative; + bottom: -23px; + width: auto; + height: 58px; + border-left: 24px solid transparent; + border-right: 24px solid transparent; + border-top: 58px solid rgb(199, 105, 105); + font-size: 0px; + line-height: 0px; } + + diff --git a/dfd-crypto-ticker/apps/ticker/index.html b/dfd-crypto-ticker/apps/ticker/index.html index 4e2980c..d5142a1 100644 --- a/dfd-crypto-ticker/apps/ticker/index.html +++ b/dfd-crypto-ticker/apps/ticker/index.html @@ -10,8 +10,6 @@ - - diff --git a/dfd-crypto-ticker/apps/ticker/js/functions.js b/dfd-crypto-ticker/apps/ticker/js/functions.js index 190f874..bb974cf 100644 --- a/dfd-crypto-ticker/apps/ticker/js/functions.js +++ b/dfd-crypto-ticker/apps/ticker/js/functions.js @@ -121,23 +121,13 @@ var socket = new WebSocket('wss://ws-feed.gdax.com'); fiat_volume = fiat_volume.toFixed(0); - var sign; - if (msg["side"] == "sell") { - sign = "▲"; - } - else { - sign = "▼"; - } - - var side = '"' + msg["side"] + '"'; + var side = msg["side"]; var price_list_item = - "
" + fiat_symbol + + "'> " + fiat_symbol + numberWithCommas(price) + "
(" + pairing + " Vol: " + fiat_symbol + numberWithCommas(fiat_volume) + diff --git a/dfd-crypto-ticker/apps/ticker/js/init.js b/dfd-crypto-ticker/apps/ticker/js/init.js index 19280ae..303ad9a 100644 --- a/dfd-crypto-ticker/apps/ticker/js/init.js +++ b/dfd-crypto-ticker/apps/ticker/js/init.js @@ -7,6 +7,8 @@ var markets = crypto_markets.split("|"); +/////////////////////////////////////////////////////////////////////////////////////// + // API call config var subscribe_msg = { @@ -35,11 +37,17 @@ markets.forEach(element => { //console.log(subscribe_msg); +////////////////////////////////////////////////////////////////////////////////////// + // Initiate once page is fully loaded... $(document).ready(function() { +// Bottom margin +$("#ticker_window").css({ "padding-bottom": bottom_margin }); + + // Flipped screen if ( screen_position == 'flip' ) { $("#ticker_window").addClass("flip"); @@ -60,4 +68,10 @@ div_slideshow(); api_connect(); -}); \ No newline at end of file +}); + + +////////////////////////////////////////////////////////////////////////////////////// + + + diff --git a/dfd-crypto-ticker/scripts/start-chromium.bash b/dfd-crypto-ticker/scripts/start-chromium.bash deleted file mode 100644 index 59292fe..0000000 --- a/dfd-crypto-ticker/scripts/start-chromium.bash +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Device scale setting, adjust to fit your screen size ("1.00" is for 3.5" LCD screens) -DEVICE_SCALE="1.00" - -export DISPLAY=:0 - -/usr/bin/chromium-browser /home/pi/dfd-crypto-ticker/apps/ticker/index.html --force-device-scale-factor=$DEVICE_SCALE --start-fullscreen - -/usr/bin/xdotool key F11 - diff --git a/dfd-crypto-ticker/scripts/ticker-init.bash b/dfd-crypto-ticker/scripts/ticker-init.bash index 1b50719..2a1f467 100644 --- a/dfd-crypto-ticker/scripts/ticker-init.bash +++ b/dfd-crypto-ticker/scripts/ticker-init.bash @@ -1,5 +1,14 @@ #!/bin/bash +# Device scale setting, adjust to fit your screen size ("1.00" is for 3.5" LCD screens) +DEVICE_SCALE="1.00" + +################################### + +# Reliably set working directory to .../dfd-crypto-ticker/... under any home directory username +cd "$(dirname "$0")" +cd ../ + export DISPLAY=:0 /usr/bin/xset s off @@ -10,5 +19,6 @@ export DISPLAY=:0 /usr/bin/unclutter -idle 0 -/bin/bash /home/pi/dfd-crypto-ticker/scripts/start-chromium.bash & +#incognito mode doesn't prompt to restore previous session, yay +/usr/bin/chromium-browser ./apps/ticker/index.html --start-fullscreen --incognito --force-device-scale-factor=$DEVICE_SCALE