Corrigindo aparência dos projetos no MMPSearch e interligando com o MMPCreator
This commit is contained in:
1 parent
1b12e5802d
commit
52d1d90fc1
4 files changed
+152
-75
No files matched your search
+95
-75
@@ -7,6 +7,7 @@ title: "{{ page.file }}"
|
||||
{% include sidebar.html %}
|
||||
<main class="content">
|
||||
<div class="container">
|
||||
<br>
|
||||
|
||||
<h1 class="title is-3 mb-4"><code>{{ page.file }}</h1></code>
|
||||
|
||||
@@ -51,8 +52,10 @@ title: "{{ page.file }}"
|
||||
</audio>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<h2 class="title is-5"><code>🏷️ Tags</code></h2>
|
||||
<details>
|
||||
<summary class="title is-5" style="cursor: pointer; padding-left: 0;">
|
||||
<code>🏷️ Tags</code>
|
||||
</summary>
|
||||
{% for categoria in page.tags %}
|
||||
{% if categoria[1].size > 0 %}
|
||||
<div class="mb-4">
|
||||
@@ -80,86 +83,106 @@ title: "{{ page.file }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
</details>
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
{% if page.tracks and page.tracks.size > 0 %}
|
||||
<section class="instruments-section">
|
||||
<h2 class="title is-5"><code>🎚️ Instrumentos</h2></code>
|
||||
<div class="content">
|
||||
<ul style="list-style: none; padding-left: 0;">
|
||||
{% for track in page.tracks %}
|
||||
{% assign tem_instr = false %}
|
||||
{% if track.instruments and track.instruments.size > 0 %}
|
||||
{% assign tem_instr = true %}
|
||||
{% endif %}
|
||||
<section class="instruments-section">
|
||||
|
||||
{% comment %}
|
||||
USANDO <details> PARA CRIAR UM ACORDION NATIVO:
|
||||
O atributo "open" (se presente) mantém a lista expandida.
|
||||
O <summary> é o título clicável que o usuário vê.
|
||||
{% endcomment %}
|
||||
<details>
|
||||
<summary class="title is-5" style="cursor: pointer; padding-left: 0;">
|
||||
<code>🎚️ Instrumentos </code>
|
||||
</summary>
|
||||
|
||||
<div class="content mt-3">
|
||||
<ul style="list-style: none; padding-left: 0;">
|
||||
{% for track in page.tracks %}
|
||||
{% assign tem_instr = false %}
|
||||
{% if track.instruments and track.instruments.size > 0 %}
|
||||
{% assign tem_instr = true %}
|
||||
{% endif %}
|
||||
|
||||
{% if track.bassline_name or tem_instr %}
|
||||
<li class="mb-5">
|
||||
{% if track.bassline_name %}
|
||||
<p class="has-text-weight-bold mb-2">🎼 {{ track.bassline_name }}</p>
|
||||
{% endif %}
|
||||
{% if track.bassline_name or tem_instr %}
|
||||
<li class="mb-5">
|
||||
{% if track.bassline_name %}
|
||||
<p class="has-text-weight-bold mb-2">🎼 {{ track.bassline_name }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if tem_instr %}
|
||||
<ul class="pl-4">
|
||||
{% for instrument in track.instruments %}
|
||||
{% if instrument.instrument_name %}
|
||||
<li style="margin-bottom: 0.4rem;">
|
||||
{% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
|
||||
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
|
||||
<code>{{ instrument.instrument_name }}</code>
|
||||
</a>
|
||||
{% if tem_instr %}
|
||||
<ul class="pl-4">
|
||||
{% for instrument in track.instruments %}
|
||||
{% if instrument.instrument_name %}
|
||||
<li style="margin-bottom: 0.4rem;">
|
||||
{% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
|
||||
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
|
||||
<code>{{ instrument.instrument_name }}</code>
|
||||
</a>
|
||||
|
||||
{% if instrument.audiofileprocessor and instrument.audiofileprocessor.src %}
|
||||
{% assign audio_filename_with_path = 'src/samples/' | append: instrument.audiofileprocessor.src %}
|
||||
<div class="audio-player-section mt-3">
|
||||
<audio controls>
|
||||
<source
|
||||
src="{{ audio_filename_with_path | relative_url }}"
|
||||
type="audio/ogg"
|
||||
>
|
||||
|
||||
{% assign wav_path = audio_filename_with_path | replace: '.ogg', '.wav' %}
|
||||
<source
|
||||
src="{{ wav_path | relative_url }}"
|
||||
type="audio/wav"
|
||||
>
|
||||
{% comment %}
|
||||
VERIFICAÇÃO DE SAMPLE:
|
||||
Se `audiofileprocessor` existir E `src` existir E `src` não for vazio, exibe o player.
|
||||
{% endcomment %}
|
||||
{% assign sample_src = instrument.audiofileprocessor.src | default: "" | strip %}
|
||||
|
||||
{% if instrument.audiofileprocessor and sample_src != "" %}
|
||||
{% assign audio_filename_with_path = 'src/samples/' | append: sample_src %}
|
||||
<div class="audio-player-section mt-3">
|
||||
<audio controls>
|
||||
<source
|
||||
src="{{ audio_filename_with_path | relative_url }}"
|
||||
type="audio/ogg"
|
||||
>
|
||||
|
||||
{% assign wav_path = audio_filename_with_path | replace: '.ogg', '.wav' %}
|
||||
<source
|
||||
src="{{ wav_path | relative_url }}"
|
||||
type="audio/wav"
|
||||
>
|
||||
|
||||
Seu navegador não suporta o elemento <code>audio</code>.
|
||||
</audio>
|
||||
</div>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
</div> <div class="column is-one-third">
|
||||
<div class="box p-4 has-background-info-light">
|
||||
Seu navegador não suporta o elemento <code>audio</code>.
|
||||
</audio>
|
||||
</div>
|
||||
{% else %}
|
||||
{% comment %} CONDIÇÃO DE MENSAGEM: O sample não foi enviado! {% endcomment %}
|
||||
<p class="has-text-danger is-size-7 mt-3">
|
||||
O sample **não foi enviado** 😢
|
||||
</p>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
</section>
|
||||
{% endif %}
|
||||
</div> <div class="column is-one-third" height="800px" widht="800px">
|
||||
<div class="box p-4 has-background-info-light" height="800px" widht="800px">
|
||||
<h3 class="title is-6 has-text-info mb-3">🛠️ Abra na Criação Colaborativa</h3>
|
||||
|
||||
{% comment %}
|
||||
CONSTRUÇÃO DA URL:
|
||||
1. Usa o arquivo fonte (`page.file`) como parâmetro `project`.
|
||||
2. Assume que a plataforma de criação está em `/creations/`.
|
||||
3. Abre em uma nova aba (`target="_blank"`).
|
||||
CONSTRUÇÃO DA URL CORRIGIDA PARA AMBIENTES DE TESTE:
|
||||
- O filtro `relative_url` foi removido para evitar a duplicação do caminho.
|
||||
- O prefixo de teste `/~jotachina/mmpSearch/` foi adicionado manualmente.
|
||||
{% endcomment %}
|
||||
{% assign creation_url = '/creations/?project=' | append: page.file | relative_url %}
|
||||
|
||||
{% assign creation_url = '/~jotachina/mmpSearch/creation.html?project=' | append: page.file %}
|
||||
<span class="icon"><i class="fa-solid fa-up-right-from-square"></i></span>
|
||||
<a
|
||||
href="{{ creation_url }}"
|
||||
target="_blank"
|
||||
class="button is-info is-fullwidth is-medium mb-4"
|
||||
>
|
||||
<span class="icon"><i class="fa-solid fa-up-right-from-square"></i></span>
|
||||
<span>Abrir no MMPCreator</span>
|
||||
</a>
|
||||
>Abrir no MMPCreator</a>
|
||||
|
||||
<p class="is-size-7 has-text-grey-dark">
|
||||
O link abrirá o projeto em uma nova aba para edição.
|
||||
@@ -167,16 +190,13 @@ title: "{{ page.file }}"
|
||||
Arquivo: <code>{{ page.file }}</code>
|
||||
</p>
|
||||
|
||||
<div class="mt-4 is-hidden-mobile">
|
||||
<h4 class="title is-7 has-text-grey-dark">Prévia (Embed)</h4>
|
||||
{% comment %}
|
||||
A prévia embutida é opcional e pode ser um pouco pesada.
|
||||
Ajuste o caminho da URL e o estilo (altura) conforme necessário.
|
||||
{% endcomment %}
|
||||
<div class="mt-4 is-hidden-mobile" height="800px" widht="800px">
|
||||
{% assign embed_url = creation_url | append: '&embed=true' %}
|
||||
|
||||
<iframe
|
||||
src="{{ creation_url }}"
|
||||
src="{{ embed_url }}"
|
||||
title="Prévia do Projeto"
|
||||
style="width: 100%; height: 300px; border: 1px solid #ccc; border-radius: 4px;"
|
||||
style="width: 500px; height: 800px; border: 1px solid #ccc; border-radius: 4px;"
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user