diff --git a/OngekiScoreLog/resources/assets/js/userProgress.ts b/OngekiScoreLog/resources/assets/js/userProgress.ts index e1dbfe62..c910f9ff 100644 --- a/OngekiScoreLog/resources/assets/js/userProgress.ts +++ b/OngekiScoreLog/resources/assets/js/userProgress.ts @@ -3,25 +3,30 @@ let images = progress.length; let renderingState = 0; async function convert(element: HTMLElement, index: number) { - let pr: Html2CanvasPromise = html2canvas(element, { - width: 640, - }); - - await pr.then(canvas => { - ++renderingState - let base64 = canvas.toDataURL(); - - $('div#generate_images').append( - $("").attr("src", base64) - ); - - $('.progress').val(renderingState / images * 100); - $(".progress-message").text("画像化中: " + renderingState + "/" + images + "(" + Math.round(renderingState / images * 100) + "%)"); + try { + let pr: Html2CanvasPromise = html2canvas(element, { + width: 640, + }); + + await pr.then(canvas => { + ++renderingState + let base64 = canvas.toDataURL(); + + $('div#generate_images').append( + $("").attr("src", base64) + ); + + $('.progress').val(renderingState / images * 100); + $(".progress-message").text("画像化中: " + renderingState + "/" + images + "(" + Math.round(renderingState / images * 100) + "%)"); + + }).catch((res) => { + // $(".progress-message").text("エラーが発生しました。
" + JSON.stringify(res)); + throw res; + }); + } catch (error) { + // エラったらとりあえず無視 特定環境でたまに起きるらしい + } - }).catch((res) => { - $(".progress-message").text("エラーが発生しました。
" + JSON.stringify(res)); - throw res; - }); } $(function ($) { @@ -43,10 +48,15 @@ $(function ($) { for (let index = 0; index < progress.length; index++) { const element: HTMLElement = 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"); }) }); diff --git a/OngekiScoreLog/resources/views/user_rating.blade.php b/OngekiScoreLog/resources/views/user_rating.blade.php index e0ae6e2c..2fb74e99 100644 --- a/OngekiScoreLog/resources/views/user_rating.blade.php +++ b/OngekiScoreLog/resources/views/user_rating.blade.php @@ -72,7 +72,7 @@

- 到達可能レーティング: {{sprintf("%.2f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 100) / 100)}}
+ 到達可能レーティング: {{sprintf("%.4f",floor($statistics->maxRatingTotal / $statistics->totalRatingCount * 10000) / 10000)}}
現在のスコアデータのうち、最大レート({{$statistics->potentialRatingTop}})の曲でリーセント枠を全て埋めたときの値です。 @foreach ($messages as $message)