From cfd5b0ca3455be770f5d1d36af5910434bde1df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 17 Feb 2024 23:14:01 +0000 Subject: [PATCH] Change playcards to sumdets --- backloggery.css | 149 ++++++++++++++++++++++++++++++++++++++++-------- games.py | 104 +++++++++++++++++++++++++++++++-- 2 files changed, 225 insertions(+), 28 deletions(-) diff --git a/backloggery.css b/backloggery.css index ac4ffc1..13a0394 100644 --- a/backloggery.css +++ b/backloggery.css @@ -85,10 +85,7 @@ img { h1,h2 { font-family:Titillium Web,Tahoma,Arial,Helvetica,sans-serif; font-variant:small-caps; - letter-spacing:2px -} - -h1 { + letter-spacing:2px; border-bottom:1px solid var(--active-text); font-size:18px; margin:30px 0 10px; @@ -245,14 +242,17 @@ div.profile main { .game-item { margin-bottom:-3px; overflow:hidden; - position:relative + position:relative; } -.game-item>div:first-child { +.game-item>summary { + cursor: pointer; +} + +.game-item>summary:first-child { background-color:hsla(0,0%,100%,.05); border:2px solid rgba(0,0,0,.5); border-radius:4px; - cursor: default; -webkit-box-align:center; -ms-flex-align:center; align-items:center; @@ -268,13 +268,13 @@ div.profile main { width:100% } -.game-item>div:first-child>div { +.game-item>summary:first-child>div { -webkit-box-flex:1; -ms-flex:1; flex:1 } -.game-item>div:first-child>.platform { +.game-item>summary:first-child>.platform { background-color:var(--active-secondary); border-radius:3px 0 0 3px; color:var(--active-secondary-text); @@ -283,32 +283,32 @@ div.profile main { overflow:hidden } -.game-item>div:first-child>.platform img,.game-item>div:first-child>.platform p { +.game-item>summary:first-child>.platform img,.game-item>summary:first-child>.platform p { opacity:.85 } -.game-item>div:first-child>.platform img { +.game-item>summary:first-child>.platform img { position:relative; top:7px; width:35px } -.game-item>div:first-child>.platform img.bw { +.game-item>summary:first-child>.platform img.bw { -webkit-filter:var(--platform-bw); filter:var(--platform-bw) } -.game-item>div:first-child>.status { +.game-item>summary:first-child>.status { max-width:48px; padding:5px 9px } -.game-item>div:first-child>.status img { +.game-item>summary:first-child>.status img { margin-top:3px; max-width:32px } -.game-item>div:first-child>.text { +.game-item>summary:first-child>.text { -webkit-box-flex:5; -ms-flex-positive:5; flex-grow:5; @@ -316,7 +316,7 @@ div.profile main { text-align:left } -.game-item>div:first-child>.text>.title { +.game-item>summary:first-child>.text>.title { font-family:Titillium Web,sans-serif; font-size:1.1rem; line-height:1.1rem; @@ -324,7 +324,7 @@ div.profile main { } @supports(-webkit-line-clamp:1) { - .game-item>div:first-child>.text>.title { + .game-item>summary:first-child>.text>.title { overflow:hidden; text-overflow:ellipsis; white-space:normal; @@ -336,7 +336,7 @@ div.profile main { } -.game-item>div:first-child>.text>.markdown { +.game-item>summary:first-child>.text>.markdown { font-size:.7rem; max-height:32px; opacity:.75; @@ -348,7 +348,7 @@ div.profile main { } @supports(-webkit-line-clamp:2) { - .game-item>div:first-child>.text>.markdown { + .game-item>summary:first-child>.text>.markdown { overflow:hidden; text-overflow:ellipsis; white-space:normal; @@ -360,13 +360,13 @@ div.profile main { } -.game-item>div:first-child>.priority { +.game-item>summary:first-child>.priority { max-width:56px; padding-right:10px; text-align:center } -.game-item>div:first-child>.priority img { +.game-item>summary:first-child>.priority img { margin-top:3px; max-width:32px; opacity:.5 @@ -374,11 +374,11 @@ div.profile main { @media screen and (max-width:520px) { - .game-item>div:first-child>.text>.title { + .game-item>summary:first-child>.text>.title { font-size:1rem } - .game-item>div:first-child>.status { + .game-item>summary:first-child>.status { padding:5px } @@ -756,3 +756,106 @@ div.profile main { .library .unibar div:first-of-type span { margin-right:.5rem} } + +/* NEW */ + +.game-item .game-info { + -webkit-box-align:start; + -ms-flex-align:start; + align-items:flex-start; + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.05)),to(rgba(0,0,0,.05))); + background-image:linear-gradient(rgba(0,0,0,.05),rgba(0,0,0,.05)); + border-radius:0 0 5px 5px; + -webkit-box-shadow:inset 0 3px 10px rgba(0,0,0,.5); + box-shadow:inset 0 3px 10px rgba(0,0,0,.5); + margin:-10px 8px 15px 30px; + padding:10px; + position:relative +} + +.game-item .game-info label { + font-size:12px; + font-weight:700; + letter-spacing:.5px; + margin-left:4px; + opacity:.9; + text-transform:uppercase +} + +.game-item .game-info .markdown,.game-item .game-info p { + font-size:16px; + margin:0 0 12px .3rem; + padding:0 +} + +.game-item .game-info .data,.game-item .game-info .history,.game-item .game-info .review { + display:-webkit-box; + display:-ms-flexbox; + display:flex; + margin:auto 15px; +} + +.game-item .game-info .history { + -ms-flex-wrap:wrap; + flex-wrap:wrap; + width:100% +} + +.game-item .game-info .history .list { + font-size:14px +} + +.game-item .game-info .history .list>div { + display:-webkit-box; + display:-ms-flexbox; + display:flex +} + +.game-item .game-info .history .list>div>div:first-of-type { + -webkit-box-flex:1; + -ms-flex:1; + flex:1; + margin-right:5px; + opacity:.65; + text-align:right +} + +.game-item .game-info .history .list>div>div:last-of-type { + -webkit-box-flex:2; + -ms-flex:2; + flex:2 +} + +.game-item .game-info .box_2 { + margin-right:15px +} + +.game-item .game-guest label { + opacity:.5 +} + +@media screen and (max-width:700px) { + .game-item .game-info { + margin-left:8px + } + + .game-item .game-info .box_2 { + margin-right:0 + } + + .game-item .game-info .data,.game-item .game-info .history,.game-item .game-info .review { + display:block + } + + .game-item .game-info .data .box_1 div { + display:inline-block; + margin-right:1%; + width:48% + } + + +} + +.history .box_1 { + width: 95%; +} diff --git a/games.py b/games.py index 988c16a..3afe79d 100644 --- a/games.py +++ b/games.py @@ -178,10 +178,10 @@ decay = False def playcard(game,page): cardstring = "" if decay == True: - cardstring += "
\n" + cardstring += "
\n" else: - cardstring += "
\n" - cardstring += "
\n
\n
\n" + cardstring += "
\n" + cardstring += " \n
\n
\n" if game["console"] == "ps5": cardstring += " \"PS5\"\n" elif game["console"] == "ps2": @@ -252,7 +252,95 @@ def playcard(game,page): cardstring += "
\n
\n \"⯈\"\n
\n" except: cardstring += "
\n
\n \n
\n" - cardstring += "
\n
\n" + cardstring += " \n
\n
\n
\n" + try: + if len(game["recent"]) > 1: + cardstring += "
\n \n
" + game["recent"] + "
\n
\n" + except: + pass + cardstring += "
\n
\n \n

" + try: + if game["completed"]: + cardstring += "Completed" + except: + try: + if game["beaten"]: + cardstring += "Beaten" + except: + try: + if game["gameplay"]: + if game["id"] in endlessgames: + cardstring += "Endless" + else: + cardstring += "Unfinished" + except: + cardstring += "Unplayed" + cardstring += "

\n
\n
\n \n

" + try: + if game["gameplay"]: + try: + if game["completed"]: + if game["gameplay"] > game["completed"]: + if game["gameplay"] < (datetime.now() - timedelta(days=180)): + cardstring += "Not playing" + else: + cardstring += "Playing" + else: + cardstring += "Not playing" + except: + try: + if game["beaten"]: + if game["gameplay"] > game["beaten"]: + if game["gameplay"] < (datetime.now() - timedelta(days=180)): + cardstring += "Not playing" + else: + cardstring += "Playing" + else: + cardstring += "Not playing" + except: + if game["gameplay"] < (datetime.now() - timedelta(days=180)): + if game["id"] in endlessgames: + cardstring += "Not playing" + else: + cardstring += "Paused" + else: + cardstring += "Playing" + except: + cardstring += "Not playing" + cardstring += "

\n
\n
\n
\n
\n
\n \n

" + if game["console"] == "ps5": + cardstring += "PlayStation 5" + elif game["console"] == "ps2": + cardstring += "PlayStation 2" + elif game["console"] == "ps3": + cardstring += "PlayStation 3" + elif game["console"] == "nintendo switch": + cardstring += "Nintendo Switch" + elif game["console"] == "nintendo ds": + cardstring += "Nintendo DS" + elif game["console"] == "nintendo 3ds": + cardstring += "Nintendo 3DS" + elif game["console"] == "xbox 360": + cardstring += "XBox 360" + elif game["console"] == "pc": + cardstring += "PC" + cardstring += "

\n
\n
\n \n

" + game["lastupdate"].strftime("%Y-%m-%d") + "

\n
\n
\n
\n
\n
\n

Milestones

\n
\n
\n
" + game["initialdate"].strftime("%Y-%m-%d") + "
\n
\n Added
\n
\n" + try: + if game["firstplayed"]: + cardstring += "
\n
" + game["firstplayed"].strftime("%Y-%m-%d") + "
\n
\n Started
\n
\n" + except: + pass + try: + if game["beaten"]: + cardstring += "
\n
" + game["beaten"].strftime("%Y-%m-%d") + "
\n
\n Beaten
\n
\n" + except: + pass + try: + if game["completed"]: + cardstring += "
\n
" + game["completed"].strftime("%Y-%m-%d") + "
\n
\n Completed
\n
\n" + except: + pass + cardstring += "
\n
\n
\n
\n
\n" if page == "main": writeindex.write(cardstring) elif page == "library": @@ -392,7 +480,13 @@ if yearcompleted > 0: if yearendless > 0: writeindex.write(" \n \n") -writeindex.write(" \n
\n \n
\n
\n
\n Active Backlog · " + str(backlog) + " · " + str(round(((backlog/total)*100),1)) + "%\n
\n
\n
\n
\n") +writeindex.write(" \n
\n \n
\n
\n
") +if ((backlog/total)*100) > 50: + writeindex.write("\n Active Backlog · " + str(backlog) + " · " + str(round(((backlog/total)*100),1)) + "%") +writeindex.write("\n
\n
") +if ((backlog/total)*100) <= 50: + writeindex.write("\n Active Backlog · " + str(backlog) + " · " + str(round(((backlog/total)*100),1)) + "%") +writeindex.write("\n
\n
\n") compare = [] compare.append(unplayed)