欢迎来到激动人心的世界杯足球盛宴!在这里,你可以实时关注所有比赛,见证球星们的精彩表现,体验足球带来的激情与感动。我们提供实时的比赛直播,丰富的赛事信息和数据分析,让你不错过任何精彩瞬间。
<script type="text/javascript">
// 这里动态加载比赛数据const matches = [{id: 1,time: "2023-12-18 23:00",team1: {name: "team1",score: 1,},
team2: {name: "team2",score: 2,},status: "进行中",},{id: 2,time: "2023-12-17 19:00",team1: {name: "team3",score: 3,},team2: {name: "team4",score: 1,},status: "已结束",},{id: 3,time: "2023-12-19 22:00",team1: {name: "team5",},team2: {name: "team6",},status: "即将开始",},];const matchList = document.querySelector(".match-list");for (let match of matches) {const matchItem = document.createElement("div");matchItem.classList.add("match-item");const matchItemInfo = document.createElement("div");matchItemInfo.classList.add("match-item-info");const matchItemTime = document.createElement("div");matchItemTime.classList.add("match-item-time");matchItemTime.textContent = match.time;const matchItemTeams = document.createElement("div");matchItemTeams.classList.add("match-item-teams");const matchItemTeam1 = document.createElement("div");matchItemTeam1.classList.add("match-item-team");const matchItemTeam1Img = document.createElement("img");matchItemTeam1Img.setAttribute("src", `/images/team${match.team1.name}.png`);matchItemTeam1Img.setAttribute("alt", match.team1.name);matchItemTeam1.appendChild(matchItemTeam1Img);const matchItemScore1 = document.createElement("div");matchItemScore1.classList.add("match-item-score");matchItemScore1.textContent = match.team1.score || "-";const matchItemTeam2 = document.createElement("div");matchItemTeam2.classList.add("match-item-team");const matchItemTeam2Img = document.createElement("img");matchItemTeam2Img.setAttribute("src", `/images/team${match.team2.name}.png`);matchItemTeam2Img.setAttribute("alt", match.team2.name);matchItemTeam2.appendChild(matchItemTeam2Img);const matchItemScore2 = document.createElement("div");matchItemScore2.classList.add("match-item-score");matchItemScore2.textContent = match.team2.score || "-";matchItemTeams.appendChild(matchItemTeam1);matchItemTeams.appendChild(matchItemScore1);matchItemTeams.appendChild(matchItemScore2);matchItemTeams.appendChild
</script>