diff --git a/app/css/tl.css b/app/css/tl.css index ed58612d..401ed0db 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -643,6 +643,7 @@ p:not(:last-child) { margin-top: 3px; padding: 1px; border-radius: 3px; + overflow: hidden; } .fa-2x > .emoji-img { width: 36px !important; @@ -681,6 +682,18 @@ p:not(:last-child) { .votebtn:hover { background-color: var(--color); } +.leadPoll { + position: absolute; + background-color: var(--box); + height: 20px; + border-radius: 3px; +} +.onPoll { + position: relative; +} +.maxVoter { + background-color: var(--shared); +} .jump { display: inline-block; animation: jump 0.75s linear infinite; diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 765a278e..6ab86858 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1350,9 +1350,12 @@ function pollParse(poll, acct_id) { } else { var minechoice = [] } - + var refresh = ` + ${lang.lang_manager_refresh} + ` if (poll.voted) { var myvote = lang.lang_parse_voted + if(poll.expired) myvote = myvote + '/' + lang.lang_parse_endedvote var result_hide = '' } else if (poll.expired) { var myvote = lang.lang_parse_endedvote @@ -1364,12 +1367,13 @@ function pollParse(poll, acct_id) { myvote + ` ${lang.lang_parse_unvoted} - ` + ` } var result_hide = 'hide' } var ended = date(poll.expires_at, datetype) var pollHtml = '' + var max = _.maxBy(choices, 'votes_count').votes_count; Object.keys(choices).forEach(function(keyc) { var choice = choices[keyc] var voteit = '' @@ -1388,25 +1392,33 @@ function pollParse(poll, acct_id) { var votesel = '' var voteclass = '' } + var per = Math.ceil(choice.votes_count / poll.votes_count * 100) + if(max == choice.votes_count) { + var addPoll = 'maxVoter' + } else { + var addPoll = '' + } pollHtml = pollHtml + `