Skip to content

Commit d6ad9c0

Browse files
committed
デザインを少し修正
1 parent cb90dd1 commit d6ad9c0

File tree

1 file changed

+51
-8
lines changed

1 file changed

+51
-8
lines changed

resources/views/posts/index.blade.php

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,55 @@
1919
margin: 0 auto;
2020
}
2121
.post {
22+
display: flex;
23+
align-items: center;
2224
background: #fff;
2325
border-radius: 8px;
2426
padding: 15px;
2527
margin-bottom: 15px;
2628
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
2729
}
30+
.post img {
31+
width: 120px;
32+
height: 120px;
33+
object-fit: cover;
34+
border-radius: 8px;
35+
margin-right: 15px;
36+
}
37+
.post-content {
38+
flex: 1;
39+
}
2840
.post h2 {
29-
margin: 0;
41+
margin: 0 0 5px;
3042
color: #007bff;
43+
font-size: 20px;
3144
}
3245
.post p {
3346
margin: 5px 0;
3447
font-size: 16px;
3548
color: #555;
3649
}
37-
.post img {
38-
max-width: 100%;
39-
height: auto;
40-
border-radius: 8px;
41-
margin-bottom: 10px;
50+
/* タグのスタイル */
51+
.tags {
52+
display: flex;
53+
flex-wrap: wrap;
54+
gap: 5px;
55+
margin-top: 5px;
56+
}
57+
.tag {
58+
background-color: #007bff;
59+
color: white;
60+
padding: 3px 8px;
61+
border-radius: 12px;
62+
font-size: 12px;
63+
}
64+
/* ハートマーク */
65+
.likes {
66+
font-size: 18px;
67+
color: red;
68+
display: flex;
69+
align-items: center;
70+
gap: 5px;
4271
}
4372
</style>
4473
</head>
@@ -50,8 +79,22 @@
5079
@if($post->image_url)
5180
<img src="{{ $post->image_url }}" alt="画像">
5281
@endif
53-
<h2>{{ $post->shopname }}</h2>
54-
<p>評価: <strong>{{ number_format($post->avg_rating, 1) }}</strong> ⭐</p>
82+
<div class="post-content">
83+
<h2>{{ $post->shopname }}</h2>
84+
<p>評価: <strong>{{ number_format($post->avg_rating, 1) }}</strong> ⭐</p>
85+
86+
<!-- タグ表示 -->
87+
@if (!empty($post->tags))
88+
<div class="tags">
89+
@foreach ($post->tags as $tag)
90+
<span class="tag">{{ $tag->name }}</span>
91+
@endforeach
92+
</div>
93+
@endif
94+
95+
<!-- いいね(ハート)表示 -->
96+
<p class="likes">❤️</p>
97+
</div>
5598
</div>
5699
@endforeach
57100
</div>

0 commit comments

Comments
 (0)