Web/scripts/projects.js
2018-07-24 22:45:53 +02:00

36 lines
1.4 KiB
JavaScript

const projects = [{
'name': 'Sudoku',
'desc': 'A simple game of sudoku. Fill in the board with numbers one through nine, making sure each row, column and three by three field only ever has one of the same number. A board is randomly generated for you every time you refresh the page. Use the scroll wheel to input numbers into a selected field.',
'links': {
'Play it here': 'https://ellpeck.de/sudoku',
'Check the source': 'https://github.com/Ellpeck/Sudoku'
}
},
{
'name': 'Memory',
'desc': 'A game of memory. Turn over fields to see the numbers they have. Try to combine all of the same-numbered fields to uncover the board!',
'links': {
'Play it here': 'https://ellpeck.de/memory',
'Check the source': 'https://github.com/Ellpeck/Memory'
}
}
];
let p = '';
for (project of projects) {
p += '<div class="card bg-light project">';
p += '<div class="card-body">';
p += '<img class="project-image" src="res/projects/' + project['name'].toLowerCase() + '.png" alt="">';
p += '<h5 class="card-title">' + project['name'] + '</h5>';
p += '<p class="card-text">' + project['desc'] + '</p>';
let links = project['links'];
for (let name in links) {
p += '<a href="' + links[name] + '" class="card-link">' + name + '</a>';
}
p += '</div>';
p += '</div>';
}
$('#project-list').html(p);