-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
93 lines (91 loc) · 4.04 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Electroon</title>
<link rel="stylesheet" href="assets/css/reset.css">
<link rel="stylesheet" href="assets/uikit/css/uikit.almost-flat.min.css">
<link rel="stylesheet" href="assets/css/player.css">
<link href="assets/fonts/quicksand/quicksand.css" rel="stylesheet">
<link href="assets/fonts/md-icons/material-icons.css" rel="stylesheet">
</head>
<body style="background-image: url(assets/img/pattern.png), url(assets/img/wallpaper.jpg);">
<div id="roonapp" class="music-box"></div>
<div id="drag" class=""></div>
<button class="done-dragging" onclick="api.set_draggable(false);">Save Position</button>
<!-- Required to get jQuery working -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script>if (window.module) module = window.module;</script>
<!-- Page Scripts-->
<script>
// Electron
const {webFrame,ipcRenderer,remote} = require('electron');
const download = remote.require('download-file');
const ImageDataURI = require('image-data-uri');
const mergeImages = require('merge-images');
let win = remote.getCurrentWindow();
let currentZoomFactor = webFrame.getZoomFactor();
var appPath = remote.process.cwd();
console.log("remote:", remote.process.cwd())
</script>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/uikit/js/uikit.min.js"></script>
<script src="roon_bundle.js"></script>
<script>
// Globals
var $window, $html, $document, $body, $player, api;
// Player API
$(function() {
$body = $('body');
$html = $('html');
$document = $(document);
$window = $(window);
$player = $("#roonapp");
// Auto Hide Player On Lost Focus
remote.app.on('browser-window-blur', () => {
if (remote !== null) {
//api.hidePlayer();
}
});
api = {
init: function() {
$("#exit-button").click(api.exit());
$("#alwaystop-button").click(api.always_top());
$("#toggle-window-button").click(api.togglePlayer());
$("#devtools-button").click(api.dev_tools());
},
exit: function() {
win.close();
remote.quit();
},
always_top: function() {
var alwaystop = win.isAlwaysOnTop();
win.setAlwaysOnTop(!alwaystop);
$("#alwaystop-button").html((alwaystop ? "flip_to_back" : "flip_to_front"))
},
dev_tools: function() {
win.webContents.openDevTools();
},
showPlayer: function(){
win.show();
},
hidePlayer: function(){
win.hide();
},
togglePlayer: function() {
if(win.isVisible()) {
win.hide()
} else {
win.show();
}
},
set_draggable: function(bool) {
(bool) ? $("#drag").addClass("draggable") : $("#drag").removeClass("draggable");
ipcRenderer.send('save_position', {});
}
}
});
</script>
</body>
</html>