Intégration images dans Mémory

This commit is contained in:
alexandre-pereira
2015-03-15 19:38:11 +01:00
parent 0cfce7d1f9
commit 4ef3e7e8b3
8 changed files with 74 additions and 97 deletions

View File

@ -2,6 +2,15 @@
@section('page-css')
<link rel="stylesheet" href="/css/memory.css">
<style>
.mg__tile--inside {
overflow: hidden;
}
.mg__tile--inside img {
max-width: 100%;
}
</style>
@endsection
@section('content')
@ -12,85 +21,25 @@
@endsection
@section('page-scripts')
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/js/classList.min.js"></script>
<script src="/js/memory.js"></script>
<script>
(function(){
var myMem = new Memory({
wrapperID : "my-memory-game",
cards : [
{
id : 1,
img: "/pictures/default/monsters-01.png"
},
{
id : 2,
img: "/pictures/default/monsters-02.png"
},
{
id : 3,
img: "/pictures/default/monsters-03.png"
},
{
id : 4,
img: "/pictures/default/monsters-04.png"
},
{
id : 5,
img: "/pictures/default/monsters-05.png"
},
{
id : 6,
img: "/pictures/default/monsters-06.png"
},
{
id : 7,
img: "/pictures/default/monsters-07.png"
},
{
id : 8,
img: "/pictures/default/monsters-08.png"
},
{
id : 9,
img: "/pictures/default/monsters-09.png"
},
{
id : 10,
img: "/pictures/default/monsters-10.png"
},
{
id : 11,
img: "/pictures/default/monsters-11.png"
},
{
id : 12,
img: "/pictures/default/monsters-12.png"
},
{
id : 13,
img: "/pictures/default/monsters-13.png"
},
{
id : 14,
img: "/pictures/default/monsters-14.png"
},
{
id : 15,
img: "/pictures/default/monsters-15.png"
},
{
id : 16,
img: "/pictures/default/monsters-16.png"
}
],
onGameStart : function() { return false; },
onGameEnd : function() { return false; }
});
})();
var cards2 = [];
@foreach($oeuvres as $o)
cards2.push(
{
id : '{{$o->id}}',
img : 'http://www.augustins.org/documents/10180/156407/{{ $o->image}}'}
);
@endforeach
var myMem = new Memory({
wrapperID : "my-memory-game",
cards : cards2,
onGameStart : function() { return false; },
onGameEnd : function() { return false; }
});
</script>
@endsection