mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 15:43:53 +08:00
.
This commit is contained in:
parent
f77bf6c3ec
commit
20a1fc0556
@ -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):
|
||||||
|
@ -13,13 +13,18 @@
|
|||||||
.page {
|
.page {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vboxlayout {
|
.vboxlayout {
|
||||||
display: flex; flex-direction: column;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hboxlayout {
|
.hboxlayout {
|
||||||
display: flex; flex-direction: row;
|
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user