Стилизовал artist_list.html
This commit is contained in:
41
music_storage/static/css/artist_list.css
Normal file
41
music_storage/static/css/artist_list.css
Normal 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;
|
||||||
|
}
|
||||||
@@ -1,11 +1,27 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
<ul>
|
<link rel="stylesheet" href="{% static 'css/artist_list.css' %}">
|
||||||
{% for artist in artists %}
|
|
||||||
<li>
|
<div class="container">
|
||||||
<a href="{% url 'music:artist_detail' artist.id %}">{{ artist.name }}</a>
|
<div class="artist-container">
|
||||||
</li>
|
{% for artist in artists %}
|
||||||
{% empty %}
|
<div class="artist-card">
|
||||||
<li>No artists available.</li>
|
<a href="{% url 'music:artist_detail' artist.id %}" class="artist-link">
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
{% 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>
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{ artist.name }}</h1>
|
<h1>{{ artist.name }}</h1>
|
||||||
<p>Genre: {{ artist.genre }}</p>
|
|
||||||
<h2>Albums</h2>
|
<h2>Albums</h2>
|
||||||
{% include 'components/album_list.html' with albums=artist.albums.all %}
|
{% include 'components/album_list.html' with albums=artist.albums.all %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user