1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-27 03:46:54 +00:00

move music data to assets

This commit is contained in:
devfake 2015-07-05 14:06:34 +02:00
parent 6a970fef68
commit 05af5560ae
3 changed files with 54 additions and 4 deletions

46
assets/js/temp.js Normal file
View File

@ -0,0 +1,46 @@
// Start music.
$(".video-self").tubeplayer({
width: 0.001,
height: 0.001,
initialVideo: "UE9fPWy1_o4",
autoPlay: true,
onPlayerEnded: function(){
$(".video-self").tubeplayer('play');
}
});
if(localStorage.getItem('volume') == 'off') {
$('.music-icon').removeClass('active');
}
if(localStorage.getItem('volumeValue') != null) {
$('.video-self').tubeplayer('volume', localStorage.getItem('volumeValue'));
} else {
$('.volume').val('75');
$('.video-self').tubeplayer('volume', 75);
}
// Set volume.
$('.volume').on('blur', function() {
var val = $(this).val();
if(val > 100) val = 100;
if(val < 0) val = 0;
if( ! val) val = 75;
$('.video-self').tubeplayer('volume', val);
localStorage.setItem('volumeValue', val);
});
// Music options.
$('.music-icon').on('click', function() {
if($(this).hasClass('active')) {
localStorage.setItem('volume', 'off');
$(this).removeClass('active');
$(".video-self").tubeplayer('mute');
} else {
localStorage.setItem('volume', 'on');
$(this).addClass('active');
$(".video-self").tubeplayer('unmute');
}
});

4
assets/js/tubeplayer.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -13,9 +13,9 @@
<script src="Config.js"></script>
</head>
<body>
<div class="music-container" title="Click to mute/unmute music">
<div class="music-container">
<span class="video-self"></span>
<i class="music-icon active"></i>
<i class="music-icon active" title="Click to mute/unmute music"></i>
<div class="music-options">
<label for="volume">Volume</label>
<input type="text" class="volume" id="volume">
@ -31,8 +31,8 @@
<script src="build/app.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="build/tubeplayer.js"></script>
<script src="build/temp.js"></script>
<script src="../assets/js/tubeplayer.js"></script>
<script src="../assets/js/temp.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){