Skip to content

Commit

Permalink
Merge pull request #5 from abrahamfast/dev
Browse files Browse the repository at this point in the history
Fetch Game Information from IGTV
  • Loading branch information
abrahamfast authored Aug 6, 2020
2 parents 1945cdb + 15a7719 commit 16fe8de
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

IGDB_KEY=""
4 changes: 4 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],

'igdb' => [
'user-key' => env('IGDB_KEY')
],

];
156 changes: 70 additions & 86 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,131 +5,115 @@
<div class="container mx-auto px-4">
<h2 class="text-blue-500 uppercase tracking-wide font-semibold">Popular GAMES</h2>
<div class="popular-games text-sm grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 xl:grid-6 gap-12 gap-12 border-t border-gray-800 pb-16">
@foreach($popularGames as $game)
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
<img src="{{ str_replace('thumb', 'cover_big', $game['cover']['url']) }}" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
</div>
</div>
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
</div>
</div>
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
</div>
</div>
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
</div>
</div>
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
@isset($game['rating'])
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
{{ round($game['rating']) . '%'}}
</div>
</div>
</div>
@endisset
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
<div class="game mt-8">
<div class="relative inline-block">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">{{ $game['name'] }}</a>
<div class="text-gray-400 mt-1">
@foreach($game['platforms'] as $platform)
@if(array_key_exists('abbreviation', $platform))
{{ $platform['abbreviation'] }}
@endif
@endforeach
</div>
</div>
<a href="#" class="block text-base font-semibold leading-tight hover:text-gray-400 mt-8">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation4</div>
</div>
</div>
@endforeach

</div> <!-- end popularity game -->

<div class="flex flex-col lg:flex-row my-10">
<div class="recently-reviewed lg:w-3/4 mr-0 lg:mr-32">
<h2 class="text-blue-500 uppercase tracking-wide font-semibold">Recently Reviewed</h2>
<div class="recently-reviewd-container space-y-12 mt-8">
@foreach($recentlyReviewed as $game)
<div class="game bg-gray-800 rounded-lg shadow-md flex px-6 py-6">
<div class="relative inline-none">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="hover:opacity-75 transition ease-in-out duration-150">
<img src="{{ str_replace('thumb', 'cover_big', $game['cover']['url']) }}"
alt="game cover"
class="hover:opacity-75 transition ease-in-out duration-150"
>
</a>
@isset($game['rating'])
<div class="absolute bottom-0 right-0 w-16 h-16 bg-gray-800 rounded-full progress-list-item">
<div class="font-semibold text-xs flex justify-center items-center h-full">
80%
{{ round($game['rating']) . '%'}}
</div>
</div>
@endisset
</div>
<div class="ml-12">
<a href="#" class="block text-lg font-semibold leading-tight hover:text-gray-400 mt-4">Final Fantasy & remak</a>
<div class="text-gray-400 mt-1">Playstation 4</div>
<a href="#" class="block text-lg font-semibold leading-tight hover:text-gray-400 mt-4">{{ $game['name'] }}</a>
<div class="text-gray-400 mt-1">
@foreach($game['platforms'] as $platform)
@if(array_key_exists('abbreviation', $platform))
{{ $platform['abbreviation'] }}
@endif
@endforeach
</div>
<p class="mt-6 text-gray-400 hidden lg:block">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quibusdam dignissimos repellendus sit voluptatum, aliquam praesentium amet cupiditate, quis id perferendis iusto libero eligendi repellat, facere provident placeat. Repellat numquam nobis voluptatem quasi vel mollitia corrupti a, illum incidunt eaque pariatur.
{{ $game['summary'] }}
</p>
</div>
</div>
@endforeach
</div>
</div>

<div class="most-anticipated lg:w-1/4">
<h2 class="text-blue-500 uppercase tracking-wide font-semibold">Most Anticipated</h2>
<div class="most-anticipated-container space-y-10 mt-8">
@foreach($mostAnticipated as $game)
<div class="game flex">
<a href="#">
<img src="/img/gg1.jpg" alt="game cover" class="w-16 hover:opacity-75 transition ease-in-out duration-150">
<img src="{{ $game['cover']['url'] }}" alt="game cover" class="w-16 hover:opacity-75 transition ease-in-out duration-150">
</a>
<div class="ml-4">
<a href="" class="hover:text-gray-300">Cyberpunk 2077</a>
<div class="text-gray-400 text-sm 1">Sept 16, 2020</div>
<a href="" class="hover:text-gray-300">{{ $game['name'] }}</a>
<div class="text-gray-400 text-sm 1">{{ Carbon\Carbon::parse($game['first_release_date'])->format("M d, y") }}</div>
</div>
</div>
@endforeach
</div>
</div>


<h2 class="text-blue-500 uppercase tracking-wide font-semibold mt-12">Comming Soon</h2>
<div class="most-anticipated-container space-y-10 mt-8">
@foreach($commingSoon as $game)
<div class="game flex">
<a href="#">
@isset($game['cover'])
<img src="{{ $game['cover']['url'] }}"
alt="game cover"
class="w-16 hover:opacity-75 transition ease-in-out duration-150"
>
@else
<img src="/img/default.jpg"
alt="game cover"
class="w-16 hover:opacity-75 transition ease-in-out duration-150"
>
@endisset
</a>
<div class="ml-4">
<a href="" class="hover:text-gray-300">{{ $game['name'] }}</a>
<div class="text-gray-400 text-sm 1">{{ Carbon\Carbon::parse($game['first_release_date'])->format("M d, y") }}</div>
</div>
</div>
@endforeach
</div>
</div> <!-- end comming soon -->

</div>
</div>
@endsection
11 changes: 0 additions & 11 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
4 changes: 1 addition & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
return view('index');
});
Route::get('/', 'GameController@index');


Route::get('/show', function(){
Expand Down

0 comments on commit 16fe8de

Please sign in to comment.