fix
This commit is contained in:
parent
7deb60d7be
commit
4f6497280f
4 changed files with 28 additions and 2 deletions
18
files/assets/js/christmas/fireplace.js
Normal file
18
files/assets/js/christmas/fireplace.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const audio = new Audio('/assets/christmas/songs/fireplace.mp3');
|
||||
audio.loop=true;
|
||||
|
||||
function play() {
|
||||
audio.play();
|
||||
}
|
||||
|
||||
console.log(audio)
|
||||
|
||||
audio.loop=true;
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
audio.play();
|
||||
document.getElementById('thread').addEventListener('click', () => {
|
||||
if (audio.paused) audio.play();
|
||||
}, {once : true});
|
||||
|
||||
});
|
|
@ -24,13 +24,14 @@ const trackList = [
|
|||
'santa',
|
||||
'santababy',
|
||||
'simply',
|
||||
'simplyhaving',
|
||||
'sinatra',
|
||||
'sinatra2',
|
||||
'steve',
|
||||
'trans',
|
||||
'waitresses',
|
||||
'wham',
|
||||
'wonderland',
|
||||
'wonderland'
|
||||
];
|
||||
const selected = trackList[Math.floor(Math.random() * trackList.length)];
|
||||
|
||||
|
|
2
files/templates/awards/Christmas/Fireplace.html
Normal file
2
files/templates/awards/Christmas/Fireplace.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<div class="fixed w-full h-full z-[1000] bg-cover pointer-events-none opacity-[.1]" style="background-image: url('https://media0.giphy.com/media/3o72FhIuVWddxQHftS/giphy.gif');">
|
||||
</div>
|
|
@ -123,9 +123,14 @@
|
|||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Songs & Mariah award -->
|
||||
<!-- Songs & Fireplace awards -->
|
||||
{% if p.award_count("snow") and p.award_count("fireplace") %}
|
||||
<script defer src="/assets/js/christmas/deanmartin.js?v=1"></script>
|
||||
{% elif p.award_count("fireplace")%}
|
||||
<script defer src="/assets/js/christmas/fireplace.js?v=2"></script>
|
||||
{% else %}
|
||||
<script defer src="/assets/js/christmas/playlist.js?v=2"></script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Fireplace award -->
|
||||
{% include "/awards/Christmas/Fireplace.html" %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue