-
+ {% for ident in flight[i]["ident"] %}
+
- {{ ident }} + {% endfor %} +
diff --git a/app.py b/app.py index d85eea5..e1e5711 100644 --- a/app.py +++ b/app.py @@ -16,12 +16,12 @@ def hello_world(): rawdata = datapull.grabber() airport = {"name": "", "icao": "", "iata": ""} for flight in rawdata: - # Source Airport naming + # Source Airport naming : airport["name"] = flight["origin"]["name"] airport["icao"] = flight["origin"]["code_icao"] airport["iata"] = flight["origin"]["code_iata"] - # Converting departures time from UTC to local time + # Converting departures time from UTC to local time : origintimezone = flight["origin"]["timezone"] from_zone = tz.gettz('UTC') to_zone = tz.gettz(origintimezone) @@ -29,7 +29,13 @@ def hello_world(): utctime = utctime.replace(tzinfo=from_zone) flight["scheduled_off"] = utctime.astimezone(to_zone).strftime(localformat) - # Calculating Delays in human readable ways + # Adding the secondary flight numbers : + flightnr = flight["ident"] + flight["ident"] = [] + flight["ident"].append(flightnr) + for otherrefs in flight["codeshares"]: + flight["ident"].append(otherrefs) + # Calculating Delays in human readable ways : negative = False delay = flight["departure_delay"] if delay != 0: @@ -45,9 +51,3 @@ def hello_world(): if negative: flight["departure_delay"] = ("-" + str(flight["departure_delay"])) return render_template('screen.html', len=len(rawdata), airport=airport, flight=rawdata) - - -@app.route("/style.css") -def style(): - with open("static/style.css", "r") as f: - return f.read(), 200, {'Content-Type': 'text/css; charset=utf-8'} diff --git a/static/animation.css b/static/animation.css new file mode 100644 index 0000000..2315345 --- /dev/null +++ b/static/animation.css @@ -0,0 +1,115 @@ +.content { + overflow:hidden; + + &__container { + overflow: hidden; + + &:before { + content: '['; + left: 0; + } + + &:after { + content: ']'; + position: absolute; + right: 0; + } + + &:after, &:before { + top: 0; + -webkit-animation-name: opacity; + -webkit-animation-duration: 2s; + -webkit-animation-iteration-count: infinite; + animation-name: opacity; + animation-duration: 2s; + animation-iteration-count: infinite; + } + &__list { + -webkit-animation-name: change; + -webkit-animation-duration: 10s; + -webkit-animation-iteration-count: infinite; + animation-name: change; + animation-duration: 10s; + animation-iteration-count: infinite; + + &__item { + line-height:40px; + margin:0; + } + } + } +} + +@-webkit-keyframes opacity { + 0%, 100% {opacity:0;} + 50% {opacity:1;} +} + +@-webkit-keyframes change { + 0%, 12.66%, 100% {transform:translate3d(0,0,0);} + 16.66%, 29.32% {transform:translate3d(0,-25%,0);} + 33.32%,45.98% {transform:translate3d(0,-50%,0);} + 49.98%,62.64% {transform:translate3d(0,-75%,0);} + 66.64%,79.3% {transform:translate3d(0,-50%,0);} + 83.3%,95.96% {transform:translate3d(0,-25%,0);} +} + +@-o-keyframes opacity { + 0%, 100% {opacity:0;} + 50% {opacity:1;} +} + +@-o-keyframes change { + 0%, 12.66%, 100% {transform:translate3d(0,0,0);} + 16.66%, 29.32% {transform:translate3d(0,-25%,0);} + 33.32%,45.98% {transform:translate3d(0,-50%,0);} + 49.98%,62.64% {transform:translate3d(0,-75%,0);} + 66.64%,79.3% {transform:translate3d(0,-50%,0);} + 83.3%,95.96% {transform:translate3d(0,-25%,0);} +} + +@-moz-keyframes opacity { + 0%, 100% {opacity:0;} + 50% {opacity:1;} +} + +@-moz-keyframes change { + 0%, 12.66%, 100% {transform:translate3d(0,0,0);} + 16.66%, 29.32% {transform:translate3d(0,-25%,0);} + 33.32%,45.98% {transform:translate3d(0,-50%,0);} + 49.98%,62.64% {transform:translate3d(0,-75%,0);} + 66.64%,79.3% {transform:translate3d(0,-50%,0);} + 83.3%,95.96% {transform:translate3d(0,-25%,0);} +} + +@keyframes opacity { + 0%, 100% {opacity:0;} + 50% {opacity:1;} +} + +@keyframes change { + 0%, 12.66%, 100% {transform:translate3d(0,0,0);} + 16.66%, 29.32% {transform:translate3d(0,-25%,0);} + 33.32%,45.98% {transform:translate3d(0,-50%,0);} + 49.98%,62.64% {transform:translate3d(0,-75%,0);} + 66.64%,79.3% {transform:translate3d(0,-50%,0);} + 83.3%,95.96% {transform:translate3d(0,-25%,0);} +} + +// 6 is the number of animation. +// Here, there are 4 lines : + +// 1 to 2 +// 2 to 3 +// 3 to 4 +// 4 to 3 +// 3 to 2 +// 2 to 1 + +// 6x + 6y = 100 (100% duration) + +// HERE : +// y = 4 -> Animation between two lines +// x = 12.66 -> Time spent on a line + +// You can define a value and calculate the other if you want change speed or the number of lines \ No newline at end of file diff --git a/templates/screen.html b/templates/screen.html index ad80571..9118615 100644 --- a/templates/screen.html +++ b/templates/screen.html @@ -2,7 +2,8 @@
- + +