test contest
This commit is contained in:
@@ -329,11 +329,25 @@
|
||||
const score = document.createElement("p");
|
||||
score.textContent =
|
||||
`你 ${match.attempt.score} 分 · ${match.opponent.score} 分 ${match.opponent.nickname}`;
|
||||
const timeLine = document.createElement("p");
|
||||
timeLine.className = "realtime-time-line";
|
||||
const selfMs = match.attempt.duration_ms || 0;
|
||||
const opponentMs = match.opponent.duration_ms || 0;
|
||||
const selfSec = (selfMs / 1000).toFixed(1);
|
||||
const opponentSec = (opponentMs / 1000).toFixed(1);
|
||||
timeLine.textContent = `你 ${selfSec}s · ${match.opponent.nickname} ${opponentSec}s`;
|
||||
if (match.attempt.score === match.opponent.score && match.result.winner !== "draw") {
|
||||
const faster = selfMs < opponentMs ? "你" : match.opponent.nickname;
|
||||
const tiebreak = document.createElement("small");
|
||||
tiebreak.className = "realtime-tiebreak";
|
||||
tiebreak.textContent = `同分,${faster}更快完成,快者胜`;
|
||||
timeLine.append(tiebreak);
|
||||
}
|
||||
const rating = document.createElement("b");
|
||||
const sign = match.result.rating_delta > 0 ? "+" : "";
|
||||
rating.textContent =
|
||||
`Rating ${sign}${match.result.rating_delta} → ${match.result.rating_after}`;
|
||||
result.append(outcome, score, rating);
|
||||
result.append(outcome, score, timeLine, rating);
|
||||
root.append(result);
|
||||
|
||||
const review = document.createElement("div");
|
||||
|
||||
Reference in New Issue
Block a user