@ -7,103 +7,117 @@ if theme.subtitle.enable
if source == '1'
script.
var subtitleEffect = !{subtitleEffect}
fetch('https://api.ooopn.com/ciba/api.php',)
.then(function (res){
return res.json();
})
.then(function (data) {
if (subtitleEffect){
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(data['ciba-en'],data.ciba)
var typed = new Typed("#subtitle", {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = data['ciba-en']
}
})
.catch(function (err) {
console.error(err);
})
var subtitleType = function () {
var subtitleEffect = !{ subtitleEffect }
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',)
.then(function (res) {
return res.json()
})
.then(function (data) {
if (subtitleEffect) {
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
var both = sub.unshift(data.text)
var typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = data.text
}
})
.catch(function (err) {
console.error(err)
})
}
window.addEventListener('load', subtitleType)
else if source == '2'
script.
var subtitleEffect = !{subtitleEffect}
fetch('https://v1.hitokoto.cn')
.then(function (res){
return res.json();
})
.then(function (data) {
if (subtitleEffect){
var from = '出自 ' + data.from
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(data.hitokoto,from)
var typed = new Typed("#subtitle", {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = data.hitokoto
}
})
.catch(function (err) {
console.error(err);
})
var subtitleType = function () {
var subtitleEffect = !{ subtitleEffect }
fetch('https://v1.hitokoto.cn')
.then(function (res) {
return res.json()
})
.then(function (data) {
if (subtitleEffect) {
var from = '出自 ' + data.from
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
var both = sub.unshift(data.hitokoto, from)
var typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = data.hitokoto
}
})
.catch(function (err) {
console.error(err)
})
}
window.addEventListener('load', subtitleType)
else if source == "3"
script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
else if source == '3'
script.
var subtitleEffect = !{subtitleEffect}
var con = str[0];
if (subtitleEffect){
var from = "出自 " + str[1];
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(con,from)
var typed = new Typed("#subtitle", {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = con
var subtitleType = function () {
loadScript('http://yijuzhan.com/api/word.php?m=js', function () {
var subtitleEffect = !{ subtitleEffect }
var con = str[0]
if (subtitleEffect) {
var from = '出自 ' + str[1]
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
var both = sub.unshift(con, from)
var typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = con
}
})
}
window.addEventListener('load', subtitleType)
else if source == '4'
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8")
script.
var subtitleEffect = !{subtitleEffect}
jinrishici.load(function(result) {
if (subtitleEffect){
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var content = result.data.content;
var both = sub.unshift(content)
var typed = new Typed("#subtitle", {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = result.data.content
}
})
var subtitleType = function () {
loadScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
var subtitleEffect = !{ subtitleEffect }
jinrishici.load(function (result) {
if (subtitleEffect) {
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
var content = result.data.content
var both = sub.unshift(content)
var typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = result.data.content
}
})
}
)
}
window.addEventListener('load', subtitleType)
else
- var subtitle = theme.subtitle.sub[0]
script.
var subtitleEffect = !{subtitleEffect}
if (subtitleEffect){
if (subtitleEffect) {
var typed = new Typed("#subtitle", {
strings: '!{theme.subtitle.sub}'.split(","),
startDelay: 300,
@ -111,6 +125,6 @@ if theme.subtitle.enable
loop: !{theme.subtitle.loop},
backSpeed: 50
})
}else{
document.getElementById("subtitle").innerHTML = '!{subtitle}'
}
} else {
document.getElementById("subtitle").innerHTML = '!{theme. subtitle.sub[0] }'
}