Skip to content
This repository was archived by the owner on Jan 11, 2020. It is now read-only.

Commit 63a0875

Browse files
anupm12prateek76
authored andcommitted
participant games card fixes #342 (#347)
* Add hover effect to footer icon fixes #344 * Make cards for participant games fixes #342
1 parent 74506f7 commit 63a0875

File tree

4 files changed

+68
-6
lines changed

4 files changed

+68
-6
lines changed

css/main.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,13 @@ input:checked + .slider:before {
634634

635635
.card-link-c {
636636
align-items: left;
637-
}
637+
}
638+
639+
.game-card {
640+
/* max-height: 470px;
641+
min-height: 470px; */
642+
height: 100%;
643+
min-width: 100%;
644+
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.12);
645+
646+
}

data/games.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
22
"games": [
33
{
4-
"developer": "sample",
5-
"imageurl": "sample",
6-
"gamename": "sample",
7-
"github_link": "sample"
4+
"developer": "Anupam shukla",
5+
"imageurl": "assets/img/participants/vikash.jpg",
6+
"gamename": "sample game name",
7+
"github_link": "https://github.com/pal-0123"
8+
},
9+
{
10+
"developer": "Vishnu",
11+
"imageurl": "assets/img/participants/vikash.jpg",
12+
"gamename": "sample game name",
13+
"github_link": "https://github.com/pal-0123"
814
}
915
]
1016
}

index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,21 @@ <h2 class="my-4">Projects</h2>
215215
</nav>
216216
</div>
217217

218-
</div>
219218
<!-- /.container -->
220219

220+
<!-- participant's games -->
221+
<div class="row">
222+
<div class="col-lg-12">
223+
<h2 class="my-4">Participant games</h2>
224+
</div>
225+
</div>
226+
<div class="row" id="games">
227+
<!-- Feeding data from json -->
228+
</div>
229+
</div>
230+
231+
232+
221233

222234
<!---------------------------- list all issues ---------------------------->
223235

js/main.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ $(document).ready(function() {
6060
var mentors;
6161
var participants;
6262
var projects;
63+
var games;
6364

6465
var mentorsJson = "data/mentors.json";
6566
var participantsJson = "data/participants.json";
6667
var projectsJson = "data/projects.json";
68+
var gamesJson = "data/games.json";
6769

6870
$.ajaxSetup({
6971
beforeSend: function(xhr) {
@@ -494,6 +496,39 @@ $(document).ready(function() {
494496
});
495497

496498

499+
// games
500+
$.getJSON(gamesJson, function(data) {
501+
games = data.games;
502+
503+
$.each(games, function(i, game) {
504+
505+
var gameDiv =
506+
"<div class='col-lg-3 col-sm-6 text-center mb-4'>" +
507+
"<div class='card game-card'>" +
508+
"<img class='card-img-top participant-img' src=" +
509+
game.imageurl +
510+
" alt=''>" +
511+
"<div class='card-body'>" +
512+
"<h4 class='card-title'>" +
513+
game.gamename +
514+
"</h4>" +
515+
"<p class='card-text'>by " +
516+
game.developer +
517+
"</p>" +
518+
"</div>" +
519+
"<div class='social-media-links'>" +
520+
"<a href=" +
521+
game.github_link +
522+
"><i class='fab fa-github'></i></a>" +
523+
"</div>" +
524+
"</div>" +
525+
"</div>";
526+
527+
$("#games").append(gameDiv);
528+
});
529+
});
530+
531+
497532
//smooth scrolling
498533
$('a[href^="#"]').on('click', function (e) {
499534
e.preventDefault();

0 commit comments

Comments
 (0)