I'm in a rush to release so I am adding features that are needed to make it usable.
This commit is contained in:
parent
c76ab1abf3
commit
4c2857b445
25 changed files with 2475 additions and 3475 deletions
62
mix.php
62
mix.php
|
@ -39,7 +39,7 @@ require_once 'includes/header.php'; ?>
|
|||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item"><a href="/mix"><?php echo $locale['mixes']; ?></a></li>
|
||||
<li class="breadcrumb-item"><?php echo $locale['mixes']; ?></li>
|
||||
<li class="breadcrumb-item active"
|
||||
aria-current="page"><?php
|
||||
if (isset($mix) && $mix->get_name() != "") {
|
||||
|
@ -76,27 +76,22 @@ require_once 'includes/header.php'; ?>
|
|||
<div class="card-body bg-body-secondary text-center">
|
||||
<?php
|
||||
if ($mix->is_download_only()) {
|
||||
echo "<a href='/mix/" . $mix->get_slug() . "/download" . "' class='btn btn-primary'>" . $locale['download'] . "</a>";
|
||||
echo "<a href='/mix/" . $mix->get_slug() . "/download" . "' class='btn btn-primary w-100 mb-2'>" . $locale['download'] . "</a>";
|
||||
} else {
|
||||
?>
|
||||
<div id="audio-player">
|
||||
<audio id="audio" src="<?php echo $mix->get_url(); ?>"></audio>
|
||||
<div class="player-controls">
|
||||
<button id="play-pause-btn">
|
||||
<i class="fas fa-play" style="font-size: 12px;"></i>
|
||||
</button>
|
||||
<input type="range" id="seek-bar" value="0">
|
||||
?>
|
||||
<div id="audio-player">
|
||||
<audio id="audio" src="<?php echo $mix->get_url(); ?>"></audio>
|
||||
<div class="player-controls">
|
||||
<button id="play-pause-btn">
|
||||
<i class="fas fa-play" style="font-size: 12px;"></i>
|
||||
</button>
|
||||
<input type="range" id="seek-bar" value="0">
|
||||
</div>
|
||||
<div id="time-display">
|
||||
<span id="current-time">0:00</span> / <span id="duration">0:00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="time-display">
|
||||
<span id="current-time">0:00</span> / <span id="duration">0:00</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4">
|
||||
|
@ -398,14 +393,14 @@ require_once 'includes/header.php'; ?>
|
|||
$utm_params = '?utm_source=website&utm_medium=share_modal&utm_campaign=sharing';
|
||||
$share_url = urlencode($url . $utm_params);
|
||||
?>
|
||||
<a href="#" id="copyLinkBtn" class="btn btn-secondary w-100 mb-2">Copy URL</a>
|
||||
<a href="#" id="copyLinkBtn"
|
||||
class="btn btn-secondary w-100 mb-2"><?php echo $locale['copyurl']; ?></a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>"
|
||||
target="_blank" class="btn btn-primary w-100 mb-2" onclick="hideModal()">Share to
|
||||
Facebook</a>
|
||||
target="_blank" class="btn btn-primary w-100 mb-2"
|
||||
onclick="hideModal()"><?php echo $locale['sharetofb']; ?></a>
|
||||
<a href="https://twitter.com/intent/tweet?url=<?php echo $share_url; ?>"
|
||||
target="_blank" class="btn btn-dark w-100 mb-2" onclick="hideModal()">Share to X (formerly Twitter)</a>
|
||||
<a href="https://www.instagram.com/" target="_blank" class="btn btn-danger w-100"
|
||||
onclick="hideModal()">Share to Instagram</a>
|
||||
target="_blank" class="btn btn-dark w-100 mb-2"
|
||||
onclick="hideModal()"><?php echo $locale['sharetotwitter']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -426,10 +421,10 @@ require_once 'includes/header.php'; ?>
|
|||
|
||||
copyLinkBtn.onclick = function () {
|
||||
navigator.clipboard.writeText(urlToCopy).then(function () {
|
||||
alert('URL copied to clipboard');
|
||||
alert('<?php echo $locale['urlcopiedtoclipboard'];?>');
|
||||
shareModal.hide();
|
||||
}, function (err) {
|
||||
alert('Failed to copy URL: ' + err);
|
||||
alert('<?php echo $locale['failedtocopyurl'];?>: ' + err);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -518,7 +513,7 @@ require_once 'includes/header.php'; ?>
|
|||
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
const audio = $('#audio')[0];
|
||||
const playPauseBtn = $('#play-pause-btn');
|
||||
const playPauseIcon = playPauseBtn.find('i');
|
||||
|
@ -548,31 +543,30 @@ require_once 'includes/header.php'; ?>
|
|||
}
|
||||
}
|
||||
|
||||
audio.addEventListener('loadedmetadata', function() {
|
||||
audio.addEventListener('loadedmetadata', function () {
|
||||
seekBar.attr('max', audio.duration);
|
||||
duration.text(formatTime(audio.duration));
|
||||
});
|
||||
|
||||
playPauseBtn.click(togglePlayPause);
|
||||
|
||||
seekBar.on('input', function() {
|
||||
seekBar.on('input', function () {
|
||||
const time = seekBar.val();
|
||||
audio.currentTime = time;
|
||||
});
|
||||
|
||||
audio.addEventListener('timeupdate', function() {
|
||||
audio.addEventListener('timeupdate', function () {
|
||||
seekBar.val(audio.currentTime);
|
||||
currentTime.text(formatTime(audio.currentTime));
|
||||
});
|
||||
|
||||
audio.addEventListener('ended', function() {
|
||||
audio.addEventListener('ended', function () {
|
||||
playPauseIcon.removeClass('fa-pause').addClass('fa-play');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue