aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/betterlibrary.js21
-rw-r--r--app/index.js57
-rw-r--r--app/manifest.json6
-rw-r--r--app/style.css3
4 files changed, 87 insertions, 0 deletions
diff --git a/app/betterlibrary.js b/app/betterlibrary.js
new file mode 100644
index 0000000..9649bea
--- /dev/null
+++ b/app/betterlibrary.js
@@ -0,0 +1,21 @@
+var a;
+
+function betterlibrary() {
+ if (a == undefined)
+ try {
+ a = document.getElementsByClassName("main-yourLibraryX-libraryContainer")[0];
+ console.log("setting a");
+ } catch (error) {
+
+ }
+ try {
+ setTimeout(() => {
+ document.getElementsByClassName("betterlibheader")[0].prepend(a);
+ // document.getElementsByClassName("main-yourLibraryX-entryPoints")[0].appendChild(a);
+ }, 100);
+ console.log("did not catch");
+ } catch (error) {
+ console.log("catch!!");
+ console.error(error);
+ }
+} \ No newline at end of file
diff --git a/app/index.js b/app/index.js
new file mode 100644
index 0000000..b6f1a9b
--- /dev/null
+++ b/app/index.js
@@ -0,0 +1,57 @@
+// Grab any variables you need
+const react = Spicetify.React;
+const reactDOM = Spicetify.ReactDOM;
+const {
+ URI,
+ React: { useState, useEffect, useCallback },
+ Platform: { History },
+} = Spicetify;
+
+// The main custom app render function. The component returned is what is rendered in Spotify.
+function render() {
+ betterlibrary();
+ return react.createElement(Grid, { title: "loading..." });
+}
+
+// Our main component
+class Grid extends react.Component {
+ constructor(props) {
+ super(props);
+ Object.assign(this, props);
+ this.state = {
+ foo: "bar",
+ data: "etc"
+ };
+ // console.log("test");
+ }
+
+ render() {
+ return react.createElement("section", {
+ className: "contentSpacing",
+ },
+ react.createElement("div", {
+ className: "betterlibheader",
+ }, react.createElement("h1", null, this.props.title),
+ ),
+ );
+ // ), react.createElement("div", {
+ // id: "marketplace-grid",
+ // className: "main-gridContainer-gridContainer",
+ // "data-tab": CONFIG.activeTab,
+ // style: {
+ // "--minimumColumnWidth": "180px",
+ // },
+ // }, [...cardList]),
+ // react.createElement("footer", {
+ // style: {
+ // margin: "auto",
+ // textAlign: "center",
+ // },
+ // }, !this.state.endOfList && (this.state.rest ? react.createElement(LoadMoreIcon, { onClick: this.loadMore.bind(this) }) : react.createElement(LoadingIcon)),
+ // ), react.createElement(TopBarContent, {
+ // switchCallback: this.switchTo.bind(this),
+ // links: CONFIG.tabs,
+ // activeLink: CONFIG.activeTab,
+ // });
+ }
+} \ No newline at end of file
diff --git a/app/manifest.json b/app/manifest.json
new file mode 100644
index 0000000..2431a42
--- /dev/null
+++ b/app/manifest.json
@@ -0,0 +1,6 @@
+{
+ "name": "betterlibrary",
+ "icon": "<svg role=\"img\" height=\"24\" width=\"24\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-encore-id=\"icon\" class=\"Svg-sc-ytk21e-0 Svg-img-24-icon\"><path d=\"M14.5 2.134a1 1 0 0 1 1 0l6 3.464a1 1 0 0 1 .5.866V21a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1V3a1 1 0 0 1 .5-.866zM16 4.732V20h4V7.041l-4-2.309zM3 22a1 1 0 0 1-1-1V3a1 1 0 0 1 2 0v18a1 1 0 0 1-1 1zm6 0a1 1 0 0 1-1-1V3a1 1 0 0 1 2 0v18a1 1 0 0 1-1 1z\"></path></svg>",
+ "active-icon": "<svg role=\"img\" height=\"24\" width=\"24\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" data-encore-id=\"icon\" class=\"Svg-sc-ytk21e-0 Svg-img-24-icon\"><path d=\"M3 22a1 1 0 0 1-1-1V3a1 1 0 0 1 2 0v18a1 1 0 0 1-1 1zM15.5 2.134A1 1 0 0 0 14 3v18a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V6.464a1 1 0 0 0-.5-.866l-6-3.464zM9 2a1 1 0 0 0-1 1v18a1 1 0 1 0 2 0V3a1 1 0 0 0-1-1z\"></path></svg>",
+ "subfiles_extension": ["betterlibrary.js"]
+} \ No newline at end of file
diff --git a/app/style.css b/app/style.css
new file mode 100644
index 0000000..d6d155b
--- /dev/null
+++ b/app/style.css
@@ -0,0 +1,3 @@
+.betterlibheader{
+ margin: 0 calc(-.5 * var(--content-spacing));
+} \ No newline at end of file