Skip to content

Commit

Permalink
v2.05.2
Browse files Browse the repository at this point in the history
-Fix for buy / sell arrow
-Fix for autostart (still finicky though)
-UI / UX improvements
  • Loading branch information
taoteh1221 committed Oct 12, 2019
1 parent 19dffdb commit f88d58c
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions TICKER-INSTALL.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 " "

Expand Down Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions dfd-crypto-ticker/Misc.Docs.Etc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ v2.05.1
---------------------------------------------------------


---------------------------------------------------------
v2.05.2
-Fix for buy / sell arrow
-Fix for autostart (still finicky though)
-UI / UX improvements
---------------------------------------------------------








Expand Down
6 changes: 6 additions & 0 deletions dfd-crypto-ticker/apps/ticker/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'




53 changes: 42 additions & 11 deletions dfd-crypto-ticker/apps/ticker/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@


body, html {
margin: 0px;
padding: 0px;
margin: 0px;
padding: 0px;
font-family: serif;
}


Expand All @@ -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;
Expand All @@ -54,7 +56,7 @@ p {
background: black;
color: #c6c6c6;
padding: 1em;
padding-bottom: 40px;
padding-bottom: 55px;
}


Expand All @@ -80,7 +82,7 @@ p {
white-space: nowrap;
overflow: hidden;
font-weight: 350;
font-size: 70px;
font-size: 60px;
}


Expand Down Expand Up @@ -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;
}



2 changes: 0 additions & 2 deletions dfd-crypto-ticker/apps/ticker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<link rel="stylesheet prefetch" href="css/normalize.min.css"/>

<link rel="stylesheet prefetch" href="css/font-awesome.min.css"/>

<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>

<link rel="stylesheet" href="css/style.css" type="text/css" />

Expand Down
16 changes: 3 additions & 13 deletions dfd-crypto-ticker/apps/ticker/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
"<div class='spacing'><span class=" +
"<div class='spacing'><span class='arrow " +
side +
">" +
sign +
"</span> <span class='tick'>" + fiat_symbol +
"'></span> <span class='tick'>" + fiat_symbol +
numberWithCommas(price) +
"</span></div><div class='spacing small'>(" + pairing + " Vol: " + fiat_symbol +
numberWithCommas(fiat_volume) +
Expand Down
16 changes: 15 additions & 1 deletion dfd-crypto-ticker/apps/ticker/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
var markets = crypto_markets.split("|");


///////////////////////////////////////////////////////////////////////////////////////


// API call config
var subscribe_msg = {
Expand Down Expand Up @@ -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");
Expand All @@ -60,4 +68,10 @@ div_slideshow();
api_connect();


});
});


//////////////////////////////////////////////////////////////////////////////////////



11 changes: 0 additions & 11 deletions dfd-crypto-ticker/scripts/start-chromium.bash

This file was deleted.

12 changes: 11 additions & 1 deletion dfd-crypto-ticker/scripts/ticker-init.bash
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit f88d58c

Please sign in to comment.