-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d5eeb1f
Showing
40 changed files
with
15,532 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
dist |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 🌌 See your brawlhalal stats instantly! | ||
|
||
- Simple app that shows your Brawlhalla stats easily! | ||
- See instant stats on your tray and detailed stats on application | ||
- Made with Electron and React |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
style: { | ||
postcss: { | ||
plugins: [require("tailwindcss"), require("autoprefixer")], | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"name": "brawlhalla-stats", | ||
"author": { | ||
"email": "demirci.baris38@gmail.com", | ||
"name": "Barış DEMİRCİ", | ||
"url": "https://bariscodes.me/" | ||
}, | ||
"description": "See your brawlhalal stats instantly!", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/barbarbar338/brawlhalla-stats" | ||
}, | ||
"license": "GPL-3.0", | ||
"version": "0.0.1", | ||
"private": true, | ||
"devDependencies": { | ||
"@craco/craco": "^6.1.1", | ||
"@tailwindcss/postcss7-compat": "^2.1.0", | ||
"@types/node": "^12.0.0", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"@types/react-router-dom": "^5.1.7", | ||
"autoprefixer": "^9", | ||
"concurrently": "^6.0.1", | ||
"cross-env": "^7.0.3", | ||
"electron": "^12.0.2", | ||
"electron-builder": "^22.10.5", | ||
"postcss": "^7", | ||
"react-scripts": "4.0.3", | ||
"tailwindcss": "npm:@tailwindcss/postcss7-compat", | ||
"typescript": "^4.1.2", | ||
"wait-on": "^5.3.0" | ||
}, | ||
"dependencies": { | ||
"@electron/remote": "^1.1.0", | ||
"@tailwindcss/forms": "^0.3.2", | ||
"auto-launch": "^5.0.5", | ||
"electron-is-dev": "^2.0.0", | ||
"electron-squirrel-startup": "^1.0.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-icons": "^4.2.0", | ||
"react-router-dom": "^5.2.0", | ||
"react-toastify": "^7.0.3", | ||
"react-use": "^17.2.3" | ||
}, | ||
"main": "public/main.js", | ||
"homepage": "./", | ||
"scripts": { | ||
"react:build": "craco build", | ||
"react:dev": "craco start", | ||
"electron:build": "electron-builder -c.extraMetadata.main=build/main.js", | ||
"electron:dev": "wait-on tcp:3000 && electron .", | ||
"build": "npm run react:build && npm run electron:build", | ||
"dev": "concurrently -k \"cross-env BROWSER=none npm run react:dev\" \"npm run electron:dev\"" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"build": { | ||
"extends": null, | ||
"appId": "com.barbarbar338.brawlhallastats", | ||
"files": [ | ||
"dist/**/*", | ||
"build/**/*", | ||
"node_modules/**/*", | ||
"package.json", | ||
"build/icon.*" | ||
], | ||
"directories": { | ||
"buildResources": "assets" | ||
}, | ||
"icon": "./build/icon.ico" | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>Brawlhalla Stats</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
const { app, BrowserWindow, Tray, Notification, Menu } = require("electron"); | ||
|
||
if (require("electron-squirrel-startup")) app.quit(); | ||
|
||
const path = require("path"); | ||
const isDev = require("electron-is-dev"); | ||
const AutoLaunch = require("auto-launch"); | ||
|
||
require("@electron/remote/main").initialize(); | ||
|
||
const autoStart = new AutoLaunch({ | ||
name: "Brawlhalla Stats", | ||
}); | ||
autoStart.enable(); | ||
|
||
const icon = path.join(__dirname, "/favicon.ico"); | ||
let tray = null; | ||
let isQuiting = false; | ||
let mainWindow = null; | ||
let popupWindow = null; | ||
|
||
function createTray() { | ||
tray = new Tray(icon); | ||
tray.setToolTip("Brawlhalla Stats"); | ||
tray.setContextMenu( | ||
Menu.buildFromTemplate([ | ||
{ | ||
label: "Show App", | ||
click: () => { | ||
if (!mainWindow.isVisible()) mainWindow.show(); | ||
}, | ||
}, | ||
{ | ||
label: "Quit", | ||
click: () => { | ||
isQuiting = true; | ||
app.quit(); | ||
}, | ||
}, | ||
]), | ||
); | ||
} | ||
|
||
function createPopupWindow() { | ||
popupWindow = new BrowserWindow({ | ||
width: 260, | ||
height: 360, | ||
x: 0, | ||
y: 0, | ||
resizable: false, | ||
alwaysOnTop: true, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
enableRemoteModule: true, | ||
devTools: isDev, | ||
contextIsolation: false, | ||
}, | ||
frame: false, | ||
icon, | ||
title: "Brawlhalla Stats", | ||
}); | ||
popupWindow.loadURL( | ||
isDev | ||
? "http://localhost:3000/#/popup" | ||
: `file://${path.join(__dirname, "../build/index.html#popup")}`, | ||
); | ||
popupWindow.hide(); | ||
popupWindow.on("close", (e) => { | ||
if (!isQuiting) { | ||
e.preventDefault(); | ||
popupWindow.hide(); | ||
} | ||
}); | ||
popupWindow.on("blur", () => { | ||
popupWindow.hide(); | ||
}); | ||
tray.on("click", (event, bounds) => { | ||
popupWindow.setPosition( | ||
bounds.x - popupWindow.getSize()[0], | ||
bounds.y - popupWindow.getSize()[1], | ||
false, | ||
); | ||
if (popupWindow.isVisible()) popupWindow.hide(); | ||
else popupWindow.show(); | ||
}); | ||
} | ||
|
||
function createWindow() { | ||
mainWindow = new BrowserWindow({ | ||
width: 800, | ||
height: 600, | ||
webPreferences: { | ||
nodeIntegration: true, | ||
enableRemoteModule: true, | ||
devTools: isDev, | ||
contextIsolation: false, | ||
}, | ||
frame: false, | ||
icon, | ||
title: "Brawlhalla Stats", | ||
}); | ||
mainWindow.loadURL( | ||
isDev | ||
? "http://localhost:3000" | ||
: `file://${path.join(__dirname, "../build/index.html")}`, | ||
); | ||
mainWindow.on("close", (e) => { | ||
if (!isQuiting) { | ||
e.preventDefault(); | ||
mainWindow.hide(); | ||
} | ||
}); | ||
} | ||
|
||
app.on("ready", () => { | ||
createWindow(); | ||
createTray(); | ||
createPopupWindow(); | ||
showNotification( | ||
"Brawlhalla Stats running on background! See application tray.", | ||
); | ||
}); | ||
|
||
app.on("window-all-closed", function () { | ||
if (process.platform !== "darwin") { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on("activate", function () { | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow(); | ||
}); | ||
|
||
function showNotification(body) { | ||
const notification = new Notification({ | ||
title: "Brawlhalla Stats", | ||
body, | ||
silent: true, | ||
timeoutType: "default", | ||
}); | ||
notification.show(); | ||
setTimeout(() => { | ||
notification.close(); | ||
}, 5000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
}, | ||
{ | ||
"src": "logo192.png", | ||
"type": "image/png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "logo512.png", | ||
"type": "image/png", | ||
"sizes": "512x512" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: |
Oops, something went wrong.