Стилизовал artist_list.html

This commit is contained in:
Viner Abubakirov
2026-01-02 15:37:24 +05:00
parent b8fc219f09
commit 67a32d8ac7
3 changed files with 66 additions and 10 deletions

View File

@@ -0,0 +1,41 @@
.artist-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
}
.artist-card {
background: #ffffff;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
transition: transform 0.2s ease, box-shadow 0.2s ease;
text-align: center;
}
.artist-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}
.artist-link {
display: block;
text-decoration: none;
color: inherit;
}
.artist-photo {
width: 100%;
height: 220px;
object-fit: cover;
}
.artist-info {
padding: 12px;
}
.artist-name {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
}

View File

@@ -1,11 +1,27 @@
{% load static %}
<ul>
{% for artist in artists %}
<li>
<a href="{% url 'music:artist_detail' artist.id %}">{{ artist.name }}</a>
</li>
{% empty %}
<li>No artists available.</li>
{% endfor %}
</ul>
<link rel="stylesheet" href="{% static 'css/artist_list.css' %}">
<div class="container">
<div class="artist-container">
{% for artist in artists %}
<div class="artist-card">
<a href="{% url 'music:artist_detail' artist.id %}" class="artist-link">
{% if artist.cover_image %}
<img src="{{ artist.cover_image.url }}" alt="{{ artist.name }}" class="artist-photo">
{% else %}
<img src="{% static 'img/no-artist.png' %}" alt="No photo" class="artist-photo">
{% endif %}
<div class="artist-info">
<h3 class="artist-name">{{ artist.name }}</h3>
</div>
</a>
</div>
{% empty %}
<p>No artists available.</p>
{% endfor %}
</div>
</div>

View File

@@ -4,7 +4,6 @@
{% block content %}
<h1>{{ artist.name }}</h1>
<p>Genre: {{ artist.genre }}</p>
<h2>Albums</h2>
{% include 'components/album_list.html' with albums=artist.albums.all %}
{% endblock %}