Update assets.py

main
RVC-Boss 4 weeks ago committed by GitHub
parent 97e37c74d8
commit e63e0901fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,38 +1,81 @@
js = """ js = """
function deleteTheme() { function createGradioAnimation() {
const params = new URLSearchParams(window.location.search); const params = new URLSearchParams(window.location.search);
if (params.has('__theme')) { if (params.get('__theme') !== 'light') {
params.delete('__theme'); params.set('__theme', 'light'); // 仅当 __theme 不是 'light' 时设置为 'light'
const newUrl = `${window.location.pathname}?${params.toString()}`; window.location.search = params.toString(); // 更新 URL触发页面刷新
window.location.replace(newUrl); }
}
var container = document.createElement('div');
container.id = 'gradio-animation';
container.style.fontSize = '2em';
container.style.fontWeight = '500';
container.style.textAlign = 'center';
container.style.marginBottom = '20px';
container.style.fontFamily = '-apple-system, sans-serif, Arial, Calibri';
var text = 'Welcome to GPT-SoVITS !';
for (var i = 0; i < text.length; i++) {
(function(i){
setTimeout(function(){
var letter = document.createElement('span');
letter.style.opacity = '0';
letter.style.transition = 'opacity 0.5s';
letter.innerText = text[i];
container.appendChild(letter);
setTimeout(function() {
letter.style.opacity = '1';
}, 50);
}, i * 250);
})(i);
}
return 'Animation created';
} }
""" """
css = """ css = """
/* CSSStyleRule */ /* CSSStyleRule */
.markdown { .markdown {
background-color: lightblue;
padding: 6px 10px; padding: 6px 10px;
} }
@media (prefers-color-scheme: light) { .checkbox_info {
.markdown { color: var(--block-title-text-color) !important;
background-color: lightblue; font-size: var(--block-title-text-size) !important;
color: #000; font-weight: var(--block-title-text-weight) !important;
} height: 22px;
margin-bottom: 8px !important;
} }
@media (prefers-color-scheme: dark) { ::selection {
.markdown { background: #ffc078; !important;
background-color: #4b4b4b;
color: rgb(244, 244, 245);
}
} }
::selection { #checkbox_train_dpo input[type="checkbox"]{
background: #ffc078 !important; margin-top: 6px;
}
#checkbox_train_dpo span {
margin-top: 6px;
}
#checkbox_align_train {
padding-top: 18px;
padding-bottom: 18px;
}
#checkbox_align_infer input[type="checkbox"] {
margin-top: 10px;
}
#checkbox_align_infer span {
margin-top: 10px;
} }
footer { footer {
@ -48,14 +91,16 @@ footer * {
} }
""" """
top_html = """ top_html = """
<div align="center"> <div align="center">
<div style="margin-bottom: 5px; font-size: 15px;">{}</div> <div style="margin-bottom: 5px; font-size: 15px;">{}</div>
<div style="display: flex; gap: 80px; justify-content: center;"> <div style="display: flex; gap: 60px; justify-content: center;">
<a href="https://github.com/RVC-Boss/GPT-SoVITS" target="_blank"> <a href="https://github.com/RVC-Boss/GPT-SoVITS" target="_blank">
<img src="https://img.shields.io/badge/GitHub-GPT--SoVITS-blue.svg?style=for-the-badge&logo=github" style="width: auto; height: 30px;"> <img src="https://img.shields.io/badge/GitHub-GPT--SoVITS-blue.svg?style=for-the-badge&logo=github" style="width: auto; height: 30px;">
</a> </a>
<a href="https://github.com/RVC-Boss/GPT-SoVITS" target="_blank">
<img src="https://img.shields.io/badge/免费在线体验-free_online_demo-blue.svg?style=for-the-badge&logo=huggingface" style="width: auto; height: 30px;">
</a>
<a href="https://www.yuque.com/baicaigongchang1145haoyuangong/ib3g1e" target="_blank"> <a href="https://www.yuque.com/baicaigongchang1145haoyuangong/ib3g1e" target="_blank">
<img src="https://img.shields.io/badge/简体中文-阅读文档-blue?style=for-the-badge&logo=googledocs&logoColor=white" style="width: auto; height: 30px;"> <img src="https://img.shields.io/badge/简体中文-阅读文档-blue?style=for-the-badge&logo=googledocs&logoColor=white" style="width: auto; height: 30px;">
</a> </a>

Loading…
Cancel
Save