From 9492952e162f019c153928d31d1d4e0ad74c7dc7 Mon Sep 17 00:00:00 2001 From: Quentin Decaunes Date: Wed, 27 Feb 2019 14:00:19 +0100 Subject: [PATCH] Added uikit and basic visual stuff. --- index.html | 114 +++++++++++++++++++++++++++++++++++++++------- js/settings.js | 26 +++++++++++ package-lock.json | 5 ++ package.json | 3 ++ renderer.js | 3 -- 5 files changed, 132 insertions(+), 19 deletions(-) create mode 100644 js/settings.js delete mode 100644 renderer.js diff --git a/index.html b/index.html index ca8a1f8..2b4c115 100644 --- a/index.html +++ b/index.html @@ -1,19 +1,101 @@ - - - Hello World! - - -

Hello World!

- - We are using Node.js , - Chromium , - and Electron . - - - + + Title + + + + + + + +

Ryzen Controller

+ + + + + + diff --git a/js/settings.js b/js/settings.js new file mode 100644 index 0000000..2751946 --- /dev/null +++ b/js/settings.js @@ -0,0 +1,26 @@ +function ready(fn) { + if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){ + fn(); + } else { + document.addEventListener('DOMContentLoaded', fn); + } + } + ready(function(){ + var ranges = document.querySelectorAll('[repeat]'); + for (const range in ranges) { + if (ranges.hasOwnProperty(range)) { + const element = ranges[range]; + element.addEventListener('change', function(event) { + var repeater = document.getElementById(event.target.attributes.repeat.value); + repeater.value = event.target.value; + }); + } + } + }); +/* +stapm_limit_w_range +ppt_fast_limit_w_range +ppt_slow_limit_w_range +temperature_limit_c_range +vrm_current_m_a_range +*/ diff --git a/package-lock.json b/package-lock.json index fad5d10..ab0fe1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1140,6 +1140,11 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "uikit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.0.3.tgz", + "integrity": "sha512-Z73TXlnfJCAXczg5mFCZSTwR0Ii1wW2fZumfIR8G1x1x4SyKHpkU0JCZDoIryYFMu1gSpvy5hZiXk3t4i5tTlw==" + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index 899a6db..c508fcd 100644 --- a/package.json +++ b/package.json @@ -18,5 +18,8 @@ "license": "CC0-1.0", "devDependencies": { "electron": "^4.0.4" + }, + "dependencies": { + "uikit": "^3.0.3" } } diff --git a/renderer.js b/renderer.js deleted file mode 100644 index 901d75e..0000000 --- a/renderer.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is required by the index.html file and will -// be executed in the renderer process for that window. -// All of the Node.js APIs are available in this process.