diff --git a/packages/frontend/src/components/MkMediaAudio.vue b/packages/frontend/src/components/MkMediaAudio.vue index e3bb39549f..eb81770869 100644 --- a/packages/frontend/src/components/MkMediaAudio.vue +++ b/packages/frontend/src/components/MkMediaAudio.vue @@ -10,8 +10,12 @@ SPDX-License-Identifier: AGPL-3.0-only tabindex="0" :class="[ $style.audioContainer, + controlsShowing && $style.active, (audio.isSensitive && prefer.s.highlightSensitiveMedia) && $style.sensitive, ]" + @mouseover.passive="onMouseOver" + @mousemove.passive="onMouseMove" + @mouseleave.passive="onMouseLeave" @contextmenu.stop @keydown.stop > @@ -35,71 +39,83 @@ SPDX-License-Identifier: AGPL-3.0-only -
+
-
- + + +
+
-
- + +
+
ALT
+
-
{{ hms(elapsedTimeMs) }}
-
- +
+
+ +
+
+ +
+
{{ hms(elapsedTimeMs) }}
+
+ + +
-
@@ -421,8 +665,6 @@ onDeactivated(() => { .audioContainer { container-type: inline-size; position: relative; - border: .5px solid var(--MI_THEME-divider); - border-radius: var(--MI-radius); overflow: clip; &:focus-visible { @@ -446,15 +688,46 @@ onDeactivated(() => { } } +.indicators { + display: inline-flex; + position: absolute; + top: 10px; + left: 10px; + pointer-events: none; + opacity: .5; + gap: 6px; +} + +.indicator { + font-size: 0.8em; + padding: 2px 5px; +} + +.hide { + display: block; + position: absolute; + border-radius: 6px; + background-color: var(--MI_THEME-fg); + color: hsl(from var(--MI_THEME-accent) h s calc(l + 10)); + font-size: 12px; + opacity: .5; + padding: 5px 8px; + text-align: center; + cursor: pointer; + top: 12px; + right: 12px; +} + .hidden { width: 100%; + height: 100%; background: #000; border: none; outline: none; font: inherit; color: inherit; cursor: pointer; - padding: 12px 0; + padding: 60px 0; display: flex; align-items: center; justify-content: center; @@ -466,6 +739,54 @@ onDeactivated(() => { color: #fff; } +.audioRoot { + background: #000; + position: relative; + width: 100%; + height: 100%; + object-fit: contain; + border-radius: var(--MI-radius); + overflow: clip; +} + +.audio { + display: block; + height: 100%; + width: 100%; +} + +.audioOverlayPlayButton { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + + opacity: 0; + transition: opacity .4s ease-in-out; + + background: var(--MI_THEME-accent); + color: #fff; + padding: 1rem; + border-radius: 99rem; + + font-size: 1.1rem; + + &:focus-visible { + outline: none; + } +} + +.audioLoading { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + .audioControls { display: grid; grid-template-areas: @@ -474,22 +795,47 @@ onDeactivated(() => { grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 4px 8px; - padding: 10px; + + padding: 35px 10px 10px 10px; + background: linear-gradient(rgba(0, 0, 0, 0),rgba(0, 0, 0, .75)); + + position: absolute; + left: 0; + right: 0; + bottom: 0; + + transform: translateY(100%); + pointer-events: none; + opacity: 0; + transition: opacity .4s ease-in-out, transform .4s ease-in-out; +} + +.active { + .audioControls { + transform: translateY(0); + opacity: 1; + pointer-events: auto; + } + + .audioOverlayPlayButton { + opacity: 1; + } } .controlsChild { display: flex; align-items: center; gap: 4px; + color: #fff; .controlButton { padding: 6px; border-radius: calc(var(--MI-radius) / 2); + transition: background-color .2s ease-in-out; font-size: 1.05rem; &:hover { - color: var(--MI_THEME-accent); - background-color: var(--MI_THEME-accentedBg); + background-color: var(--MI_THEME-accent); } &:focus-visible { @@ -521,6 +867,9 @@ onDeactivated(() => { .seekbarRoot { grid-area: seekbar; + /* ▼シークバー操作をやりやすくするためにクリックイベントが伝播されないエリアを拡張する */ + margin: -10px; + padding: 10px; } @container (min-width: 500px) {