Skip to content

Commit

Permalink
fix(audio): Correct coloring. Add instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
pham committed Mar 13, 2023
1 parent 6faaa55 commit acdb0d5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
9 changes: 3 additions & 6 deletions _includes/session/audio.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{% for audio in include.audio %}
<div style='position: relative' class='essential_audio' data-url='{{ audio }}'></div>

{% assign _size = include.audio | size %}
{% if forloop.index != _size %}<hr />{% endif %}
{% endfor %}
<div style="padding: 50px 0">
<div class='essential_audio' data-url='{{ include.audio }}'></div>
</div>
6 changes: 6 additions & 0 deletions _includes/session/sounds.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% for audio in include.audio %}
<div class='essential_audio' data-url='{{ audio }}'></div>

{%- assign _size = include.audio | size %}
{% if forloop.index != _size %}<br /><br />{% endif -%}
{% endfor %}
2 changes: 1 addition & 1 deletion _layouts/session.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{%- include session/images.html images=session_data.images -%}
{%- include session/points.html -%}
{%- include session/videos.html videos=session_data.videos -%}
{%- include session/audio.html audio=session_data.audio -%}
{%- include session/sounds.html audio=session_data.audio -%}
{{ content }}
{%- if page.dialogue -%}
{%- include session/conversation.html data=page.dialogue-%}
Expand Down
4 changes: 2 additions & 2 deletions _sass/_essential-audio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ div.essential_audio > div:nth-child(2):after {
content: "";
position: absolute;
z-index: 0;
background-color: var(--color-link);
background-color: #000;
opacity: 0.3;
mix-blend-mode: multiply;
top: 0px;
Expand All @@ -95,7 +95,7 @@ div.essential_audio > div:nth-child(2):after {

/* 4. The Loading Progress Bar */
div.essential_audio > div:nth-child(2) div {
background-color: #666;
background-color: var(--color-link);
mix-blend-mode: multiply;
}

Expand Down
21 changes: 21 additions & 0 deletions content/_session/audio-01.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
---
---

<hr class='section' />

## Play Audio

Include an `audio` field in your `_data/sessions.yml` to add audio to top of content:

<pre>
...
audio:
- /assets/music-1.mp3
- /assets/speech-2.ogg
</pre>

To add audio file on-demand use:

<pre>
{&#37; include session/audio.html audio='/assets/music.mp3' &#37;}
</pre>

<hr class='logo' />
1 change: 1 addition & 0 deletions content/_session/parts/theme_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Key | Description
`width` | Optional setting to use screen's width for content (only value: `max`)
`images` | Optional array of `src` & `desc` for main image(s) to display
`videos` | Optional arrray of YouTube video IDs to render at the top of the session
`audio` | Optional array of audio files to render at top of session
`due` | OPtional date that this assignment or quiz is due (e.g. `2022-10-10`)
`points` | Optional value of this assignment (e.g. `30`)
`part` | OPtional partition identifier for current lession (e.g. `1`)
Expand Down

0 comments on commit acdb0d5

Please sign in to comment.