mirror of
				https://github.com/smartfrigde/armcord.git
				synced 2024-08-14 23:56:58 +00:00 
			
		
		
		
	Made a new ArmCord module :D
This commit is contained in:
		
							parent
							
								
									72ab64ee21
								
							
						
					
					
						commit
						4beef1a9c4
					
				
					 2 changed files with 26 additions and 12 deletions
				
			
		
							
								
								
									
										25
									
								
								preload.js
									
										
									
									
									
								
							
							
						
						
									
										25
									
								
								preload.js
									
										
									
									
									
								
							|  | @ -1,6 +1,7 @@ | ||||||
| const customTitlebar = require('custom-electron-titlebar') | const customTitlebar = require('custom-electron-titlebar') | ||||||
| const electronLocalshortcut = require("electron-localshortcut"); | const electronLocalshortcut = require("electron-localshortcut"); | ||||||
| const { remote } = require("electron"); | const { remote } = require("electron"); | ||||||
|  | const ArmCord = require("./utils/ArmCord.js") | ||||||
| 
 | 
 | ||||||
| window.addEventListener('DOMContentLoaded', () => { | window.addEventListener('DOMContentLoaded', () => { | ||||||
|   new customTitlebar.Titlebar({ |   new customTitlebar.Titlebar({ | ||||||
|  | @ -8,17 +9,6 @@ window.addEventListener('DOMContentLoaded', () => { | ||||||
|     menu: false, |     menu: false, | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
| /** |  | ||||||
|  * Utility function to add CSS in multiple passes. |  | ||||||
|  * @param {string} styleString |  | ||||||
|  */ |  | ||||||
|  function addStyle(styleString) { |  | ||||||
|   const style = document.createElement('style'); |  | ||||||
|   style.textContent = styleString; |  | ||||||
|   document.head.append(style); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| const currentWindow = remote.getCurrentWindow(); | const currentWindow = remote.getCurrentWindow(); | ||||||
| electronLocalshortcut.register(currentWindow, "F5", () => { | electronLocalshortcut.register(currentWindow, "F5", () => { | ||||||
|   location.reload(); |   location.reload(); | ||||||
|  | @ -33,7 +23,8 @@ electronLocalshortcut.register(currentWindow, "F2", () => { | ||||||
|   window.location.href = "https://discord.com/invite/F25bc4RYDt" |   window.location.href = "https://discord.com/invite/F25bc4RYDt" | ||||||
| }); | }); | ||||||
| require("./utils/capturer.js") | require("./utils/capturer.js") | ||||||
| addStyle(` | 
 | ||||||
|  | ArmCord.addStyle(` | ||||||
| @import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); | @import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); | ||||||
| 
 | 
 | ||||||
| :root { | :root { | ||||||
|  | @ -87,4 +78,14 @@ div.menubar[role="menubar"] { | ||||||
|   background: var(--window-buttons) !important; |   background: var(--window-buttons) !important; | ||||||
| } | } | ||||||
| `);
 | `);
 | ||||||
|  | 
 | ||||||
|  | ArmCord.addStyle(`.info-1VyQPT:last-child:before {
 | ||||||
|  |   content: "ArmCord Version: ` + ArmCord.Version + `"; | ||||||
|  |   height: auto; | ||||||
|  |   line-height: 16px; | ||||||
|  |   text-align: center; | ||||||
|  |   color: var(--text-muted); | ||||||
|  |   font-size: 12px; | ||||||
|  |   text-transform: none; | ||||||
|  | }`);
 | ||||||
| }) | }) | ||||||
|  |  | ||||||
							
								
								
									
										13
									
								
								utils/ArmCord.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								utils/ArmCord.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | exports.Version = "DevBuild"; | ||||||
|  |    | ||||||
|  | exports.addStyle = function(styleString) { | ||||||
|  |  const style = document.createElement('style'); | ||||||
|  |  style.textContent = styleString; | ||||||
|  |  document.head.append(style); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | exports.addScript = function(scriptString) { | ||||||
|  |   var script = document.createElement('script'); | ||||||
|  |   script.textContent = scriptString; | ||||||
|  |   document.body.append(script); | ||||||
|  | }; | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue