Skip to content

Commit

Permalink
finished help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmichels committed Apr 26, 2020
1 parent b841df7 commit e4348d2
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 5 deletions.
2 changes: 1 addition & 1 deletion electron/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</div>
<div class="card-action">
<a id="hook-btn" class="waves-effect waves-light red btn">Start</a>
<a id="suspend-btn" class="waves-effect waves-light disabled red btn">Suspend</a>
<a id="stop-btn" class="waves-effect waves-light red disabled btn">Stop</a>
<a id="config-btn" class="waves-effect waves-light red btn">Configure</a>
<a id="help-btn" class="waves-effect waves-light red btn">Help</a>
</div>
</div>
</div>
Expand Down
28 changes: 24 additions & 4 deletions electron/src/render.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const Base64 = require('js-base64').Base64;
const { BrowserWindow } = require('electron').remote;
const customTitlebar = require('custom-electron-titlebar');
const fs = require('fs');
const https = require('https');
const LCUConnector = require('lcu-connector');
const request = require('postman-request');
Expand Down Expand Up @@ -33,7 +32,6 @@ new customTitlebar.Titlebar({

$(document).ready(function () {
$('#stop-btn').addClass('disabled');
$('#suspend-btn').addClass('disabled');
readConfig();
})

Expand Down Expand Up @@ -121,7 +119,6 @@ $("#hook-btn").click(function () {
$('#hook-btn').removeClass('disabled');
console.log("lost connection with LCU");
$('#stop-btn').addClass('disabled');
$('#suspend-btn').addClass('disabled');
$('#config-btn').addClass('disabled');
document.getElementById('message').innerHTML = "Lost connection with game client.";
});
Expand Down Expand Up @@ -193,4 +190,27 @@ $('#stop-btn').click(function () {
$('#hook-btn').removeClass('disabled');
$('#stop-btn').addClass('disabled');
$('#config-btn').removeClass('disabled');
});
});

$('#help-btn').click(()=>{
let main = BrowserWindow.getFocusedWindow();
main.setEnabled(false);

let win = new BrowserWindow({
width: 700,
height: 825,
webPreferences: {
nodeIntegration: true,
},
frame: false
})
win.setMenu(null);
win.on('closed', () => {
win = null;
main.setEnabled(true);
main.focus();
})
win.loadURL(`file://${__dirname}/setup.html`);

// win.webContents.openDevTools();
})
55 changes: 55 additions & 0 deletions electron/src/setup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Boosted: Help</title>
<link rel="stylesheet" href="index.css">
<!-- Google fonts -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script defer src="setup.js"></script>
<!-- Font Awesome -->
<script defer src="https://kit.fontawesome.com/1c9144b004.js" crossorigin="anonymous"></script>
<script defer>window.$ = window.jQuery = require('jquery');</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

</head>
<body>
<div id="all-container">
<div id="background">
<div id="valign" class="valign-wrapper">
<div class="container center-align">
<div class="center-align">
<div class="bg-color card z-depth-4" >
<div class="card-content white-text">
<span id="title" class="card-title">&#128187; Setup instructions</span>
</div>
<div class="card-action white-text">
<h4>Step 1:</h4>
<p>Create an account on <a href="https://pushed.co/">pushed.co</a></p>
<hr>
<h4>Step 2:</h4>
<p>Download "Get Pushed" on the App Store or "Pushed" on Google Play</p>
<hr>
<h4>Step 3:</h4>
<p>Subscribe to the boosted channel on pushed.co by clicking <a href="https://pushed.co/s/mQqSeRa">HERE</a></p>
<hr>
<h4>Step 4:</h4>
<p>Get your Pushed ID from the account page on the pushed.co website. Then paste the ID into the configure section of this app.</p>
<hr>
<h4>Step 5:</h4>
<p>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.</p>

<a id="close-btn" class="waves-effect waves-light red btn">Close</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
19 changes: 19 additions & 0 deletions electron/src/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const customTitlebar = require('custom-electron-titlebar');
const { BrowserWindow } = require('electron').remote;
const shell = require('electron').shell;

new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#333333'),
menu: null,
icon: "../resources/icons/lol-icon.png"
});

$('#close-btn').click(()=>{
let current = BrowserWindow.getFocusedWindow();
current.close();
})

$(document).on('click', 'a[href^="http"]', function(event) {
event.preventDefault();
shell.openExternal(this.href);
});

0 comments on commit e4348d2

Please sign in to comment.