npm install
npm run compress
Calculate min-height
and fill it in the style of the main
, and ensure that main fills the entire page.
window.addEventListener('load', (event) => {
Pikajs.calcMinMain();
});
Result:
<main style="min-height: calc(100vh - 26px)">
</main>
26px
is headerHeight + footerHeight
, if include selection
tag, footerHeight
is 0.
Calculate min-height
and fill it in the style of the main
, and ensure that main fills the entire page.
window.addEventListener('load', (event) => {
let app = document.getElementById('app');
Pikajs.calcMinMainWithParent(app);
});
Result:
<main style="min-height: calc(100vh - 26px)">
</main>
26px
is headerHeight + footerHeight
, if include selection
tag, footerHeight
is 0.
Password Quality Calculator, if the value is greater than 80, it is a strong password.
Async like this:
async function pqcalc(pass='') {
return await Pikajs.passQCalc(pass);
}
pqcalc('P422w0Rd').then((result) => {
document.getElementById("rank").innerText = result;
});
Get first selector height
Get first selector height under parent node
Has first selector
Has first selector under parent node
Is password (only ASCII printable characters without space)
Check for consecutive repeated characters
Check for consecutive repeated characters with ignore case
Check character with regex
Is uppercase letter character
Is lowercase letter character
Is digit character
Is punctuation character
Is white space character
Decode Base64 to byte buffer
Encode byte buffer to Base64
Base64 Encoder
Base64 Decoder
Convert string to byte buffer
Convert byte buffer to string
Get browser dark mode status
Return undefined is unsupported, true is dark mode, false is light mode
Split content
Convert like
<span class="animEles">test</span>
to
<span class="animEles"><em>t</em><em>e</em><em>s</em><em>t</em></span>
const animaEles = document.body.querySelectorAll(".animEles");
animaEles.forEach((e) => {
Pikajs.splitContent(e.innerHTML, "", "em")
.then((event) => {
e.innerHTML = event;
})
.catch((error) => {
console.log(error);
});
});
Split content with parity
Convert like
<span class="animEles">test</span>
to
<span class="anim-eles"><em class="even">t</em><em class="odd">e</em><em class="even">s</em><em class="odd">t</em></span>
const animaEles = document.body.querySelectorAll(".animEles");
animaEles.forEach((e) => {
Pikajs.splitContentWithParity(e.innerHTML, "", "em", "odd", "even")
.then((event) => {
e.innerHTML = event;
})
.catch((error) => {
console.log(error);
});
});