mirror of
https://dl.bcrjl.com/ghg/HaoOuBa/Joe.git
synced 2026-02-17 13:10:05 +08:00
更新
This commit is contained in:
2
assets/css/joe.global.min.css
vendored
2
assets/css/joe.global.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1454,6 +1454,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.joe_gird {
|
||||
display: grid;
|
||||
&__item {
|
||||
*:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.joe_checkbox {
|
||||
-webkit-appearance: none;
|
||||
position: relative;
|
||||
|
||||
@@ -563,6 +563,35 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
);
|
||||
|
||||
customElements.define(
|
||||
'joe-gird',
|
||||
class JoeGird extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.options = {
|
||||
column: isNaN(this.getAttribute('column')) || !this.getAttribute('column') ? 3 : this.getAttribute('column'),
|
||||
gap: isNaN(this.getAttribute('gap')) || !this.getAttribute('gap') ? 15 : this.getAttribute('gap')
|
||||
};
|
||||
const _temp = getChildren(this, '_temp');
|
||||
let _innerHTML = _temp.innerHTML.trim().replace(/^(<br>)|(<br>)$/g, '');
|
||||
let contents = '';
|
||||
_innerHTML.replace(/{gird-item}([\s\S]*?){\/gird-item}/g, function ($0, $1) {
|
||||
contents += `<div class="joe_gird__item">${$1.trim().replace(/^(<br>)|(<br>)$/g, '')}</div>`;
|
||||
});
|
||||
let htmlStr = `<div class="joe_gird" style="gap: ${this.options.gap}px; grid-template-columns: repeat(${this.options.column}, 1fr);">${contents}</div>`;
|
||||
if (getChildren(this, '_content')) {
|
||||
getChildren(this, '_content').innerHTML = htmlStr;
|
||||
} else {
|
||||
const span = document.createElement('span');
|
||||
span.className = '_content';
|
||||
span.style.display = 'block';
|
||||
span.innerHTML = htmlStr;
|
||||
this.appendChild(span);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
customElements.define(
|
||||
'joe-copy',
|
||||
class JoeCopy extends HTMLElement {
|
||||
|
||||
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