Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- Talll's Configurable Theme
- Made By Talll for Synapse X
- defaults are what talll uses
- DONT EDIT THIS FILE UNLESS YOU HAVE TO!!!! IMPORTANT
- EDIT themeconfig.js
- -->
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- html,
- body {
- width: 99.80%;
- height: 99.50%;
- margin: 0;
- padding: 0;
- overflow: hidden;
- }
- img {
- position: absolute;
- z-index: -1;
- width: 100%;
- height: 100%;
- }
- </style>
- <meta charset="utf-8" />
- <title></title>
- </head>
- <body>
- <img src="https://thumbs.gfycat.com/AnnualMildArchaeopteryx-size_restricted.gif" />
- <div id="container" style="width:100%;height:100%;"></div>
- <script src="vs/loader.js"></script>
- <script type="text/javascript" src="themeconfig.js"></script>
- <script type="text/javascript">
- var ad = false
- var romanMatrix = [
- [1000, 'M'],
- [900, 'CM'],
- [500, 'D'],
- [400, 'CD'],
- [100, 'C'],
- [90, 'XC'],
- [50, 'L'],
- [40, 'XL'],
- [10, 'X'],
- [9, 'IX'],
- [5, 'V'],
- [4, 'IV'],
- [1, 'I']
- ];
- function convertToRoman(num) {
- if (num === 0) {
- return '';
- }
- for (var i = 0; i < romanMatrix.length; i++) {
- if (num >= romanMatrix[i][0]) {
- return romanMatrix[i][1] + convertToRoman(num - romanMatrix[i][0]);
- }
- }
- }
- //dont touch me
- require.config({
- paths: {
- 'vs': 'vs'
- }
- });
- // API
- var GetText;
- var SetText;
- var SetTheme;
- var SetScroll;
- var ShowErr;
- var Refresh;
- // Enablers
- var SwitchMinimap;
- var SwitchReadonly;
- var SwitchRenderWhitespace;
- var SwitchLinks;
- var SwitchLineHeight;
- var SwitchFontSize;
- var SwitchFolding;
- var SwitchAutoIndent;
- var SwitchFontFamily;
- var SwitchFontLigatures;
- var AddIntellisense;
- // Variables
- var editor;
- var Proposals = [];
- require(['vs/editor/editor.main'], function () {
- function getDependencyProposals() {
- return Proposals;
- }
- monaco.languages.registerCompletionItemProvider('lua', {
- provideCompletionItems: function (model, position) {
- return getDependencyProposals();
- }
- });
- //theme options if u wanna customize colors
- //i reccomend https://coolors.co/ for palletes and just google for a color picker
- monaco.editor.defineTheme('net-theme-dark', {
- base: 'vs-dark',
- inherit: true,
- rules: [
- // colors for globals like print
- {
- token: 'global',
- foreground: config.GlobalColor.replace("#", ""),
- fontStyle: "Italic"
- },
- //colors for keywords like local
- {
- token: 'keyword',
- foreground: config.KeywordColor.replace("#", ""),
- fontStyle: "Italic"
- },
- //colors for comments
- {
- token: 'comment',
- foreground: config.CommentColor.replace("#", ""),
- },
- //colors for numbers
- {
- token: 'number',
- foreground: config.NumberColor.replace("#", ""),
- },
- //colors for strings (the stuff in "" lol)
- {
- token: 'string',
- foreground: config.StringColor.replace("#", "")
- },
- ],
- colors: {
- //line number color
- 'editorLineNumber.foreground': config.LineNumberColor,
- //background color for the editor
- 'editor.background': config.BackgroundColor,
- }
- });
- //editor initialization ony edit if u know about it
- editor = monaco.editor.create(document.getElementById('container'), {
- value: [
- "Talll's",
- " Theme",
- "Engine",
- ].join('\n'),
- language: 'lua',
- theme: "net-theme-dark",
- folding: true,
- // uncomment me for roman numeral line numbers lineNumbers: convertToRoman,
- scrollbar: {
- verticalHasArrows: true,
- },
- dragAndDrop: true,
- links: false,
- minimap: {
- enabled: false,
- },
- //uncomment me to make line numbers roman numerals lineNumbers: convertToRoman,
- showFoldingControls: "always",
- smoothScrolling: true,
- });
- //ONLY EDIT THIS IF YOU KNOW WHAT UR DOING
- window.onresize = function () {
- editor.layout();
- };
- GetText = function () {
- return editor.getValue();
- }
- SetText = function (x) {
- editor.setValue(x);
- }
- SetTheme = function (themeName) {
- if (themeName == "Dark") {
- monaco.editor.setTheme("net-theme-dark");
- }
- }
- SwitchMinimap = function (flag) {
- editor.updateOptions({
- minimap: {
- enabled: flag,
- }
- });
- }
- SwitchReadonly = function (flag) {
- editor.updateOptions({
- readOnly: flag,
- });
- }
- SwitchRenderWhitespace = function (op) {
- editor.updateOptions({
- renderWhitespace: op,
- });
- }
- SwitchLinks = function (flag) {
- editor.updateOptions({
- links: flag,
- });
- }
- SwitchLineHeight = function (num) {
- editor.updateOptions({
- lineHeight: num,
- });
- }
- SwitchFontSize = function (num) {
- editor.updateOptions({
- fontSize: config.FontSize,
- });
- }
- SwitchFolding = function (flag) {
- editor.updateOptions({
- folding: flag,
- });
- }
- SwitchAutoIndent = function (flag) {
- editor.updateOptions({
- autoIndent: flag,
- });
- }
- SwitchFontFamily = function (name) {
- editor.updateOptions({
- fontFamily: config.Font,
- });
- }
- SwitchFontLigatures = function (flag) {
- editor.updateOptions({
- fontLigatures: flag,
- });
- }
- ShowErr = function (line, column, endline, endcolumn, errMessage) {
- editor.revealPositionInCenter({
- lineNumber: line,
- column: column
- });
- editor.deltaDecorations([], [{
- range: new monaco.Range(line, column, endline, endcolumn),
- options: {
- inlineClassName: 'squiggly-error',
- hoverMessage: {
- value: errMessage,
- }
- },
- }, ]);
- }
- AddIntellisense = function (l, k, d, i) {
- var t;
- switch (k) {
- case "Class":
- t = monaco.languages.CompletionItemKind.Class;
- break;
- case "Color":
- t = monaco.languages.CompletionItemKind.Color;
- break;
- case "Constructor":
- t = monaco.languages.CompletionItemKind.Constructor;
- break;
- case "Enum":
- t = monaco.languages.CompletionItemKind.Enum;
- break;
- case "Field":
- t = monaco.languages.CompletionItemKind.Field;
- break;
- case "File":
- t = monaco.languages.CompletionItemKind.File;
- break;
- case "Folder":
- t = monaco.languages.CompletionItemKind.Folder;
- break;
- case "Function":
- t = monaco.languages.CompletionItemKind.Function;
- break;
- case "Interface":
- t = monaco.languages.CompletionItemKind.Interface;
- break;
- case "Keyword":
- t = monaco.languages.CompletionItemKind.Keyword;
- break;
- case "Method":
- t = monaco.languages.CompletionItemKind.Method;
- break;
- case "Module":
- t = monaco.languages.CompletionItemKind.Module;
- break;
- case "Property":
- t = monaco.languages.CompletionItemKind.Property;
- break;
- case "Reference":
- t = monaco.languages.CompletionItemKind.Reference;
- break;
- case "Snippet":
- t = monaco.languages.CompletionItemKind.Snippet;
- break;
- case "Text":
- t = monaco.languages.CompletionItemKind.Text;
- break;
- case "Unit":
- t = monaco.languages.CompletionItemKind.Unit;
- break;
- case "Value":
- t = monaco.languages.CompletionItemKind.Value;
- break;
- case "Variable":
- t = monaco.languages.CompletionItemKind.Variable;
- break;
- }
- Proposals.push({
- label: l,
- kind: t,
- detail: d,
- insertText: i
- });
- }
- SetScroll = function (line) {
- editor.revealLineInCenter({
- lineNumber: line
- });
- }
- Refresh = function () {
- var text = getText();
- setText("Talll's Theme Refreshed");
- editor.trigger('keyboard', 'type', {
- text: text
- });
- }
- //custom commands
- var myBinding = editor.addCommand(monaco.KeyCode.F9, function () {
- alert(
- 'You found my secret web browser! This lets you control the synapse location and can only be used once without restarting. HTTP IS REQUIRED START ALL URLS WITH "http://"'
- );
- var loc = prompt(
- 'Enter a URL or undefined for Google. MUST PUT "http://" before all urls not my fault if u have to restart synapse.'
- );
- if (loc == 'undefined') {
- window.location('https://google.com');
- } else {
- window.location(loc);
- };
- });
- var myBinding2 = editor.addCommand(monaco.KeyCode.F10, function () {
- alert('Welcome to the help page!')
- alert('Currently you can press F9 for web browsing {kinda} and F10 for help. Enjoy the Theme!')
- });
- setTimeout(function () {
- if (!config.AlertText === '') {
- alert(config.AlertText);
- }
- if (!config.DefaultText === ''){
- SetText(config.DefaultText);
- }
- document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundImage="url(" + config.BackgroundImage + ")"
- document.getElementsByClassName("margin")[0].style.backgroundImage="url(" + config.BackgroundImage + ")"
- document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundRepeat = "no-repeat"
- document.getElementsByClassName("margin")[0].style.backgroundRepeat = "no-repeat"
- document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundAttachment = "fixed"
- document.getElementsByClassName("margin")[0].style.backgroundAttachment = "fixed"
- document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundSize = "cover"
- document.getElementsByClassName("margin")[0].style.backgroundSize = "cover"
- }, 5000);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement