mirror of
https://dl.bcrjl.com/ghg/HaoOuBa/Joe.git
synced 2026-02-17 13:10:05 +08:00
更新
This commit is contained in:
@@ -179,11 +179,28 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
}
|
||||
window.customElements.define('joe-message', JoeMessage);
|
||||
class JoeProgress extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.options = {
|
||||
percentage: /^\d{1,3}%$/.test(this.getAttribute('percentage')) ? this.getAttribute('percentage') : '50%',
|
||||
color: this.getAttribute('color') || '#ff6c6c'
|
||||
};
|
||||
this.innerHTML = `
|
||||
<span class="joe_detail__article-progress">
|
||||
<span class="strip">
|
||||
<span class="percent" style="width: ${this.options.percentage}; background: ${this.options.color};"></span>
|
||||
</span>
|
||||
<span class="percentage">${this.options.percentage}</span>
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
}
|
||||
window.customElements.define('joe-progress', JoeProgress);
|
||||
|
||||
const article = document.querySelector('.joe_detail__article');
|
||||
if (article) article.innerHTML = article.innerHTML.replace(/<p><\/p>/g, '');
|
||||
|
||||
|
||||
/*
|
||||
------------------------以下未测试------------------------------------------
|
||||
*/
|
||||
|
||||
2
assets/js/joe.short.min.js
vendored
2
assets/js/joe.short.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user