Pretties up the song and motif pages.
This commit is contained in:
parent
03df74d985
commit
5a2ff83bea
8
app.py
8
app.py
@ -259,16 +259,16 @@ def songpage(id):
|
|||||||
|
|
||||||
# query song name
|
# query song name
|
||||||
|
|
||||||
name, = db.execute('''
|
song_info = db.execute('''
|
||||||
select
|
select
|
||||||
name
|
name, name_jp
|
||||||
from
|
from
|
||||||
song
|
song
|
||||||
where
|
where
|
||||||
id = ?
|
id = ?
|
||||||
''',
|
''',
|
||||||
(id,)
|
(id,)
|
||||||
).fetchone()
|
).fetchall()
|
||||||
|
|
||||||
# query album info
|
# query album info
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ def songpage(id):
|
|||||||
).fetchall()
|
).fetchall()
|
||||||
|
|
||||||
return flask.render_template('song.html',
|
return flask.render_template('song.html',
|
||||||
name=name,
|
song_info=song_info,
|
||||||
id=id,
|
id=id,
|
||||||
album_info=album_info,
|
album_info=album_info,
|
||||||
clip_info=clip_info,
|
clip_info=clip_info,
|
||||||
|
|||||||
BIN
static/motificon.png
Normal file
BIN
static/motificon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/songbook.png
Normal file
BIN
static/songbook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
static/songicon.png
Normal file
BIN
static/songicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 580 B |
148
static/style.css
148
static/style.css
@ -38,22 +38,47 @@ footer{
|
|||||||
|
|
||||||
.top-buttons{
|
.top-buttons{
|
||||||
display: flex;
|
display: flex;
|
||||||
padding-left: 0;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 2rem;
|
padding: 1rem;
|
||||||
column-gap: 1rem;
|
column-gap: 1rem;
|
||||||
|
max-height: fit-content;
|
||||||
|
|
||||||
}
|
}
|
||||||
.top-buttons li{
|
.top-buttons a{
|
||||||
flex: auto;
|
flex: auto;
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-buttons a:nth-child(2){
|
||||||
|
flex: none;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-buttons a::before{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
border-style: outset;
|
border-style: outset;
|
||||||
border-color: var(--light-border);
|
border-color: var(--light-border);
|
||||||
list-style: none;
|
border-radius: 1rem;
|
||||||
text-align: center;
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-buttons li:nth-child(2){
|
.top-buttons li{
|
||||||
flex: none;
|
vertical-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-buttons img{
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-bar{
|
.search-bar{
|
||||||
@ -129,6 +154,10 @@ h2{
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h3{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
a{
|
a{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@ -136,7 +165,6 @@ a{
|
|||||||
.album-list{
|
.album-list{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-list{
|
.category-list{
|
||||||
@ -144,14 +172,13 @@ a{
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
flex-basis: 51%;
|
flex-basis: 51%;
|
||||||
row-gap: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.album-info{
|
.album-info{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
border-style: solid;
|
/* border-style: solid;
|
||||||
border-color: var(--light-box);
|
border-top: 0; border-left: 0; border-right: 0; */
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
background: var(--light-box);
|
background: var(--light-box);
|
||||||
@ -165,13 +192,15 @@ a{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sort-box.album{
|
.sort-box.album{
|
||||||
gap: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sort-box.category{
|
.sort-box.category{
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-left: auto; margin-right: auto;
|
margin-left: auto; margin-right: auto;
|
||||||
width: 24rem;
|
width: 24rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sort-box.category h2{
|
.sort-box.category h2{
|
||||||
@ -186,17 +215,19 @@ a{
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
min-height: 1.5rem;
|
min-height: 1.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
border-radius: 1rem 0% 0% 1rem;
|
||||||
|
background: linear-gradient(90deg, var(--light-box) 90%, rgba(255, 255, 255, 0) 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-box.song{
|
.entry-box.song{
|
||||||
margin-top: 0.5rem; margin-bottom: 0.5rem; margin-left: 4rem; margin-right: 1rem;
|
margin-top: 0.5rem; margin-bottom: 0.5rem; margin-left: 1rem; margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-box.motif{
|
.entry-box.motif{
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
background: var(--light-box);
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-box.song li{
|
.entry-box.song li{
|
||||||
@ -215,12 +246,9 @@ a{
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-box.song.full{
|
|
||||||
background: var(--light-box);
|
|
||||||
}
|
|
||||||
|
|
||||||
.entry-box.song.empty{
|
.entry-box.song.empty{
|
||||||
margin-top: 0; margin-bottom: 0;
|
margin-top: 0; margin-bottom: 0;
|
||||||
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-box.song.full li span{
|
.entry-box.song.full li span{
|
||||||
@ -239,7 +267,7 @@ a{
|
|||||||
|
|
||||||
.entry-box.motif::before{
|
.entry-box.motif::before{
|
||||||
content: "b";
|
content: "b";
|
||||||
min-width: 2rem;
|
min-width: 4rem;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
@ -252,11 +280,17 @@ a{
|
|||||||
color: black;
|
color: black;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
display: inline;
|
display: inline;
|
||||||
border-left-style: solid;
|
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-left: auto;
|
|
||||||
min-width: 2rem;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
min-width: 1.5rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-icon{
|
||||||
|
width: 1rem; height: 1rem;
|
||||||
|
margin-left: auto; margin-right: 0.2rem;
|
||||||
|
display: block;
|
||||||
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sort-box.album label{
|
.sort-box.album label{
|
||||||
@ -277,22 +311,36 @@ a{
|
|||||||
|
|
||||||
.title-box{
|
.title-box{
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
margin-bottom: 0px;
|
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: var(--light-box);
|
border-color: var(--light-box);
|
||||||
background: var(--light-box);
|
background: var(--light-box);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-box img{
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-box h1{
|
.title-box h1{
|
||||||
padding: 0;
|
margin-left: .5rem;
|
||||||
|
max-width: 65%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-jp{
|
||||||
|
margin-left: 2rem;
|
||||||
|
max-width: 65%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-album{
|
||||||
|
margin-left: auto;
|
||||||
|
min-width: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.track-info{
|
.track-info{
|
||||||
margin-top: 1rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
row-gap: 1rem;
|
row-gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,49 +352,57 @@ a{
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 23rem;
|
width: 23rem;
|
||||||
margin-left: 2rem; margin-right: auto;
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.songpage-artist ul{
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.songpage-artist h2{
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.songpage-album{
|
.songpage-album{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 23rem;
|
width: 23rem;
|
||||||
margin-left: 2rem; margin-right: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.songpage-motifs{
|
.songpage-album ul{
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.songpage-album h2{
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entrypage-connections{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.songpage-motifs h2{
|
.entrypage-connections h2{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.songpage-clip{
|
.entrypage-clip{
|
||||||
margin-top: 1rem;
|
margin-bottom: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap-reverse;
|
flex-wrap: wrap-reverse;
|
||||||
column-gap: 2rem;
|
column-gap: 2rem;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.songpage-clip audio{
|
.clip-pointer{
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.songpage-clip::before{
|
|
||||||
/* content: "";
|
|
||||||
visibility: hidden;
|
|
||||||
width: 15%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.motif-pointer{
|
|
||||||
width: 12rem;
|
width: 12rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,21 +3,23 @@
|
|||||||
{% block title %}{{ name }}{% endblock %}
|
{% block title %}{{ name }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1> Motif: {{ name }} </h1>
|
<hgroup class="title-box">
|
||||||
|
<h1> <img src="/static/motificon.png" alt="Motif Icon" class="title-icon"/> {{ name }} </h1>
|
||||||
|
</hgroup>
|
||||||
<!-- Clips -->
|
<!-- Clips -->
|
||||||
|
|
||||||
<p>Clips: </p>
|
<div class="entrypage-connections">
|
||||||
<ul>
|
<h2>Songs Featured:</h2>
|
||||||
{% for song_id, motif_id, song in clip_info %}
|
<ul>
|
||||||
<li>
|
{% for song_id, motif_id, song in clip_info %}
|
||||||
<audio
|
<li class="entrypage-clip">
|
||||||
controls
|
<audio
|
||||||
src = "{{ url_for('static', filename='clip/') }}{{ '%04d' % song_id }}-{{ '%03d' % motif_id }}.flac" type="audio/flac">
|
controls
|
||||||
</audio>
|
src = "{{ url_for('static', filename='clip/') }}{{ '%04d' % song_id }}-{{ '%03d' % motif_id }}.flac" type="audio/flac">
|
||||||
<a href="/song/{{ song_id }}">{{ song }}</a>
|
</audio>
|
||||||
</li>
|
<span class="clip-pointer"><a href="/song/{{ song_id }}">{{ song }}</a></span>
|
||||||
{% endfor %}
|
</li>
|
||||||
</ul>
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -12,7 +12,8 @@
|
|||||||
<li>
|
<li>
|
||||||
<span class="motif-name">{{ motif }}</span>
|
<span class="motif-name">{{ motif }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% if count %}<span class="clip-count">x{{ count }}</span>{% endif %}
|
<img src="/static/songicon.png" alt="Song Icon" class="count-icon"/>
|
||||||
|
{% if count %}<span class="clip-count">x {{ count }}</span>{% endif %}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
@ -27,7 +28,8 @@
|
|||||||
<li>
|
<li>
|
||||||
<span class="motif-name">{{ motif }}</span>
|
<span class="motif-name">{{ motif }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% if count %}<span class="clip-count"> x{{ count }} {% endif %}</span>
|
<img src="/static/songicon.png" alt="Song Icon" class="count-icon"/>
|
||||||
|
{% if count %}<span class="clip-count">x {{ count }} {% endif %}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<header>
|
<header>
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="top-buttons">
|
<ul class="top-buttons">
|
||||||
<li><a href="{{ url_for('songindex') }}">Songs</a></li>
|
<a href="{{ url_for('songindex') }}" class="song-button"><li><img src="/static/songicon.png" alt="Song Index" /></li></a>
|
||||||
<li><a href="{{ url_for('homepage') }}">Home</a></li>
|
<a href="{{ url_for('homepage') }}" class="home-button"><li><img src="/static/songbook.png" alt="Home" /></li></a>
|
||||||
<li><a href="{{ url_for('motifindex') }}">Motifs</a></li>
|
<a href="{{ url_for('motifindex') }}" class="motif-button"><li><img src="/static/motificon.png" alt="Motif Index" /></li></a>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,21 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block title %}{{ name }}{% endblock %}
|
{% block title %}
|
||||||
|
{% for name, _ in song_info %}{{ name }}{% endfor %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="title-box">
|
<hgroup class="title-box">
|
||||||
<h1>{{ name }}</h1>
|
<img src="/static/songicon.png" alt="Song Icon" class="title-icon"/>
|
||||||
{% for track, _, _, album_code in album_info %}
|
{% for name, name_jp in song_info %}
|
||||||
{{ album_code }}{% if not loop.last %}, {% endif %}
|
<h1>{{ name }}</h1>
|
||||||
|
{% if name_jp %}
|
||||||
|
<h2 class="title-jp">{{name_jp}}</h2>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
{% for track, _, _, album_code in album_info %}
|
||||||
|
<h3 class="title-album">{{ album_code }}{% if not loop.last %}, {% endif %}</h3>
|
||||||
|
{% endfor %}
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
<!-- Artist info -->
|
<!-- Artist info -->
|
||||||
|
|
||||||
@ -16,7 +24,7 @@
|
|||||||
<h2 >Artist: </h2>
|
<h2 >Artist: </h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for name, name_rm, credit in artist_info %}
|
{% for name, name_rm, credit in artist_info %}
|
||||||
<li>{{ name_rm }} ({{ name }}): {{ credit }}</li>
|
<li>{{ credit }}: {% if name_rm %}{{ name_rm }} - {% endif %}{{ name }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -27,21 +35,21 @@
|
|||||||
<h2>Album: </h2>
|
<h2>Album: </h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for album_id, track, album_name, album_code in album_info %}
|
{% for album_id, track, album_name, album_code in album_info %}
|
||||||
<li><a href="{{ url_for('albumpage', id=album_id) }}">{{ album_name }}</a> #{{ track }}</li>
|
<li><a href="{{ url_for('albumpage', id=album_id) }}">{{ album_name }}</a> - #{{ track }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- Motifs -->
|
<!-- Motifs -->
|
||||||
<div class="songpage-motifs">
|
<div class="entrypage-connections">
|
||||||
<h2>Motifs Used: </h2>
|
<h2>Motifs Featured: </h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for song_id, motif_id, motif in clip_info %}
|
{% for song_id, motif_id, motif in clip_info %}
|
||||||
<li class="songpage-clip">
|
<li class="entrypage-clip">
|
||||||
<audio
|
<audio
|
||||||
controls
|
controls
|
||||||
src = "{{ url_for('static', filename='clip/') }}{{ '%04d' % song_id }}-{{ '%03d' % motif_id }}.flac" type="audio/flac">
|
src = "{{ url_for('static', filename='clip/') }}{{ '%04d' % song_id }}-{{ '%03d' % motif_id }}.flac" type="audio/flac">
|
||||||
</audio>
|
</audio>
|
||||||
<span class="motif-pointer"><a href = "{{ url_for('motifpage', id=motif_id) }}"> {{ motif }} </a></span>
|
<span class="clip-pointer"><a href = "{{ url_for('motifpage', id=motif_id) }}"> {{ motif }} </a></span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -10,10 +10,9 @@
|
|||||||
<div class="sort-box album">
|
<div class="sort-box album">
|
||||||
<input type="radio" name="album" id="{{ code }}" class="collapse">
|
<input type="radio" name="album" id="{{ code }}" class="collapse">
|
||||||
<label for="{{ code }}" class="album-info">
|
<label for="{{ code }}" class="album-info">
|
||||||
<h2>{{ name }}</h2>
|
<h2>{{ name }}</h2>
|
||||||
<span class="code">{{ code }}</span>
|
<span class="code">{{ code }}</span>
|
||||||
<span class="date">Released: {{ date }}</span>
|
<span class="date">{{ date }}</span>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
<ul class="sort-list">
|
<ul class="sort-list">
|
||||||
{% for song_id, album, track, name, name_jp, count in song_info if album_id == album %}
|
{% for song_id, album, track, name, name_jp, count in song_info if album_id == album %}
|
||||||
@ -24,7 +23,8 @@
|
|||||||
<span class="track-name">{{ name }}</span>
|
<span class="track-name">{{ name }}</span>
|
||||||
{% if name_jp %}<span class="track-name-jp">{{ name_jp }}</span>{% endif %}
|
{% if name_jp %}<span class="track-name-jp">{{ name_jp }}</span>{% endif %}
|
||||||
</li>
|
</li>
|
||||||
<span class="clip-count"> x{{ count }} </span>
|
<img src="/static/motificon.png" alt="Motif Icon" class="count-icon"/>
|
||||||
|
<span class="clip-count">x {{ count }} </span>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ url_for('songpage', id=song_id) }}" class="entry-box song empty">
|
<a href="{{ url_for('songpage', id=song_id) }}" class="entry-box song empty">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user