From 85beae6554834ea89089560b25c163669ea71459 Mon Sep 17 00:00:00 2001 From: msoliman3 Date: Thu, 3 Nov 2022 12:43:57 +0100 Subject: [PATCH 1/4] light/dark mode pt.3 --- dashboard_static/style/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index c580b0c..4207dbe 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -7,7 +7,9 @@ --column-color: #1E1E1E; --secondary: #1D9BF0; } - +body { + overflow: hidden; +} body, html, .container { width: 100%; height: 100%; @@ -195,6 +197,7 @@ body { .leftcol, .centercol, .rightcol, .searchcontainer, .popchart { background-color: var(--column-color); + overflow: hidden; } .rightcol { From a6e3a127619830d8c16fd0fb0075c04cf09a686a Mon Sep 17 00:00:00 2001 From: msoliman3 Date: Thu, 3 Nov 2022 14:23:49 +0100 Subject: [PATCH 2/4] twitter hour help me lol --- dashboard.py | 2 +- dashboard_static/js/code.js | 3 +++ dashboard_static/style/style.css | 21 ++++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dashboard.py b/dashboard.py index fa975ac..7196e39 100644 --- a/dashboard.py +++ b/dashboard.py @@ -13,7 +13,7 @@ root_content_path = 'dashboard_static' # the action will be called with the context and the event @event('init') def setup(ctx, e): - start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.1) + start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.01) ctx.count = 0 # fire('sample', {'previous': 0.0}) diff --git a/dashboard_static/js/code.js b/dashboard_static/js/code.js index 43be3fd..91a3ed4 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -25,6 +25,8 @@ function showFeeds() { } function tweetCell(tweet) { + const date = new Date(tweet.created_at); + console.log(new Intl.DateTimeFormat('en-GB').format(date)); var cell = document.createElement("div"); cell.innerHTML = `
@@ -33,6 +35,7 @@ function tweetCell(tweet) {
${tweet.user.name} @${tweet.user.screen_name} +

${date.getHours()}:${date.getMinutes()}

${tweet.text}
diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index 3b04eee..691191b 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -7,9 +7,7 @@ --column-color: #1E1E1E; --secondary: #1D9BF0; } -body { - overflow: hidden; -} + body, html, .container { width: 100%; height: 100%; @@ -95,6 +93,7 @@ body { .tweet { display: flex; + gap: 10px; background-color: var(--tweet-color); border-radius: 16px; padding: 16px; @@ -112,6 +111,12 @@ body { padding-left: 16px; } +.tweet-name { + display: flex; + gap: 1.5%; + +} + .tweet-interactions { display: flex; margin-top: 8px; @@ -152,6 +157,13 @@ body { opacity: 0.8; } +.tweet-date { + color: var(--main-light); + text-decoration: none; + justify-self: flex-end; + opacity: 0.8; +} + .filters-search input { height: 28px; width: 100%; @@ -197,7 +209,6 @@ body { .leftcol, .centercol, .rightcol, .searchcontainer, .popchart { background-color: var(--column-color); - overflow: hidden; } .rightcol { @@ -280,4 +291,4 @@ body { .radius-bottom { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; -} \ No newline at end of file +} From 71fea5aef9f7361727ceacc8f1a60dfdf53c742d Mon Sep 17 00:00:00 2001 From: Tim Wijma Date: Thu, 3 Nov 2022 14:37:31 +0100 Subject: [PATCH 3/4] flexbpox --- __pycache__/dashboard.cpython-310.pyc | Bin 1562 -> 1562 bytes dashboard_static/js/code.js | 8 +++++--- dashboard_static/style/style.css | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc index 8e88d6080d3215bc1a15d6c85dbf30afd3dd732c..52532bb389045f8607b3aac5917967b06d3703c8 100644 GIT binary patch delta 35 pcmbQmGmD2epO=@50SIaiCnp
- ${tweet.user.name} - @${tweet.user.screen_name} -

${date.getHours()}:${date.getMinutes()}

+ + ${date.getHours()}:${date.getMinutes()}
${tweet.text}
diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index 691191b..8115c53 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -109,12 +109,17 @@ body { .tweet-content { padding-left: 16px; + width: 100%; } .tweet-name { display: flex; gap: 1.5%; + justify-content: space-between; +} +.tweet-date { + align-self: flex-end; } .tweet-interactions { From 25254cd2fcecc43d8be314952ba91644e3867933 Mon Sep 17 00:00:00 2001 From: Tim Wijma Date: Thu, 3 Nov 2022 15:54:23 +0100 Subject: [PATCH 4/4] sort by --- __pycache__/dashboard.cpython-310.pyc | Bin 1575 -> 1561 bytes dashboard_static/index.html | 6 ++- dashboard_static/js/events.js | 22 ++++++----- dashboard_static/style/style.css | 44 ++++++++++++++++----- eca/__pycache__/arff.cpython-310.pyc | Bin 10610 -> 10596 bytes eca/__pycache__/generators.cpython-310.pyc | Bin 3913 -> 3899 bytes 6 files changed, 51 insertions(+), 21 deletions(-) diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc index ab7ebca5d192afbbc21ac33e12aff0df021f0b95..66600d3ba265eaae9c231c26081dc0874f78cd80 100644 GIT binary patch delta 80 zcmZ3^Gn0oepO=@50SGP}NlrFo+sK#5Xl&2X8x{)uD(a}dgv^ce>SU*1}vn;hJBQLQ;-zBv;yClCr wKeVJgHLoO9KQcA3$WY%mKczG$)lk2rJhP-EwMe(1C_gJTxkP{SBF1tS0J-8Iz5oCK diff --git a/dashboard_static/index.html b/dashboard_static/index.html index 757132f..9e26092 100644 --- a/dashboard_static/index.html +++ b/dashboard_static/index.html @@ -99,15 +99,17 @@
-
- Sort By arrow_drop_down +
+ Sort By
    +
  • Time
  • Time
  • Likes
  • Retweets
  • Replies
+ arrow_drop_down
arrow_downward diff --git a/dashboard_static/js/events.js b/dashboard_static/js/events.js index 8a49af8..d78e71d 100644 --- a/dashboard_static/js/events.js +++ b/dashboard_static/js/events.js @@ -38,15 +38,6 @@ $(window).on("load", function() { showFeeds() }) -$(".sortby").on("click", function() { - $(".sort-dropdown").toggle() - // $(".sort-btn").toggleClass("radius-bottom") -}) - -$(".sort-dropdown-list li").on("click", function() { - $(".sort-dropdown").toggle() -}) - let root = document.querySelector(":root") $(".logo").on("click", function() { @@ -87,6 +78,19 @@ $(window).on("filter", function() { } }) +$(".current-sort").on("click", function() { + $(".sort-dropdown-list li:not(:first-of-type)").toggle() +}) + +$(".sort-btn").on("click", function() { + $(".sort-dropdown-list li:not(:first-of-type)").toggle() +}) + +$(".sort-dropdown-list li:not(:first-of-type)").on("click", function() { + $(".sort-dropdown-list li:not(:first-of-type)").toggle() + $(".current-sort").html($(this).html()) +}) + $(".order-btn").on("click", function() { if($(this).html() == "arrow_downward") { // Descending to ascending diff --git a/dashboard_static/style/style.css b/dashboard_static/style/style.css index 9b27667..0796aa3 100644 --- a/dashboard_static/style/style.css +++ b/dashboard_static/style/style.css @@ -248,33 +248,57 @@ body { user-select: none; } -.sort-btn { +.sort-by { user-select: none; - position: relative; + display: flex; + padding: 8px; +} + +.sort-by-title { + font-size: 24px; + font-weight: 500; + margin-right: 8px; } .sort-dropdown { - display: none; + display: flex; + align-items: flex-start; + position: relative; } .sort-dropdown-list { /* position: absolute; */ - width: 100%; list-style-type: none; padding: 0; margin: 0; - margin-left: -8px; - background-color: var(--main-light); - border-radius: 0 0 16px 16px; + background-color: white; + width: 150px; + border-radius: 16px; +} + +.material-symbols-outlined.sort-btn { + position: absolute; + right: 0; + top: 5px; + color: black; + font-size: 26px; +} + +.sort-dropdown-list li:not(:first-of-type) { + display: none; +} + +.sort-dropdown-list li:not(:first-of-type):hover { + background-color: rgb(215, 215, 215); } .sort-dropdown-list li { + color: #1E1E1E; font-weight: 500; font-size: 22px; padding: 0 8px; } -.radius-bottom { - border-bottom-left-radius: 16px; - border-bottom-right-radius: 16px; +.current-sort { + line-height: 36px; } \ No newline at end of file diff --git a/eca/__pycache__/arff.cpython-310.pyc b/eca/__pycache__/arff.cpython-310.pyc index 1516621a59785020207256a2be42150d073cc160..dab7427d1e834bcde8ccb59363edf0b65174b18e 100644 GIT binary patch delta 98 zcmewq^dyKcpO=@50SN3L#3x_Y*vQApY;Nmp6%$&VT2vfUl9^kc8RL?lT$-DjS5h3~ zo1apeld51CQ&OH;Qj%JvTTqmrm6}`=3N}I!azzwCW;pTiyb1` delta 112 zcmaD7^eKohpO=@50SL;sh9?KBZ{*`-cJe*3Zw$EK4oQ$V)8IcS$YIF3B&@ z4=pKA%_~XOk4#N0GSv6YPbtkwHPkOD&nziPEz&J0%FjwoF40d-PSoG*#~jPbcx&?- Nj#yzJ#U&HP3jk99CVl__ diff --git a/eca/__pycache__/generators.cpython-310.pyc b/eca/__pycache__/generators.cpython-310.pyc index 155bc4d8708199018b99b564bcb0b143f7aecc2c..01498c6c8ba1f70d9813f18b01d362c22d8e231b 100644 GIT binary patch delta 83 zcmX>pw_A=kpO=@50SN3L#3vu!$h(Ni+}YVGCbT%Us5qu1Gq*f5#w9