Started work on freewall

This commit is contained in:
Yarne Coppens 2024-08-14 15:25:13 +02:00
parent ed066180bc
commit d2f34555de
4 changed files with 1294 additions and 3 deletions

View file

@ -3,3 +3,7 @@
height: 100px; height: 100px;
object-fit: cover; object-fit: cover;
} }
.test{
background-image: url("https://cf.geekdo-images.com/8IO6sl0jN5IylDDRAOK8GQ__original/img/scsSPfbOuxIedcBNjC4EtGb_MEc=/0x0/filters:format(jpeg)/pic8214042.jpg");
}

File diff suppressed because it is too large Load diff

View file

@ -129,12 +129,26 @@ async function loadStatistics(){
let most_expensive_games_statistic = await makeRequest(api_url + '/statistics/most_expensive_games') let most_expensive_games_statistic = await makeRequest(api_url + '/statistics/most_expensive_games')
const rows_to_fill_in = create_boardgame_image_grid_rows(most_expensive_games_statistic.result) console.log(most_expensive_games_statistic.result)
for (row_index in rows_to_fill_in){ for (boardgame_index in most_expensive_games_statistic.result){
mostexpensivegameschart.insertBefore(rows_to_fill_in[row_index], mostexpensivegameschart.firstChild) let boardgame = most_expensive_games_statistic.result[boardgame_index]
let boardgame_cell = document.createElement('div')
boardgame_cell.classList.add('test')
boardgame_cell.style["background-image"] = boardgame.thumbnail_url
mostexpensivegameschart.appendChild(boardgame_cell)
} }
var boardgame_wall = new Freewall("#mostexpensivegameschart")
boardgame_wall.fitWidth()
// const rows_to_fill_in = create_boardgame_image_grid_rows(most_expensive_games_statistic.result)
// for (row_index in rows_to_fill_in){
// mostexpensivegameschart.insertBefore(rows_to_fill_in[row_index], mostexpensivegameschart.firstChild)
// }
$('#mostexpensivegameschartname').text(most_expensive_games_statistic.name) $('#mostexpensivegameschartname').text(most_expensive_games_statistic.name)
} }

View file

@ -12,6 +12,7 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<script src="{{ url_for('static', filename='javascript/jquery/jquery-3.7.1.min.js') }}" defer></script> <script src="{{ url_for('static', filename='javascript/jquery/jquery-3.7.1.min.js') }}" defer></script>
<script src="{{ url_for('static', filename='javascript/freewall/freewall.js') }}" defer></script>
<script src="{{ url_for('static', filename='javascript/datatables/datatables.min.js') }}" defer></script> <script src="{{ url_for('static', filename='javascript/datatables/datatables.min.js') }}" defer></script>
<script src="{{ url_for('static', filename='javascript/chart/chart.js') }}" defer></script> <script src="{{ url_for('static', filename='javascript/chart/chart.js') }}" defer></script>
<script src="{{ url_for('static', filename='javascript/chart/chartjs-plugin-datalabels.min.js') }}" defer></script> <script src="{{ url_for('static', filename='javascript/chart/chartjs-plugin-datalabels.min.js') }}" defer></script>