{% block stylesheet %}
<style>
.rating-average {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-weight: 600;
font-size: 13px;
line-height: 30px;
color: #333333;
}
@media (min-width: 768px) {
.top-ranking__box {
background-color: #FFFFFF;
width: 100%;
padding: 5% 180px;
}
.ranking-left {
display: inline-block;
float: left;
width: 22%;
}
.ranking-left img {
width: 100%;
}
.ranking-right {
display: inline-block;
float: right;
width: 75%;
}
.row-ranking {
margin: 2% 0;
display: inline-block;
width: 100%;
font-weight: 300;
font-size: 15px;
line-height: 24px;
}
.ranking-comment {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-weight: 600;
font-size: 17px;
line-height: 24px;
color: #333333;
margin: 10px 0;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.ranking-product {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-weight: 600;
font-size: 13px;
line-height: 20.8px;
color: #666666;
}
.ranking-no {
display: inline-block;
background: #fff;
padding: 0 8px;
color: #333333;
border: 1px solid;
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-style: normal;
font-weight: 600;
font-size: 12px;
/* identical to box height, or 100% */
text-align: center;
letter-spacing: 0.01em;
width: 56px;
height: 20px;
line-height: 20px;
}
.ranking-div {
margin-top: 60px;
}
}
@media (max-width: 768px) {
.top-ranking__box {
text-align: left;
padding: 10% 20px;
}
.ranking-left {
display: inline-block;
float: left;
width: 100%;
}
.ranking-left img {
width: 100%;
}
.ranking-right {
display: inline-block;
float: right;
width: 100%;
margin: 10px 0;
}
.row-ranking {
margin: 5% 0;
display: inline-block;
font-weight: 300;
font-size: 15px;
line-height: 24px;
}
.ranking-comment {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-weight: 600;
font-size: 17px;
line-height: 24px;
color: #333333;
margin: 10px 0;
}
.ranking-product {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
font-weight: 600;
font-size: 13px;
line-height: 20.8px;
color: #666666;
}
.ranking-no {
font-family: "Roboto", "ヒラギノ角ゴ ProN", "メイリオ", "sans-serif";
display: inline-block;
background: #fff;
padding: 0 10px;
color: #333333;
border: 1px solid;
font-style: normal;
font-weight: 600;
font-size: 12px;
text-align: center;
width: 56px;
height: 20px;
line-height: 20px;
}
.pc-line {
border-top: 3px solid #2379E7;
position: relative;
top: 0;
width: 40px;
left: 0;
right: 0;
margin: 15px auto 20px;
border-radius: 8px;
}
}
.gold {
background: #A0812B !important;
color: #FFFFFF !important;
border: none;
}
.silver {
background: #AAAAAA !important;
color: #FFFFFF !important;
border: none;
}
.bronze {
background: #7B3808 !important;
color: #FFFFFF !important;
border: none;
}
</style>
<link rel="stylesheet" type="text/css" href="{{ asset('assets/css/star-rating-svg.css', 'user_data') }}">
{% endblock %}
{% block main %}
{% if pagination.totalItemCount > 0 %}
<div class="top-ranking__box">
<h2 class="top-service-title mt-0">人気業者ランキング</h2>
<div class="pc-line"></div>
<div class="ranking-div">
{% for key,Product in pagination %}
<a href="{{ url('product_detail', { id: Product.id }) }}">
<div class="row-ranking">
<div class="ranking-left">
<img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}"
alt="{{ Product.name }}">
</div>
<div class="ranking-right">
<div class="ranking-no {% if (key + 1 == 1) %}gold{% elseif (key + 1 == 2) %}silver{% elseif (key + 1 == 3) %}bronze{% endif %}">
No.{{ key + 1 }}</div>
<div class="ranking-comment">{{ Product.comment }}</div>
<div class="ranking-product">{{ Product.name }}</div>
<div class="d-flex">
<div class="my-rating" data-rating="{{ Product.review }}"></div>
<div class="review-title rating-average p-1 pt-0 pb-0">{{ Product.review|round(1, 'ceil') }}</div>
<div class="review-title rating-average p-1 pt-0 pb-0">({{ Product.count }})</div>
</div>
</div>
</div>
</a>
{% endfor %}
</div>
</div>
{% endif %}
{% endblock %}