Advertisement
Colornapse_Themes

Untitled

Nov 10th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. Talll's Configurable Theme
  4. Made By Talll for Synapse X
  5. defaults are what talll uses
  6. DONT EDIT THIS FILE UNLESS YOU HAVE TO!!!! IMPORTANT
  7. EDIT themeconfig.js
  8. -->
  9. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  10.  
  11. <head>
  12. <style type="text/css">
  13. html,
  14. body {
  15. width: 99.80%;
  16. height: 99.50%;
  17. margin: 0;
  18. padding: 0;
  19. overflow: hidden;
  20. }
  21.  
  22. img {
  23. position: absolute;
  24. z-index: -1;
  25. width: 100%;
  26. height: 100%;
  27. }
  28. </style>
  29. <meta charset="utf-8" />
  30. <title></title>
  31. </head>
  32.  
  33. <body>
  34. <img src="https://thumbs.gfycat.com/AnnualMildArchaeopteryx-size_restricted.gif" />
  35. <div id="container" style="width:100%;height:100%;"></div>
  36. <script src="vs/loader.js"></script>
  37. <script type="text/javascript" src="themeconfig.js"></script>
  38. <script type="text/javascript">
  39. var ad = false
  40. var romanMatrix = [
  41. [1000, 'M'],
  42. [900, 'CM'],
  43. [500, 'D'],
  44. [400, 'CD'],
  45. [100, 'C'],
  46. [90, 'XC'],
  47. [50, 'L'],
  48. [40, 'XL'],
  49. [10, 'X'],
  50. [9, 'IX'],
  51. [5, 'V'],
  52. [4, 'IV'],
  53. [1, 'I']
  54. ];
  55.  
  56. function convertToRoman(num) {
  57. if (num === 0) {
  58. return '';
  59. }
  60. for (var i = 0; i < romanMatrix.length; i++) {
  61. if (num >= romanMatrix[i][0]) {
  62. return romanMatrix[i][1] + convertToRoman(num - romanMatrix[i][0]);
  63. }
  64. }
  65. }
  66. //dont touch me
  67. require.config({
  68. paths: {
  69. 'vs': 'vs'
  70. }
  71. });
  72. // API
  73. var GetText;
  74. var SetText;
  75. var SetTheme;
  76. var SetScroll;
  77. var ShowErr;
  78. var Refresh;
  79.  
  80. // Enablers
  81. var SwitchMinimap;
  82. var SwitchReadonly;
  83. var SwitchRenderWhitespace;
  84. var SwitchLinks;
  85. var SwitchLineHeight;
  86. var SwitchFontSize;
  87. var SwitchFolding;
  88. var SwitchAutoIndent;
  89. var SwitchFontFamily;
  90. var SwitchFontLigatures;
  91. var AddIntellisense;
  92.  
  93. // Variables
  94. var editor;
  95. var Proposals = [];
  96.  
  97. require(['vs/editor/editor.main'], function () {
  98. function getDependencyProposals() {
  99. return Proposals;
  100. }
  101.  
  102. monaco.languages.registerCompletionItemProvider('lua', {
  103. provideCompletionItems: function (model, position) {
  104. return getDependencyProposals();
  105. }
  106. });
  107.  
  108.  
  109. //theme options if u wanna customize colors
  110. //i reccomend https://coolors.co/ for palletes and just google for a color picker
  111. monaco.editor.defineTheme('net-theme-dark', {
  112. base: 'vs-dark',
  113. inherit: true,
  114. rules: [
  115. // colors for globals like print
  116. {
  117. token: 'global',
  118. foreground: config.GlobalColor.replace("#", ""),
  119. fontStyle: "Italic"
  120. },
  121. //colors for keywords like local
  122. {
  123. token: 'keyword',
  124. foreground: config.KeywordColor.replace("#", ""),
  125. fontStyle: "Italic"
  126. },
  127. //colors for comments
  128. {
  129. token: 'comment',
  130. foreground: config.CommentColor.replace("#", ""),
  131. },
  132. //colors for numbers
  133. {
  134. token: 'number',
  135. foreground: config.NumberColor.replace("#", ""),
  136. },
  137. //colors for strings (the stuff in "" lol)
  138. {
  139. token: 'string',
  140. foreground: config.StringColor.replace("#", "")
  141. },
  142. ],
  143. colors: {
  144. //line number color
  145. 'editorLineNumber.foreground': config.LineNumberColor,
  146. //background color for the editor
  147. 'editor.background': config.BackgroundColor,
  148.  
  149. }
  150. });
  151. //editor initialization ony edit if u know about it
  152. editor = monaco.editor.create(document.getElementById('container'), {
  153. value: [
  154. "Talll's",
  155. " Theme",
  156. "Engine",
  157. ].join('\n'),
  158. language: 'lua',
  159. theme: "net-theme-dark",
  160. folding: true,
  161. // uncomment me for roman numeral line numbers lineNumbers: convertToRoman,
  162. scrollbar: {
  163. verticalHasArrows: true,
  164. },
  165. dragAndDrop: true,
  166. links: false,
  167. minimap: {
  168. enabled: false,
  169. },
  170. //uncomment me to make line numbers roman numerals lineNumbers: convertToRoman,
  171. showFoldingControls: "always",
  172. smoothScrolling: true,
  173.  
  174. });
  175. //ONLY EDIT THIS IF YOU KNOW WHAT UR DOING
  176. window.onresize = function () {
  177. editor.layout();
  178. };
  179.  
  180. GetText = function () {
  181. return editor.getValue();
  182. }
  183.  
  184. SetText = function (x) {
  185. editor.setValue(x);
  186. }
  187.  
  188. SetTheme = function (themeName) {
  189. if (themeName == "Dark") {
  190. monaco.editor.setTheme("net-theme-dark");
  191. }
  192.  
  193. }
  194.  
  195. SwitchMinimap = function (flag) {
  196. editor.updateOptions({
  197. minimap: {
  198. enabled: flag,
  199. }
  200. });
  201. }
  202.  
  203. SwitchReadonly = function (flag) {
  204. editor.updateOptions({
  205. readOnly: flag,
  206. });
  207. }
  208.  
  209. SwitchRenderWhitespace = function (op) {
  210. editor.updateOptions({
  211. renderWhitespace: op,
  212. });
  213. }
  214.  
  215. SwitchLinks = function (flag) {
  216. editor.updateOptions({
  217. links: flag,
  218. });
  219. }
  220.  
  221. SwitchLineHeight = function (num) {
  222. editor.updateOptions({
  223. lineHeight: num,
  224. });
  225. }
  226.  
  227. SwitchFontSize = function (num) {
  228. editor.updateOptions({
  229. fontSize: config.FontSize,
  230. });
  231. }
  232.  
  233. SwitchFolding = function (flag) {
  234. editor.updateOptions({
  235. folding: flag,
  236. });
  237. }
  238.  
  239. SwitchAutoIndent = function (flag) {
  240. editor.updateOptions({
  241. autoIndent: flag,
  242. });
  243. }
  244.  
  245. SwitchFontFamily = function (name) {
  246. editor.updateOptions({
  247. fontFamily: config.Font,
  248. });
  249. }
  250.  
  251. SwitchFontLigatures = function (flag) {
  252. editor.updateOptions({
  253. fontLigatures: flag,
  254. });
  255. }
  256.  
  257.  
  258. ShowErr = function (line, column, endline, endcolumn, errMessage) {
  259. editor.revealPositionInCenter({
  260. lineNumber: line,
  261. column: column
  262. });
  263. editor.deltaDecorations([], [{
  264. range: new monaco.Range(line, column, endline, endcolumn),
  265. options: {
  266. inlineClassName: 'squiggly-error',
  267. hoverMessage: {
  268. value: errMessage,
  269. }
  270. },
  271. }, ]);
  272. }
  273.  
  274. AddIntellisense = function (l, k, d, i) {
  275. var t;
  276. switch (k) {
  277. case "Class":
  278. t = monaco.languages.CompletionItemKind.Class;
  279. break;
  280. case "Color":
  281. t = monaco.languages.CompletionItemKind.Color;
  282. break;
  283. case "Constructor":
  284. t = monaco.languages.CompletionItemKind.Constructor;
  285. break;
  286. case "Enum":
  287. t = monaco.languages.CompletionItemKind.Enum;
  288. break;
  289. case "Field":
  290. t = monaco.languages.CompletionItemKind.Field;
  291. break;
  292. case "File":
  293. t = monaco.languages.CompletionItemKind.File;
  294. break;
  295. case "Folder":
  296. t = monaco.languages.CompletionItemKind.Folder;
  297. break;
  298. case "Function":
  299. t = monaco.languages.CompletionItemKind.Function;
  300. break;
  301. case "Interface":
  302. t = monaco.languages.CompletionItemKind.Interface;
  303. break;
  304. case "Keyword":
  305. t = monaco.languages.CompletionItemKind.Keyword;
  306. break;
  307. case "Method":
  308. t = monaco.languages.CompletionItemKind.Method;
  309. break;
  310. case "Module":
  311. t = monaco.languages.CompletionItemKind.Module;
  312. break;
  313. case "Property":
  314. t = monaco.languages.CompletionItemKind.Property;
  315. break;
  316. case "Reference":
  317. t = monaco.languages.CompletionItemKind.Reference;
  318. break;
  319. case "Snippet":
  320. t = monaco.languages.CompletionItemKind.Snippet;
  321. break;
  322. case "Text":
  323. t = monaco.languages.CompletionItemKind.Text;
  324. break;
  325. case "Unit":
  326. t = monaco.languages.CompletionItemKind.Unit;
  327. break;
  328. case "Value":
  329. t = monaco.languages.CompletionItemKind.Value;
  330. break;
  331. case "Variable":
  332. t = monaco.languages.CompletionItemKind.Variable;
  333. break;
  334. }
  335.  
  336. Proposals.push({
  337. label: l,
  338. kind: t,
  339. detail: d,
  340. insertText: i
  341. });
  342. }
  343.  
  344. SetScroll = function (line) {
  345. editor.revealLineInCenter({
  346. lineNumber: line
  347. });
  348. }
  349.  
  350. Refresh = function () {
  351. var text = getText();
  352. setText("Talll's Theme Refreshed");
  353. editor.trigger('keyboard', 'type', {
  354. text: text
  355. });
  356. }
  357. //custom commands
  358. var myBinding = editor.addCommand(monaco.KeyCode.F9, function () {
  359.  
  360. alert(
  361. '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://"'
  362. );
  363. var loc = prompt(
  364. 'Enter a URL or undefined for Google. MUST PUT "http://" before all urls not my fault if u have to restart synapse.'
  365. );
  366. if (loc == 'undefined') {
  367. window.location('https://google.com');
  368. } else {
  369. window.location(loc);
  370. };
  371. });
  372. var myBinding2 = editor.addCommand(monaco.KeyCode.F10, function () {
  373. alert('Welcome to the help page!')
  374. alert('Currently you can press F9 for web browsing {kinda} and F10 for help. Enjoy the Theme!')
  375.  
  376. });
  377. setTimeout(function () {
  378. if (!config.AlertText === '') {
  379. alert(config.AlertText);
  380. }
  381. if (!config.DefaultText === ''){
  382. SetText(config.DefaultText);
  383. }
  384. document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundImage="url(" + config.BackgroundImage + ")"
  385. document.getElementsByClassName("margin")[0].style.backgroundImage="url(" + config.BackgroundImage + ")"
  386. document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundRepeat = "no-repeat"
  387. document.getElementsByClassName("margin")[0].style.backgroundRepeat = "no-repeat"
  388. document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundAttachment = "fixed"
  389. document.getElementsByClassName("margin")[0].style.backgroundAttachment = "fixed"
  390. document.getElementsByClassName("lines-content monaco-editor-background")[0].style.backgroundSize = "cover"
  391. document.getElementsByClassName("margin")[0].style.backgroundSize = "cover"
  392.  
  393. }, 5000);
  394. });
  395. </script>
  396. </body>
  397.  
  398. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement