Answer the question
In order to leave comments, you need to log in
How to take timestamps from a file, but to make them work in a script?
I have a script
let videoSetStupidLove = 2800;
let speedStupidLove = 1005;
let iStupidLove = 1;
let iStupidLove_2;
let canplaygold = true;
function stupidLovePictGo(){
let ins = document.getElementById('in');
let his = document.createElement('his');
his.className = "his";
ins.prepend(his);
setTimeout(nexte, videoSetStupidLove);
function nexte(){
var audio = new Audio();
audio.src = "***";
audio.play();
audio.volume = 0.0;
codename = 'StupidLove';
$.getJSON( '/maps/2021/' + codename + '/' + codename + '.json', function(map) {
});
var lirycs = [
];
var next_name = lirycs.shift();
var checker = setInterval(function(){
if(end==0){
if(next_name.time==80347&&canplaygold == true||next_name.time==196244&&canplaygold == true){
canplaygold = false;
goldMoveGoing();
}
if(next_name.time==71194){
speedStupidLove = 1002;
}
if(next_name.time<audio.currentTime*speedStupidLove){
let dvi = document.createElement('div');
dvi.className = "dvi";
his.prepend(dvi);
let dv = document.createElement('div');
dv.className = "dv";
dvi.prepend(dv);
let imgss = document.createElement('img');
imgss.className = "picto-go";
imgss.id = "hi" + iStupidLove;
imgss.style.zIndex = iStupidLove;
imgss.style.width = 235 + 'px';
imgss.style.height = 235 + 'px';
imgss.src = '/maps/2021/StupidLove/pictograms/' + next_name.name + '.png';
dv.prepend(imgss);
document.getElementById('hi' + iStupidLove).animate({
top: ['567px', '567px', '567px'],
left: [ '1540px', '956px', '956px'],
opacity: [ 1, 1, 0 ],
transform: [ 'scale(1)', 'scale(1)', 'scale(1.2)' ],
offset: [ 0, 0.9275, 1 ]
}, {
duration: 2500,
fill: "forwards",
});
iStupidLove++;
console.log(next_name.time + ' ' + next_name.name);
next_name = lirycs.shift();
}
}
if(audio.ended)clearInterval(checker);
});
}
};
function goldMoveGoing(){
canplaygold = false;
var foldaudio = new Audio(); // Создаём новый элемент Audio
foldaudio.src = '/audio/fullgoldmove.mp3'; // Указываем путь к звуку "клика"
foldaudio.autoplay = true; // Автоматически запускаем
foldaudio.volume = .5;
setTimeout(playgold,6070)
function playgold(){
goldmove();
}
setTimeout(can,4000)
function can(){
canplaygold = true;
}
}
$.getJSON( '/maps/2021/' + codename + '/' + codename + '.json', function(map) {
});
{
"Mapname": "StupidLove",
"Title": "Stupid Love",
"Artist":"Lady Gaga",
"Difficulty": "Normal",
"JDVersion": "JDOnline",
"NumCoach": "Solo",
"OriginalJDVersion": 2021,
"assets":{
"Cover_Generic":"***",
"Cover_AlbumCoach":"***",
"Coach_1":"***",
"Map_Bkg":"***",
"videoPreview":"***",
"videoCoach":"***"
},
"pictos":[
{
"duration": "339",
"name": "starting_sh",
"time": "2032"
},
{
"duration": "339",
"name": "fist_sh",
"time": "2541"
}
]
}
{
"duration": "339",
"name": "starting_sh",
"time": "2032"
},
{
"duration": "339",
"name": "fist_sh",
"time": "2541"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question