This commit is contained in:
恍兮惚兮 2025-01-01 04:46:48 +08:00
parent f77bf6c3ec
commit 20a1fc0556
2 changed files with 32 additions and 24 deletions

View File

@ -54,20 +54,14 @@ def calc_uid_times(inf):
return everytimes return everytimes
def spliteverygameinmothon(yearinfos):
allmonths = []
for uid in yearinfos:
everydays = split_range_into_days(yearinfos, uidx=uid)
everymonth = group_by_month(everydays)
def getthisyearinfo(allinfos): def getthisyearinfo(allinfos):
current_year = datetime.now().year current_year = datetime.now().year * 12 + datetime.now().month
yearinfos = {} yearinfos = {}
for uid, ls in allinfos.items(): for uid, ls in allinfos.items():
yearinfos[uid] = [] yearinfos[uid] = []
for s, e in ls: for s, e in ls:
if datetime.fromtimestamp(s).year == current_year: date = datetime.fromtimestamp(s)
if date.year * 12 + date.month + 12 >= current_year:
yearinfos[uid].append((s, e)) yearinfos[uid].append((s, e))
if len(yearinfos[uid]) == 0: if len(yearinfos[uid]) == 0:
yearinfos.pop(uid) yearinfos.pop(uid)
@ -122,11 +116,11 @@ def getuidimage_local(uid):
if (main in savehook_new_data[uid]["imagepath_all"]) and os.path.exists( if (main in savehook_new_data[uid]["imagepath_all"]) and os.path.exists(
extradatas["localedpath"].get(main, main) extradatas["localedpath"].get(main, main)
): ):
return os.path.abspath(main) return os.path.abspath(extradatas["localedpath"].get(main, main))
else: else:
for _ in savehook_new_data[uid]["imagepath_all"]: for _ in savehook_new_data[uid]["imagepath_all"]:
if os.path.exists(extradatas["localedpath"].get(_, _)): if os.path.exists(extradatas["localedpath"].get(_, _)):
return os.path.abspath(_) return os.path.abspath(extradatas["localedpath"].get(_, _))
def getuidimage(uid): def getuidimage(uid):

View File

@ -13,13 +13,18 @@
.page { .page {
display: none; display: none;
} }
.vboxlayout{
display: flex; flex-direction: column; .vboxlayout {
display: flex;
flex-direction: column;
} }
.hboxlayout{
display: flex; flex-direction: row; .hboxlayout {
display: flex;
flex-direction: row;
} }
.active { .active {
display: block; display: block;
} }
@ -114,7 +119,7 @@
.imagecontainer { .imagecontainer {
width: 20%; width: 20%;
height: auto; height: auto;
aspect-ratio: 1 / 1.618; aspect-ratio: 1 / 1.5;
} }
.imagexx { .imagexx {
@ -162,22 +167,31 @@
<div class="page bigbox" id="page2"> <div class="page bigbox" id="page2">
<div class="vboxlayout" style="height: 100%;"> <div class="vboxlayout" style="height: 100%;">
<h1 style="text-align: center; flex:1">你所玩的游戏的标签</h1> <h1 style="text-align: center; flex:1">你所玩的游戏的标签</h1>
<div style="flex:10;"><div id="wordcloud"></div></div></div> <div style="flex:10;">
<div id="wordcloud"></div>
</div>
</div>
</div> </div>
<div class="page bigbox" id="page3"> <div class="page bigbox" id="page3">
<div class="vboxlayout" style="height: 100%;"> <div class="vboxlayout" style="height: 100%;">
<h1 style="text-align: center; flex:1">你所玩的游戏的开发商</h1> <h1 style="text-align: center; flex:1">你所玩的游戏的开发商</h1>
<div style="flex:10;"><div id="wordcloud2"></div></div></div> <div style="flex:10;">
<div id="wordcloud2"></div>
</div>
</div>
</div> </div>
<div class="buttons"> Next</div> <div class="buttons"> Next</div>
<script> <script>
havedatamonth = [] havedatamonth = []
havedatamonth_v = [] havedatamonth_v = []
for (let i = 1; i <= 12; i += 1) { let month = new Date().getMonth() + 1;
if (everymonth_time[i]) { for (let i = 0; i < 12; i += 1) {
havedatamonth.push(i) if (everymonth_time[month]) {
havedatamonth_v.push(everymonth_time[i] / 3600) havedatamonth.push(month)
havedatamonth_v.push(everymonth_time[month] / 3600)
} }
month -= 1;
if (month == 0) month = 12;
} }
var ctx = document.getElementById('everymonth').getContext('2d'); var ctx = document.getElementById('everymonth').getContext('2d');
let lastshowmonth = 0; let lastshowmonth = 0;