Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit 48d3e3f

Browse files
committed
added css editor
1 parent 8042f75 commit 48d3e3f

7 files changed

Lines changed: 577 additions & 6 deletions

File tree

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"devDependencies": {
33
"eslint-plugin-userscripts": "^0.4.0"
4+
},
5+
"dependencies": {
6+
"codemirror": "^6.0.1",
7+
"react-codemirror2": "^7.3.0"
48
}
59
}

userscript/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.1.0",
44
"private": true,
55
"dependencies": {
6+
"@uiw/react-textarea-code-editor": "^2.1.9",
67
"react": "^17.0.2",
78
"react-app-rewired": "^2.1.8",
89
"react-dom": "^17.0.2",

userscript/src/PlusPage.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
import React from "react";
22
import "./App.css";
33

4+
import CodeEditor from '@uiw/react-textarea-code-editor';
5+
46
function PlusPage() {
7+
function handleCSSChange(reactEvent) {
8+
localStorage.setItem("customcss", reactEvent.target.value);
9+
}
510
return (
611
<div className="App">
712
<header className="App-header">
813
<h1>SYNTAX+</h1>
9-
<p>SYNTAX+ is a userscript that brings Roblox+ features to the Syntax website.</p>
10-
<p>It is currently in development.</p>
11-
<p>Check back later!</p>
14+
<p>Custom CSS</p>
15+
<CodeEditor
16+
value={localStorage.getItem("customcss")}
17+
onChange={handleCSSChange}
18+
language="css"
19+
placeholder="/* Syntax+ Custom CSS */"
20+
/>
21+
1222
</header>
1323
</div>
1424
);

userscript/src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ async function main() {
2626
// the page has loaded enough for that element to exist.
2727

2828
// get the synplus logo
29-
29+
if (!localStorage.getItem("customcss")) {
30+
localStorage.setItem("customcss", "/* Syntax+ Custom CSS */");
31+
}
32+
// eslint-disable-next-line no-undef
33+
GM_addStyle(localStorage.getItem("customcss"));
3034
if (window.location.pathname in route_overrides) {
3135
const oldcontainer = document.getElementsByClassName("d-flex align-items-center justify-content-center")[0];
3236
deleteAllChildren(oldcontainer);

userscript/src/userscript-header.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)