From a2cf4228528a08968f80188a2968307aa008902f Mon Sep 17 00:00:00 2001
From: Sowgro <69283684+Sowgro@users.noreply.github.com>
Date: Mon, 11 Sep 2023 16:03:52 -0400
Subject: First Commit
---
README.md | 2 +-
app/betterlibrary.js | 21 +++++++++++++++++++
app/index.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
app/manifest.json | 6 ++++++
app/style.css | 3 +++
manifest.json | 11 ++++++++++
preview.png | Bin 0 -> 479759 bytes
7 files changed, 99 insertions(+), 1 deletion(-)
create mode 100644 app/betterlibrary.js
create mode 100644 app/index.js
create mode 100644 app/manifest.json
create mode 100644 app/style.css
create mode 100644 manifest.json
create mode 100644 preview.png
diff --git a/README.md b/README.md
index dd8ba55..e85c8c8 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,2 @@
# betterLibrary
-A Spicetify app which allows the library to be opened in the center pane, similar to how you could before the redesign
+A Spicetify app which allows the library to be opened in the center pane, similar to how you could before the redesign
\ No newline at end of file
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": "",
+ "active-icon": "",
+ "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
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 0000000..98ab748
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,11 @@
+{
+ "name": "betterLibrary",
+ "description": "Allows the library to be opened in the center pane, similar to how you could before the redesign",
+ "preview": "preview.png",
+ "readme": "README.md",
+ "branch": "main",
+ "authors": [
+ { "name": "sowgro", "url": "https://sowgro.net/" }
+ ],
+ "tags": ["library"]
+}
\ No newline at end of file
diff --git a/preview.png b/preview.png
new file mode 100644
index 0000000..b29feaf
Binary files /dev/null and b/preview.png differ
--
cgit v1.2.3