mirror of
				https://github.com/smartfrigde/armcord.git
				synced 2024-08-14 23:56:58 +00:00 
			
		
		
		
	Merge pull request #12 from kckarnige/main
Fixed icon, added support server hotkey, and fixed some CSS
This commit is contained in:
		
						commit
						e66603ca37
					
				
					 5 changed files with 49 additions and 22 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								discord.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								discord.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 28 KiB | 
|  | @ -10,11 +10,9 @@ | ||||||
| 
 | 
 | ||||||
|     :root { |     :root { | ||||||
|       background-color: #2c2f33; |       background-color: #2c2f33; | ||||||
|     } |       --header-secondary: #b9bbbe; | ||||||
| 
 |       --header-primary: #fff; | ||||||
|     .titlebar { |       --background-tertiary: #202225; | ||||||
|       font-family: Verdana, Geneva, Tahoma, sans-serif; |  | ||||||
|       background-color: #202225; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     body { |     body { | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								main.js
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								main.js
									
										
									
									
									
								
							|  | @ -21,7 +21,7 @@ function createWindow() { | ||||||
|   mainWindow = new BrowserWindow({ |   mainWindow = new BrowserWindow({ | ||||||
|     width: 800, |     width: 800, | ||||||
|     height: 600, |     height: 600, | ||||||
|     icon: __dirname + "/discord.ico", |     icon: __dirname + "/discord.png", | ||||||
|     title: "ArmCord", |     title: "ArmCord", | ||||||
|     frame: false, |     frame: false, | ||||||
|     webPreferences: { |     webPreferences: { | ||||||
|  |  | ||||||
							
								
								
									
										48
									
								
								preload.js
									
										
									
									
									
								
							
							
						
						
									
										48
									
								
								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(); | ||||||
|  | @ -26,10 +16,22 @@ electronLocalshortcut.register(currentWindow, "F5", () => { | ||||||
| electronLocalshortcut.register(currentWindow, "F12", () => { | electronLocalshortcut.register(currentWindow, "F12", () => { | ||||||
|   currentWindow.webContents.openDevTools(); |   currentWindow.webContents.openDevTools(); | ||||||
| }); | }); | ||||||
|  | electronLocalshortcut.register(currentWindow, "F1", () => { | ||||||
|  |   require("shell").openExternal("https://support.discord.com/") | ||||||
|  | }); | ||||||
|  | electronLocalshortcut.register(currentWindow, "F2", () => { | ||||||
|  |   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 { | ||||||
|  |   --window-buttons: var(--header-secondary); | ||||||
|  |   --cord-color: var(--header-primary); | ||||||
|  |   --armcord-color: #7289da; | ||||||
|  | } | ||||||
| .base-3dtUhz, .sidebar-2K8pFh { | .base-3dtUhz, .sidebar-2K8pFh { | ||||||
|   display: -webkit-box; |   display: -webkit-box; | ||||||
|   display: -ms-flexbox; |   display: -ms-flexbox; | ||||||
|  | @ -47,7 +49,7 @@ div.menubar[role="menubar"] { | ||||||
| 
 | 
 | ||||||
| .window-title:after { | .window-title:after { | ||||||
|   content: "Cord"; |   content: "Cord"; | ||||||
|   color: #fff; |   color: var(--cord-color) !important; | ||||||
|   font-weight: normal; |   font-weight: normal; | ||||||
|   font-size: 14px; |   font-size: 14px; | ||||||
|   font-family: Discordinated; |   font-family: Discordinated; | ||||||
|  | @ -55,7 +57,7 @@ div.menubar[role="menubar"] { | ||||||
| 
 | 
 | ||||||
| .window-title:before { | .window-title:before { | ||||||
|   content: "ARM"; |   content: "ARM"; | ||||||
|   color: #7289da; |   color: var(--armcord-color); | ||||||
|   font-weight: normal; |   font-weight: normal; | ||||||
|   font-size: 14px; |   font-size: 14px; | ||||||
|   font-family: Helvetica, sans-serif; |   font-family: Helvetica, sans-serif; | ||||||
|  | @ -68,8 +70,22 @@ div.menubar[role="menubar"] { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .titlebar { | .titlebar { | ||||||
|   background: #202225 !important; |   background: var(--background-tertiary) !important; | ||||||
|  |   font-family: Verdana, Geneva, Tahoma, sans-serif; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .titlebar .window-controls-container .window-icon { | ||||||
|  |   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