From d06a9fa3a261b4addb6bab8d0c02c415ba954694 Mon Sep 17 00:00:00 2001 From: Remy Moll <mollator2@gmail.com> Date: Thu, 5 Nov 2020 09:38:20 +0100 Subject: [PATCH] Fixed brightness issues at night --- clock/main.py | 2 +- dashboard/Microsoft Edge.lnk | Bin 0 -> 2376 bytes dashboard/main.py | 87 +++++++++++++++++++++++++++++++++++ dashboard/static/test.css | 33 +++++++++++++ dashboard_wrapper.py | 43 +---------------- 5 files changed, 122 insertions(+), 43 deletions(-) create mode 100644 dashboard/Microsoft Edge.lnk create mode 100644 dashboard/static/test.css diff --git a/clock/main.py b/clock/main.py index 905f933..e134e42 100644 --- a/clock/main.py +++ b/clock/main.py @@ -77,7 +77,7 @@ class ClockFace(object): if (is_WE and (now > 1000 and now < 2200)) or ((not is_WE) and (now > 800 and now < 2130)): brightness = 0.8 else: - brightness = 0.02 + brightness = 0.01 self.IO.output.set_brightness(brightness) diff --git a/dashboard/Microsoft Edge.lnk b/dashboard/Microsoft Edge.lnk new file mode 100644 index 0000000000000000000000000000000000000000..031aaf146fea6a0e46fb1eb4f892c4fe8f45a1a1 GIT binary patch literal 2376 zcmds3TS$~q5T4Z}B?7H2D!OdJ#+vTxcHK6^-8MJP%l^NX-G0bR>$bHw_TO?9i|C<5 z%7S_*B9w@dD9Rp+D9VS#sE`7)Ac)GIx*7G>jlMbBYPLl5(1YhNbIw0!&YbVe%+A>& zBGPCRz==8pCuhHnNQe2lOS1j+(OymG`=m|Z&i87bbUxhdYU|Y;uFVvh8o`H{IYCRa zr01>&y4O~3>ZvEml#!i%aw=sxtjds9Y<7&yV!lZZl&6tY>RMH5-#wpb52er;>c6?) z^|U~d=j526btj+&Pm1j=7c*UMvPPmX1<3<mNq)d~l9znsCKYo7Mae>oDIMB2NVY=m zLtjAi$wXVkJd=$0GDFWyOQ1J}ltEm}<V0I46&E;4U1hrgb>$$gW%90EMK%arZ${u6 z0N9tTQZaB;3v4Rz)lfv(E*Z3~$Xz+9l()s>CbGutCfZoe_kA1J?!J3VC=a+jxCfDz zDq_}pV9hQ`MFkE<njf<`9u|9q#dmQnez4Bd*eQhW6L>3u(+j)-fwlsk;b51`HF-Mn zt8U;mxuZDT`O69S#0ih(iP)708r}>|a}gI6hzD?+FpCQO)1bB;G#$jL#G?_!Z5t>J z#MUk!l^Rkp64FQt2R-3Rzs~9PxmBGZYFV7F6nm?~K{Z$tQP`h~JrweJt1BbkU_coT zc{~+}1X+i}tB@Qj?Lc^H@D-pHNCy)FKb-$vVkvO~t;B+)P<-bqaa}SM*Ehl?8~_!g z4hb7U58=y7S?C_DaI$lPa{{|5ha6Z_=>MbDA~s`*TJ?i55g`!~(f@5oIH;qd=|}i~ zs0a;}AU&e=dr|n;Tp1N^8+Di9GKEK~bsok}5SO%Z`0lrDZ1~dpwQ&FHj*ri;eQxHp z3J`umt?Myz3%mVwMm6NFj)YNQiIg)}cix`)tfW0L<8fEg-Nv&E7j-n#o3ut{uXLs{ zeY&r!<>~FdSB1B-n(u6gtV$TUz6~`s1@>RTmbpwSTWct4scTtU*!JK>kMYH$Pj!&b z;e%#@7J`0HPE#D&&-Z6DUd&n)pzTzLa=HM;$bzv-$Y%dx-#}fTzz6el!G(VYh#v#I zTlnMA-BeY7HJI0SaLukO-R~aFh72wpfQfno(`B*x%5rXY5a01-(|YHPB8%ht*NI2w z9`kqWAs@pEd`CC~Ta9=#jkHLN7G4r<DL5NwpX^_G;b18LY`)EOdU^B!L)*$43@yFy W(D(Z%CgoqeTrYh-evbcD#M%$49BbPE literal 0 HcmV?d00001 diff --git a/dashboard/main.py b/dashboard/main.py index e69de29..ebfeacc 100644 --- a/dashboard/main.py +++ b/dashboard/main.py @@ -0,0 +1,87 @@ +import dash +import dash_bootstrap_components as dbc +import dash_html_components as html +import dash_core_components as dcc +#from dash.dependencies import Input, Output + +import datetime +ex_css = [dbc.themes.BOOTSTRAP, "static/test.css"] +app = dash.Dash(__name__, external_stylesheets=ex_css) + +card_main = dbc.Card( + [ + dbc.CardImg(src="/assets/ball_of_sun.jpg", top=True, bottom=False, + title="Image by Kevin Dinkel", alt='Learn Dash Bootstrap Card Component'), + dbc.CardBody( + [ + html.H4("Learn Dash with Charming Data", className="card-title"), + html.H6("Lesson 1:", className="card-subtitle"), + html.P( + "Choose the year you would like to see on the bubble chart.", + className="card-text", + ), + + dbc.Button("Still not live I guess?", color="primary"), + # dbc.CardLink("GirlsWhoCode", href="https://girlswhocode.com/", target="_blank"), + ] + ), + ], + color="dark", # https://bootswatch.com/default/ for more card colors + inverse=True, # change color of text (black or white) + outline=False, # True = remove the block colors from the background and header +) + +card_question = dbc.Card( + [ + dbc.CardBody([ + html.H4("Question 1", className="card-title"), + html.P("What was India's life expectancy in 1952?", className="card-text"), + dbc.ListGroup( + [ + dbc.ListGroupItem("A. 55 years"), + dbc.ListGroupItem("B. 37 years"), + dbc.ListGroupItem("C. 49 years"), + ], flush=True) + ]), + ], color="warning", +) + + + + + +today = datetime.date.today().strftime("%d.%m.%Y") +tag = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"][datetime.datetime.today().weekday()] + +string_header = tag + ", der " + today + + +app.layout = html.Div([ + html.Header(children = [ + html.H1(string_header) + ]), + html.Div( + className = "content", + style = {"padding-top" : "32em"}, + children = [ + dbc.Row([dbc.Col(card_main, width=3), + dbc.Col(card_question, width=3)], justify="around"), # justify="start", "center", "end", "between", "around" + + # dbc.CardGroup([card_main, card_question, card_graph]) # attaches cards with equal width and height columns + # dbc.CardDeck([card_main, card_question, card_graph]) # same as CardGroup but with gutter in between cards + + # dbc.CardColumns([ # Cards organised into Masonry-like columns + # card_main, + # card_question, + # card_graph, + # card_question, + # card_question, + # ]) + ]) +]) + + + + +if __name__ == "__main__": + app.run_server(host="0.0.0.0") diff --git a/dashboard/static/test.css b/dashboard/static/test.css new file mode 100644 index 0000000..b5c2706 --- /dev/null +++ b/dashboard/static/test.css @@ -0,0 +1,33 @@ +header { + position: fixed; + width: 100%; + height: var(--heading-height); +} + +/* Create angled background with 'before' pseudo-element */ +header::before { + content: ""; + display: block; + position: absolute; + left: 0; + bottom: 6em; + width: 100%; + height: calc(var(--heading-height) + 10em); + z-index: -1; + transform: skewY(-3.5deg); + background: + linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.6)), + url(https://images.unsplash.com/photo-1495464101292-552d0b52fe41?auto=format&fit=crop&w=1350&q=80) no-repeat center, + linear-gradient(#4e4376, #2b5876); + background-size: cover; + border-bottom: .2em solid #fff; +} + +h1 { + font-size: calc(2.8em + 2.6vw); + font-weight: 650; + letter-spacing: .01em; + padding: 6rem 0 0 4.5rem; + text-shadow: .022em .022em .022em #111; + color: #fff; +} diff --git a/dashboard_wrapper.py b/dashboard_wrapper.py index caf98c0..40dbd7f 100644 --- a/dashboard_wrapper.py +++ b/dashboard_wrapper.py @@ -1,42 +1 @@ -import dash -from flask import Flask -import dash_core_components as dcc -import dash_html_components as html -import plotly.graph_objs as go -import numpy as np - -external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] - -server = Flask(__name__) -app = dash.Dash(__name__, server=server, external_stylesheets = external_stylesheets) - -np.random.seed(101) -random_x = np.linspace(1,5,20) -random_y = np.exp(random_x) - - -app.layout = html.Div(children = [ - html.H1("Hello wolrd!"), - dcc.Graph( - id="scatter", - figure = { - "data" : [ - go.Scatter( - x = random_x, - y = random_y, - mode="markers" - ) - ], - "layout" : go.Layout( - title="This is a test", - xaxis={"title" : "x"}, - yaxis={"title" : "y"} - ) - } - ), - - ]) - - -if __name__ == "__main__": - app.run_server(host="0.0.0.0") +### mmmh I'm not that far