Skip to content

Commit

Permalink
Make artist page button-plot transitions better
Browse files Browse the repository at this point in the history
  • Loading branch information
fsktom committed Oct 13, 2024
1 parent 11f9ff0 commit be71f70
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions endsong_web/templates/artist.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,25 @@ <h2 class="self-center text-xl font-semibold">General info</h2>
<section class="flex w-2/3 flex-col gap-4">
<article class="flex flex-col">
<button
id="absolute-plot-button"
class="self-center"
type="submit"
hx-target="#absolute-plot"
hx-target="this"
hx-swap="outerHTML"
hx-get="/artist/{{ artist.name }}/absolute_plot"
>
Show absolute plot
</button>
<figure id="absolute-plot"></figure>
</article>
<article class="flex flex-col">
<button
id="relative-plot-button"
class="self-center"
type="submit"
hx-target="#relative-plot"
hx-target="this"
hx-swap="outerHTML"
hx-get="/artist/{{ artist.name }}/relative_plot"
>
Show relative plot
</button>
<figure id="relative-plot"></figure>
</article>
</section>
<script>
// hide "show x plot" buttons on click
document
.getElementById("absolute-plot-button")
.addEventListener("click", function () {
this.style.display = "none";
});
document
.getElementById("relative-plot-button")
.addEventListener("click", function () {
this.style.display = "none";
});
</script>
{% endblock %}

0 comments on commit be71f70

Please sign in to comment.