parent
858dac4a12
commit
46c5cbfe49
@ -0,0 +1,18 @@ |
|||||||
|
html, |
||||||
|
body { |
||||||
|
background: linear-gradient( |
||||||
|
20deg, |
||||||
|
#1b223a 0 20%, |
||||||
|
#e84038 20% 40%, |
||||||
|
#f39200 40% 60%, |
||||||
|
#ffd300 60% 80%, |
||||||
|
#1b223a 80% 100% |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
.bubble { |
||||||
|
padding: 20px; |
||||||
|
background-color: white; |
||||||
|
border-radius: 24px; |
||||||
|
/* box-shadow: 10px 10px lightblue; */ |
||||||
|
} |
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,152 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
{% load static %} |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
||||||
|
<link rel="stylesheet" href="{% static 'tournaments/css/foundation.min.css' %}" /> |
||||||
|
<link rel="stylesheet" href="{% static 'tournaments/css/style.css' %}" /> |
||||||
|
<link rel="stylesheet" href="{% static 'tournaments/css/broadcast.css' %}" /> |
||||||
|
|
||||||
|
<link rel="icon" type="image/png" href="{% static 'tournaments/images/favicon.png' %}" /> |
||||||
|
|
||||||
|
<title>Padel</title> |
||||||
|
|
||||||
|
<script src="{% static 'tournaments/js/alpine.min.js' %}"></script> |
||||||
|
|
||||||
|
</head> |
||||||
|
|
||||||
|
<body x-data="{ |
||||||
|
paginatedMatches: null, |
||||||
|
active: 1, |
||||||
|
retrieveMatches() { |
||||||
|
fetch('/tournament/{{ tournament.id }}/matches-json/') |
||||||
|
.then(res => res.json()) |
||||||
|
.then((data) => { |
||||||
|
this.paginatedMatches = this.paginate(data, 8) |
||||||
|
}) |
||||||
|
}, |
||||||
|
paginate(array, pageSize) { |
||||||
|
let paginatedArray = []; |
||||||
|
for (let i = 0; i < array.length; i += pageSize) { |
||||||
|
paginatedArray.push(array.slice(i, i + pageSize)); |
||||||
|
} |
||||||
|
return paginatedArray; |
||||||
|
}, |
||||||
|
loop() { |
||||||
|
this.retrieveMatches() |
||||||
|
setInterval(() => { |
||||||
|
this.retrieveMatches() |
||||||
|
this.active = this.active === this.paginatedMatches.length ? 1 : this.active+1 |
||||||
|
}, 3000) |
||||||
|
} |
||||||
|
|
||||||
|
}" x-init="loop()"> |
||||||
|
|
||||||
|
<div class="wrapper"> |
||||||
|
<main class="page-body"> |
||||||
|
<div class="container"> |
||||||
|
|
||||||
|
<div class="grid-x"> |
||||||
|
<div class="cell medium-6 large-6 topblock my-block"> |
||||||
|
<div class="bubble"> |
||||||
|
<img |
||||||
|
src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" |
||||||
|
class="logo inline" |
||||||
|
/> |
||||||
|
<div class="inline"> |
||||||
|
<h1 class="club">4Padel Toulouse</h1> |
||||||
|
<h1 class="event">Matchs</h1> |
||||||
|
<!-- <span>Propulsé par Padel Club</span> --> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="grid-x padding-bottom"> |
||||||
|
|
||||||
|
<template x-for="i in paginatedMatches.length" > |
||||||
|
<template x-for="match in paginatedMatches[i-1]" > |
||||||
|
|
||||||
|
<div class="cell medium-6 large-3 my-block" x-show="active === i"> |
||||||
|
<div class="bubble"> |
||||||
|
|
||||||
|
<div class="flex-row"> |
||||||
|
<label class="left-label matchtitle"><span x-text="match.title"></span></label> |
||||||
|
<label class="right-label info"><span x-text="match.date"></span></label> |
||||||
|
</div> |
||||||
|
|
||||||
|
<template x-for="i in match.teams.length"> |
||||||
|
|
||||||
|
<div> |
||||||
|
<div class="table-row-3-colums padding-bottom-small"> |
||||||
|
|
||||||
|
<template x-if="match.teams[i-1].image"> |
||||||
|
<div class="table-cell"> |
||||||
|
<img src="{% static 'tournaments/images/pc_icon_round_200.png' %}" class="team_image" /> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<div class="table-cell table-cell-large horizontal-padding"> |
||||||
|
<template x-for="name in match.teams[i-1].names"> |
||||||
|
|
||||||
|
<div class="semibold" x-data="{ |
||||||
|
showName(name, team) { |
||||||
|
let html = `<span class='` |
||||||
|
if (team.is_winner) html += `winner` |
||||||
|
html += `'>` |
||||||
|
html += name |
||||||
|
html += `</span>` |
||||||
|
return html |
||||||
|
}, |
||||||
|
}" x-html="showName(name, match.teams[i-1])"> |
||||||
|
</div> |
||||||
|
|
||||||
|
</template> |
||||||
|
</div> |
||||||
|
<div class="table-cell alignright"> |
||||||
|
<template x-for="score in match.teams[i-1].scores"> |
||||||
|
|
||||||
|
<span class="score ws" x-data="{ |
||||||
|
showScore(score, team) { |
||||||
|
let html = `<span class='` |
||||||
|
if (team.is_winner) html += `winner` |
||||||
|
html += `'>` |
||||||
|
html += score |
||||||
|
html += `</span>` |
||||||
|
return html |
||||||
|
}, |
||||||
|
}" x-html="showScore(score, match.teams[i-1])"> |
||||||
|
</span> |
||||||
|
|
||||||
|
<!-- <span class="score ws" x-text="score"></span> --> |
||||||
|
</template> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
|
||||||
|
<div x-show="i === 1"> |
||||||
|
<div class="bottom-border"></div> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<div class="top-margin flex-row"> |
||||||
|
<label class="left-label minor-info"><span x-text="match.duration"></span></label> |
||||||
|
<label class="right-label minor-info"><span x-text="match.court"></span></label> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
</template> |
||||||
|
</template> |
||||||
|
|
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</main> |
||||||
|
</div> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
||||||
Loading…
Reference in new issue