summaryrefslogtreecommitdiff
path: root/resources/views/anime.blade.php
blob: 0e5596b808e09006e978d8651f7cb7ba036a980c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@extends('layouts.app')

@section('content')
<div class="container" id="index">
	<h1>{{ $anime->title_pref }}</h1>

	<div class="row">
		<div class="col-sm">
			<img src="{{ $anime->image_url }}" class="img-fluid">	
		</div>
		<div class="col-sm">
			{!! str_replace("%%br%%", "<br>", e($anime->synopsis)) !!}
			<br>
			<br>
			<strong>Score: </strong> {{ $anime["basic_data"]->score }}
			<br>
			<strong>Rank: </strong> {{ $anime["basic_data"]->rank }}
			<br>
			<strong>Popularity: </strong> {{ $anime["basic_data"]->popularity }}
			<br>
			<strong>Members: </strong> {{ $anime["basic_data"]->members }}
		</div>
	</div>

	<p>
	<h2>Score History</h2>
	<canvas id="score_chart" height=""></canvas>
	<!--
	{{ $anime }}
	-->
	</p>
</div>
<script>
var ctx = document.getElementById('score_chart');
var myChart = new Chart(ctx, {
    type: 'line',
    data: {
        labels: {!! json_encode($anime["score_label"]) !!},
        datasets: [{
            label: 'Average Score on MAL',
            data: {{ json_encode($anime["score"]) }},
	    file: 'false',	
	    borderColor: 'rgb(75, 192, 192)',
	    lineTension: 0.01,
	    backgroundColor: 'white',
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: false
                }
            }]
        }
    }
});

</script>
@endsection