aboutsummaryrefslogtreecommitdiff
path: root/src/components/monacoWin.html
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-22 04:41:33 +0200
committerVendicated <vendicated@riseup.net>2022-10-22 04:42:54 +0200
commit44f6f71c3efd2e4e0f9dbd97ab4680ec76536052 (patch)
treecd2ad847833ff428e009ca55b50eabd57031443d /src/components/monacoWin.html
parent23d4cae1230bd60da2f0497ecac9d4a32a326f5b (diff)
downloadVencord-44f6f71c3efd2e4e0f9dbd97ab4680ec76536052.tar.gz
Vencord-44f6f71c3efd2e4e0f9dbd97ab4680ec76536052.tar.bz2
Vencord-44f6f71c3efd2e4e0f9dbd97ab4680ec76536052.zip
Monaco for Discord Desktop
Diffstat (limited to 'src/components/monacoWin.html')
-rw-r--r--src/components/monacoWin.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/components/monacoWin.html b/src/components/monacoWin.html
new file mode 100644
index 0000000..edf273d
--- /dev/null
+++ b/src/components/monacoWin.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <title>QuickCss Editor</title>
+ <link rel="stylesheet" data-name="vs/editor/editor.main"
+ href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs/editor/editor.main.min.css">
+ <style>
+ html,
+ body,
+ #container {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ }
+ </style>
+</head>
+
+<body>
+ <div id="container"></div>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs/loader.min.js"></script>
+
+ <script>
+ require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs' } });
+ require(["vs/editor/editor.main"], () => {
+ getCurrentCss().then(css => {
+ var editor = monaco.editor.create(document.getElementById('container'), {
+ value: css,
+ language: 'css',
+ theme: getTheme(),
+ });
+ editor.onDidChangeModelContent(() =>
+ setCss(editor.getValue())
+ );
+ window.addEventListener("resize", () => {
+ // make monaco re-layout
+ editor.layout();
+ });
+ });
+ });
+
+
+ </script>
+</body>
+
+</html>