diff --git a/electron/package-lock.json b/electron/package-lock.json index 278d492..ed77260 100644 --- a/electron/package-lock.json +++ b/electron/package-lock.json @@ -1,6 +1,6 @@ { "name": "boosted-app", - "version": "1.0.0", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -977,6 +977,11 @@ "dev": true, "optional": true }, + "bootstrap": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", + "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/electron/package.json b/electron/package.json index 7fb35c5..3e3dac5 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,7 +1,7 @@ { "name": "boosted-app", "productName": "boosted-app", - "version": "1.1.0", + "version": "1.2.0", "description": "League Queue notifications", "main": "src/index.js", "scripts": { @@ -61,6 +61,7 @@ } }, "dependencies": { + "bootstrap": "^4.4.1", "custom-electron-titlebar": "^3.2.2-hotfix62", "edit-json-file": "^1.4.0", "electron-squirrel-startup": "^1.0.0", diff --git a/electron/src/config.html b/electron/src/config.html index 5ceafdb..2754b1f 100644 --- a/electron/src/config.html +++ b/electron/src/config.html @@ -2,65 +2,122 @@ - - Boosted: Configuration - - - - - - - - - - - - - - + + Boosted: Configuration + + + + + + + + + + + + + + + + + + + -
-
-
-
-
-
-
- 🏗 Configuration -

-
-
-
- - -
-
- - -
-
- -
- test pushed id - cancel - save and exit -
+
+
+
+
+
+

Configuration

+

+
+
+
+
+ + + +
+
+ + +
+
+ +
+ + + +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/electron/src/config.js b/electron/src/config.js index b057829..83d0a99 100644 --- a/electron/src/config.js +++ b/electron/src/config.js @@ -6,7 +6,7 @@ const jsonEdit = require("edit-json-file"); new customTitlebar.Titlebar({ - backgroundColor: customTitlebar.Color.fromHex('#333333'), + backgroundColor: customTitlebar.Color.fromHex('#121212'), menu: null, icon: "../resources/icons/lol-icon.png" }); @@ -19,6 +19,17 @@ $(document).ready(function(){ readConfig(); }); +setAccept = (event) => { + console.log($(event).html()); + let text = $(event).html(); + if(text==='Wait for last second'){ + accept_timing='wait'; + } + else if(text==='Accept immediately'){ + accept_timing='asap'; + } +} + readConfig = () => { let file = jsonEdit(__dirname+'/../config.json'); id=file.data.pushed_id; @@ -36,7 +47,6 @@ readConfig = () => { if(accept_timing==='asap'){ $('#default-option').html('Queue Accept timing (Set to accept ASAP)'); $('#default-option').attr('value','asap'); - M.AutoInit(); } } @@ -48,7 +58,9 @@ cancel = () =>{ save = () => { //save id to file id=$('#pushed-id-field').val(); interval_time=$('#interval-field').val(); - accept_timing = $('#queue-accept-timing')[0].value; + if(!accept_timing){ + accept_timing='wait'; + } let file = jsonEdit(__dirname+'/../config.json') @@ -71,7 +83,7 @@ test = () =>{ data: { "id": tempID, "event": "test" }, url: 'https://us-central1-lol-boosted.cloudfunctions.net/sendNotification', success: function (data) { - $('#message').html('Sent test notification to Pushed ID "'+tempID+'"'); + $('#message').html('Test notification sent'); }, error: function (data) { $('#message').html("error in http request to firebase"); diff --git a/electron/src/index.css b/electron/src/index.css index c2c78b0..60ce1ad 100644 --- a/electron/src/index.css +++ b/electron/src/index.css @@ -1,80 +1,29 @@ -h4{ - color: white; +.card { + margin: 0 auto; + float: none; + margin-bottom: 10px; + background-color: #1e1e1e !important; } -#title{ - - font-family: 'Helvetica',-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; - font-weight: bold; - font-size: 32px; +.container-after-titlebar{ + /* background: linear-gradient(to bottom,#f4929d ,#cd5c6a); */ + background-color: #121212; } -#message{ - font-family: "Helvetica",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; - margin-top: 20px; +.btn{ + color: black !important; + background-color: #a668e8 !important; + border-color: #a668e8 !important; } -a{ - font-family: "Helvetica",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; +p{ + font-size: 15px; } -a:-webkit-any-link { - color: -webkit-link; - cursor: pointer; - text-decoration: underline; +#main-card{ + width: 25rem; } -html,body { - margin: 0; - height: 100%; -} - -#background{ - height: 100%; - background: linear-gradient(to bottom,#f4929d ,#cd5c6a); -} - -#menubar{ - height: 25px; - width: 100%; - background-color: #212121; -} - -.bg-color{ - background-color: #333333 !important; -} - -#valign{ - margin: 0; - height: 100%; -} - -#all-container{ - margin: 0; - height: 100%; -} - -#valign{ - vertical-align: middle; -} -.input-field input[type=text]:focus + label { - color: #cd5c6a !important; -} -.input-field input[type=text]:label { - color: white !important; -} - -.input-field>label{ - color: white; -} - -/* label underline focus color */ -.input-field input[type=text]:focus { - border-bottom: 1px solid #cd5c6a !important; - box-shadow: 0 1px 0 0 #cd5c6a !important; -} - -input{ - color: #ffffff; - font-size:1rem !important; +#config-card{ + width: 27rem; } \ No newline at end of file diff --git a/electron/src/index.html b/electron/src/index.html index e7cd0a7..acb1652 100644 --- a/electron/src/index.html +++ b/electron/src/index.html @@ -1,44 +1,61 @@ - - - Boosted: League Notifications - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- 🔥 Queue Listener -

After the game instance is found, feel free to minimize this window. You will be notified when your game is ready.

-
-
- Start - Stop - Configure - Help -
-
+ + + + Boosted: League Notifications + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+

Queue Listener

+

+ After the game instance is found, feel free to minimize this window. You will be notified when your game is ready. +

+
+
+ + + +
- - +
+ + + \ No newline at end of file diff --git a/electron/src/index.js b/electron/src/index.js index 3321f07..4e8bf1a 100644 --- a/electron/src/index.js +++ b/electron/src/index.js @@ -14,8 +14,8 @@ if (require('electron-squirrel-startup')) { // eslint-disable-line global-requir const createWindow = () => { // Create the browser window. const mainWindow = new BrowserWindow({ - width: 500, - height: 265, + width: 430, + height: 280, webPreferences:{ nodeIntegration:true, }, diff --git a/electron/src/render.js b/electron/src/render.js index c0b87ef..fda4042 100644 --- a/electron/src/render.js +++ b/electron/src/render.js @@ -25,13 +25,16 @@ let prompt_timer = 15; //create titlebar new customTitlebar.Titlebar({ - backgroundColor: customTitlebar.Color.fromHex('#333333'), + backgroundColor: customTitlebar.Color.fromHex('#121212'), menu: null, icon: "../resources/icons/lol-icon.png" }); -$(document).ready(function () { +$(document).ready(async function () { readConfig(); + $('#hook-btn').prop('disabled',false); + $('#help-btn').prop('disabled',false); + $('#config-btn').prop('disabled',false); }) //read config file and set global id @@ -115,11 +118,11 @@ $("#hook-btn").click(function () { //instantiate connector object and set event listeners connector = new LCUConnector(); connector.on('disconnect', (data) => { - $('#hook-btn').removeClass('disabled'); + $('#hook-btn').prop('disabled',false); console.log("lost connection with LCU"); - $('#stop-btn').addClass('disabled'); - $('#config-btn').addClass('disabled'); - document.getElementById('message').innerHTML = "Lost connection with game client."; + $('#stop-btn').attr('disabled',true); + $('#config-btn').attr('disabled',true); + document.getElementById('message').innerHTML = "Lost connection with client."; }); connector.on('connect', (data) => { //on connection to the game client, start polling for queue @@ -148,11 +151,11 @@ $("#hook-btn").click(function () { interval = setInterval(function () { request(options, readyCheck); }, interval_time); //TODO make interval configurable }); connector.start(); - $('#stop-btn').removeClass('disabled'); - $('#config-btn').addClass('disabled'); - $('#hook-btn').addClass('disabled'); + $('#stop-btn').prop('disabled',false); + $('#config-btn').prop('disabled',true); + $('#hook-btn').prop('disabled',true); document.getElementById('message').innerHTML = "Looking for game instance..."; - BrowserWindow.getFocusedWindow().setSize(500, 265); + // BrowserWindow.getFocusedWindow().setSize(500, 265); }); $('#config-btn').click(function () { //show configuration options @@ -162,7 +165,7 @@ $('#config-btn').click(function () { //show configuration options main.setEnabled(false); let win = new BrowserWindow({ - width: 650, + width: 460, height: 470, webPreferences: { nodeIntegration: true, @@ -185,9 +188,9 @@ $('#stop-btn').click(function () { connector.stop(); //stop polling for queue clearInterval(interval); document.getElementById('message').innerHTML = "Stopped looking for game instance."; - $('#hook-btn').removeClass('disabled'); - $('#stop-btn').addClass('disabled'); - $('#config-btn').removeClass('disabled'); + $('#hook-btn').prop('disabled',false); + $('#stop-btn').prop('disabled',true); + $('#config-btn').prop('disabled',false); }); $('#help-btn').click(()=>{ @@ -195,8 +198,8 @@ $('#help-btn').click(()=>{ main.setEnabled(false); let win = new BrowserWindow({ - width: 700, - height: 800, + width: 470, + height: 770, webPreferences: { nodeIntegration: true, }, diff --git a/electron/src/setup.html b/electron/src/setup.html index dbf338a..f4fa2fb 100644 --- a/electron/src/setup.html +++ b/electron/src/setup.html @@ -5,20 +5,79 @@ Boosted: Help - - - - - + + + + + + + + + + + - - + + + -
+
+
+
+
+
+

Setup Help

+

+
+
+

Step 1:

+

Create an account on pushed.co

+
+

Step 2:

+

Download "Get Pushed" on the App Store or "Pushed" on Google Play

+
+

Step 3:

+

Subscribe to the boosted channel on pushed.co by clicking HERE

+
+

Step 4:

+

Get your Pushed ID from the account page on the pushed.co website. Then paste the ID into the configure section of this app.

+
+

Step 5:

+

Click "Start" on the main menu. If you did everything right, your ready checks should get automatically accepted and a notification will be delivered to your phone.

+ + Close +
+
+
+
+
+
+ + + + + + + + + + + + + + + diff --git a/electron/src/setup.js b/electron/src/setup.js index 28bc81d..6ac2704 100644 --- a/electron/src/setup.js +++ b/electron/src/setup.js @@ -3,7 +3,7 @@ const { BrowserWindow } = require('electron').remote; const shell = require('electron').shell; new customTitlebar.Titlebar({ - backgroundColor: customTitlebar.Color.fromHex('#333333'), + backgroundColor: customTitlebar.Color.fromHex('#121212'), menu: null, icon: "../resources/icons/lol-icon.png" });