-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: group css & js in public/components (#294)
- Loading branch information
Showing
63 changed files
with
1,140 additions
and
1,154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
test/fixtures | ||
public/js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
span.expandable { | ||
display: flex; | ||
align-items: center !important; | ||
justify-content: center !important; | ||
height: 35px; | ||
font-size: 13px; | ||
font-family: "mononoki"; | ||
background: none; | ||
color: #00B0FF; | ||
text-shadow: 1px 1px 1px rgba(20, 20, 20, 0.5); | ||
transition: all 0.2s linear; | ||
margin-top: 5px; | ||
} | ||
|
||
span.expandable[data-value="opened"] { | ||
color: #F44336 !important; | ||
} | ||
|
||
span.expandable:hover { | ||
cursor: pointer; | ||
} | ||
|
||
span.expandable i { | ||
margin-right: 4px; | ||
margin-top: 1px; | ||
} | ||
|
||
/** | ||
* CUSTOM CSS | ||
*/ | ||
.package-scripts>.expandable { | ||
margin-top: 10px; | ||
} | ||
|
||
.home--body .expandable { | ||
text-shadow: none; | ||
font-size: 15px; | ||
color: var(--secondary-darker); | ||
flex-grow: 1; | ||
flex-basis: 100%; | ||
margin-top: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Import Internal Dependencies | ||
import { createDOMElement } from "../../common/utils"; | ||
|
||
export function createExpandableSpan( | ||
hideItemsLength, | ||
onclick = () => void 0 | ||
) { | ||
const span = createDOMElement("span", { | ||
classList: ["expandable"], | ||
attributes: { "data-value": "closed" }, | ||
childs: [ | ||
createDOMElement("i", { className: "icon-plus-squared-alt" }), | ||
createDOMElement("p", { text: "show more" }) | ||
] | ||
}); | ||
span.addEventListener("click", function itemListClickAction() { | ||
const isClosed = this.getAttribute("data-value") === "closed"; | ||
{ | ||
const innerI = this.querySelector("i"); | ||
innerI.classList.remove(isClosed ? "icon-plus-squared-alt" : "icon-minus-squared-alt"); | ||
innerI.classList.add(isClosed ? "icon-minus-squared-alt" : "icon-plus-squared-alt"); | ||
} | ||
this.querySelector("p").textContent = isClosed ? "show less" : "show more"; | ||
this.setAttribute("data-value", isClosed ? "opened" : "closed"); | ||
|
||
for (let id = 0; id < this.parentNode.childNodes.length; id++) { | ||
const node = this.parentNode.childNodes[id]; | ||
if (node !== this) { | ||
if (isClosed) { | ||
node.classList.remove("hidden"); | ||
} | ||
else if (id >= hideItemsLength) { | ||
node.classList.add("hidden"); | ||
} | ||
} | ||
} | ||
onclick(this); | ||
}); | ||
|
||
return span; | ||
} |
Oops, something went wrong.