first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
class incommon{
$(name){
return document.querySelector(name);
}
_(name){
return document.querySelectorAll(name);
}
customMethods(){
Element.prototype.add=function(name){
this.classList.add(name)
}
Element.prototype.remove=function(name){
this.classList.remove(name)
}
Element.prototype.none = function() {
this.style.display = "none"
}
Element.prototype.show = function() {
this.style.display = "block"
}
}
getRandom(min, max) {
const floatRandom = Math.random()
const difference = max - min
const random = Math.round(difference * floatRandom)
const randomWithinRange = random + min
return randomWithinRange
}
}
let { $, _ ,customMethods,getRandom} = new incommon()
customMethods()