adding search bar to appz
This commit is contained in:
@@ -265,21 +265,29 @@ HTMLElement.prototype.padding = function(one, two, three = "px") {
|
|||||||
};
|
};
|
||||||
|
|
||||||
HTMLElement.prototype.paddingTop = function(value, unit = "px") {
|
HTMLElement.prototype.paddingTop = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.paddingTop = value + unit
|
this.style.paddingTop = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.paddingLeft = function(value, unit = "px") {
|
HTMLElement.prototype.paddingLeft = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.paddingLeft = value + unit
|
this.style.paddingLeft = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.paddingBottom = function(value, unit = "px") {
|
HTMLElement.prototype.paddingBottom = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.paddingBottom = value + unit
|
this.style.paddingBottom = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.paddingRight = function(value, unit = "px") {
|
HTMLElement.prototype.paddingRight = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.paddingRight = value + unit
|
this.style.paddingRight = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@@ -309,21 +317,29 @@ HTMLElement.prototype.margin = function(direction, value, unit = "px") {
|
|||||||
};
|
};
|
||||||
|
|
||||||
HTMLElement.prototype.marginTop = function(value, unit = "px") {
|
HTMLElement.prototype.marginTop = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.marginTop = value + unit
|
this.style.marginTop = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.marginLeft = function(value, unit = "px") {
|
HTMLElement.prototype.marginLeft = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.marginLeft = value + unit
|
this.style.marginLeft = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.marginBottom = function(value, unit = "px") {
|
HTMLElement.prototype.marginBottom = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.marginBottom = value + unit
|
this.style.marginBottom = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.marginRight = function(value, unit = "px") {
|
HTMLElement.prototype.marginRight = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
this.style.marginRight = value + unit
|
this.style.marginRight = value + unit
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@@ -357,6 +373,9 @@ HTMLElement.prototype.minHeight = function(value, unit = "px") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HTMLElement.prototype.fontSize = function(value, unit = "px") {
|
HTMLElement.prototype.fontSize = function(value, unit = "px") {
|
||||||
|
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
|
||||||
|
throw new Error(`Invalid value: ${value}. Expected a number.`);
|
||||||
|
|
||||||
switch(value) {
|
switch(value) {
|
||||||
case "6xl":
|
case "6xl":
|
||||||
value = "3.75"; unit = "rem"
|
value = "3.75"; unit = "rem"
|
||||||
|
|||||||
@@ -1,14 +1,44 @@
|
|||||||
css(`
|
css(`
|
||||||
forum- {
|
forum- input::placeholder {
|
||||||
width: 100%; height: 100%;
|
font-size: 0.9em;
|
||||||
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
export default class Forum extends HTMLElement {
|
class Forum extends Shadow {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
ZStack(() => {
|
||||||
|
HStack(() => {
|
||||||
|
input("Search...", "50vw")
|
||||||
|
.attr({
|
||||||
|
"type": "text"
|
||||||
|
})
|
||||||
|
.fontSize(1.1, em)
|
||||||
|
.paddingLeft(1.3, em)
|
||||||
|
.background("transparent")
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.outline("none")
|
||||||
|
.color("var(--accent)")
|
||||||
|
.borderRadius(10, px)
|
||||||
|
button("Search")
|
||||||
|
.marginLeft(2, em)
|
||||||
|
.borderRadius(10, px)
|
||||||
|
.background("transparent")
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.color("var(--accent)")
|
||||||
|
})
|
||||||
|
.x(50, vw).y(5, vh)
|
||||||
|
.position("absolute")
|
||||||
|
.transform("translateX(-50%)")
|
||||||
|
})
|
||||||
|
.width(100, "%")
|
||||||
|
.height(100, "%")
|
||||||
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this.innerHTML += /* html */`<p style="position: fixed; top: 50vh; left: 50vw; transform: translate(-50%, -50%)">Coming Soon!</p>`
|
// Optional additional logic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("forum-", Forum)
|
registerShadow(Forum)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
css(`
|
css(`
|
||||||
|
market- input::placeholder {
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
class Market extends Shadow {
|
class Market extends Shadow {
|
||||||
@@ -11,12 +14,19 @@ class Market extends Shadow {
|
|||||||
.attr({
|
.attr({
|
||||||
"type": "text"
|
"type": "text"
|
||||||
})
|
})
|
||||||
|
.fontSize(1.1, em)
|
||||||
|
.paddingLeft(1.3, em)
|
||||||
.background("transparent")
|
.background("transparent")
|
||||||
.border("1px solid var(--accent)")
|
.border("1px solid var(--accent)")
|
||||||
.outline("none")
|
.outline("none")
|
||||||
.color("var(--accent)")
|
.color("var(--accent)")
|
||||||
.borderRadius(10, px)
|
.borderRadius(10, px)
|
||||||
button("Search")
|
button("Search")
|
||||||
|
.marginLeft(2, em)
|
||||||
|
.borderRadius(10, px)
|
||||||
|
.background("transparent")
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.color("var(--accent)")
|
||||||
})
|
})
|
||||||
.x(50, vw).y(5, vh)
|
.x(50, vw).y(5, vh)
|
||||||
.position("absolute")
|
.position("absolute")
|
||||||
|
|||||||
@@ -1,15 +1,44 @@
|
|||||||
css(`
|
css(`
|
||||||
messages- {
|
messages- input::placeholder {
|
||||||
width: 100%; height: 100%;
|
font-size: 0.9em;
|
||||||
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
export default class Messages extends HTMLElement {
|
class Messages extends Shadow {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
ZStack(() => {
|
||||||
|
HStack(() => {
|
||||||
|
input("Search...", "50vw")
|
||||||
|
.attr({
|
||||||
|
"type": "text"
|
||||||
|
})
|
||||||
|
.fontSize(1.1, em)
|
||||||
|
.paddingLeft(1.3, em)
|
||||||
|
.background("transparent")
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.outline("none")
|
||||||
|
.color("var(--accent)")
|
||||||
|
.borderRadius(10, px)
|
||||||
|
button("Search")
|
||||||
|
.marginLeft(2, em)
|
||||||
|
.borderRadius(10, px)
|
||||||
|
.background("transparent")
|
||||||
|
.border("1px solid var(--accent)")
|
||||||
|
.color("var(--accent)")
|
||||||
|
})
|
||||||
|
.x(50, vw).y(5, vh)
|
||||||
|
.position("absolute")
|
||||||
|
.transform("translateX(-50%)")
|
||||||
|
})
|
||||||
|
.width(100, "%")
|
||||||
|
.height(100, "%")
|
||||||
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
console.log("rendeirng messages")
|
// Optional additional logic
|
||||||
this.innerHTML += /* html */`<p style="position: fixed; top: 50vh; left: 50vw; transform: translate(-50%, -50%)">Coming Soon!</p>`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("messages-", Messages)
|
registerShadow(Messages)
|
||||||
|
|||||||
@@ -50,11 +50,22 @@ class Home extends Shadow {
|
|||||||
|
|
||||||
a("/signout", "Sign Out")
|
a("/signout", "Sign Out")
|
||||||
.position("fixed")
|
.position("fixed")
|
||||||
.top("2em")
|
.top("3em")
|
||||||
.right("2em")
|
.right("2em")
|
||||||
.background("var(--tan)")
|
.background("transparent")
|
||||||
.color("var(--red)")
|
.border("1px solid var(--tan)")
|
||||||
|
.color("var(--tan)")
|
||||||
.borderRadius(5, px)
|
.borderRadius(5, px)
|
||||||
|
.onHover(function (hovering) {
|
||||||
|
console.log('hovering', hovering, this)
|
||||||
|
if(hovering) {
|
||||||
|
this.style.background = "var(--tan)"
|
||||||
|
this.style.color = "black"
|
||||||
|
} else {
|
||||||
|
this.style.background = ""
|
||||||
|
this.style.color = "var(--tan)"
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user