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
def spliteverygameinmothon(yearinfos):
allmonths = []
for uid in yearinfos:
everydays = split_range_into_days(yearinfos, uidx=uid)
everymonth = group_by_month(everydays)
def getthisyearinfo(allinfos):
current_year = datetime.now().year
current_year = datetime.now().year * 12 + datetime.now().month
yearinfos = {}
for uid, ls in allinfos.items():
yearinfos[uid] = []
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))
if len(yearinfos[uid]) == 0:
yearinfos.pop(uid)
@ -122,11 +116,11 @@ def getuidimage_local(uid):
if (main in savehook_new_data[uid]["imagepath_all"]) and os.path.exists(
extradatas["localedpath"].get(main, main)
):
return os.path.abspath(main)
return os.path.abspath(extradatas["localedpath"].get(main, main))
else:
for _ in savehook_new_data[uid]["imagepath_all"]:
if os.path.exists(extradatas["localedpath"].get(_, _)):
return os.path.abspath(_)
return os.path.abspath(extradatas["localedpath"].get(_, _))
def getuidimage(uid):

View File

@ -13,13 +13,18 @@
.page {
display: none;
}
.vboxlayout {
display: flex; flex-direction: column;
display: flex;
flex-direction: column;
}
.hboxlayout {
display: flex; flex-direction: row;
display: flex;
flex-direction: row;
}
.active {
display: block;
}
@ -114,7 +119,7 @@
.imagecontainer {
width: 20%;
height: auto;
aspect-ratio: 1 / 1.618;
aspect-ratio: 1 / 1.5;
}
.imagexx {
@ -162,22 +167,31 @@
<div class="page bigbox" id="page2">
<div class="vboxlayout" style="height: 100%;">
<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 class="page bigbox" id="page3">
<div class="vboxlayout" style="height: 100%;">
<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 class="buttons"> Next</div>
<script>
havedatamonth = []
havedatamonth_v = []
for (let i = 1; i <= 12; i += 1) {
if (everymonth_time[i]) {
havedatamonth.push(i)
havedatamonth_v.push(everymonth_time[i] / 3600)
let month = new Date().getMonth() + 1;
for (let i = 0; i < 12; i += 1) {
if (everymonth_time[month]) {
havedatamonth.push(month)
havedatamonth_v.push(everymonth_time[month] / 3600)
}
month -= 1;
if (month == 0) month = 12;
}
var ctx = document.getElementById('everymonth').getContext('2d');
let lastshowmonth = 0;