Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.14.1 #787

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 30 additions & 20 deletions OngekiScoreLog/resources/assets/js/userProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ let images = progress.length;
let renderingState = 0;

async function convert(element: HTMLElement, index: number) {
let pr: Html2CanvasPromise<HTMLCanvasElement> = html2canvas(element, {
width: 640,
});

await pr.then(canvas => {
++renderingState
let base64 = canvas.toDataURL();

$('div#generate_images').append(
$("<img>").attr("src", base64)
);

$('.progress').val(renderingState / images * 100);
$(".progress-message").text("画像化中: " + renderingState + "/" + images + "(" + Math.round(renderingState / images * 100) + "%)");
try {
let pr: Html2CanvasPromise<HTMLCanvasElement> = html2canvas(element, {
width: 640,
});

await pr.then(canvas => {
++renderingState
let base64 = canvas.toDataURL();

$('div#generate_images').append(
$("<img>").attr("src", base64)
);

$('.progress').val(renderingState / images * 100);
$(".progress-message").text("画像化中: " + renderingState + "/" + images + "(" + Math.round(renderingState / images * 100) + "%)");

}).catch((res) => {
// $(".progress-message").text("エラーが発生しました。<br>" + JSON.stringify(res));
throw res;
});
} catch (error) {
// エラったらとりあえず無視 特定環境でたまに起きるらしい
}

}).catch((res) => {
$(".progress-message").text("エラーが発生しました。<br>" + JSON.stringify(res));
throw res;
});
}

$(function ($) {
Expand All @@ -43,10 +48,15 @@ $(function ($) {

for (let index = 0; index < progress.length; index++) {
const element: HTMLElement = <HTMLScriptElement>progress[index];

await convert(element, index);
}

$('.progress').removeClass("is-progress").removeAttr("value").removeAttr("max");
// 固定解除
$('html').css('overflow', 'visible');
$('body').css('overflow', 'visible');
document.addEventListener('touchmove', function (e) { /* */ }, { passive: false });

$(".progress-message").text("画像化完了! (" + renderingState + "枚)");
// $('.progress').removeClass("is-progress").removeAttr("value").removeAttr("max");
})
});
2 changes: 1 addition & 1 deletion OngekiScoreLog/resources/views/user_rating.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</table>
</div>
<p>
<span class="subtitle is-5">到達可能レーティング: {{sprintf("%.2f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 100) / 100)}}</span><br>
<span class="subtitle is-5">到達可能レーティング: {{sprintf("%.4f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 10000) / 10000)}}</span><br>
現在のスコアデータのうち、最大レート({{$statistics->potentialRatingTop}})の曲でリーセント枠を全て埋めたときの値です。
@foreach ($messages as $message)
<p>
Expand Down
Loading