aboutsummaryrefslogtreecommitdiff
path: root/src/js/ui/sections
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-11-29 16:23:39 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-11-29 16:23:39 +0200
commitafcedd44615d20423d58f4d9c9d8cfa3838a54d4 (patch)
treee16cd7f2eb4040f7b237baa45aa3f8f80516dcc4 /src/js/ui/sections
parent084e3ce6efc49c2d43ce9b44d96e430f8057848e (diff)
downloadarching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.tar.gz
arching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.tar.bz2
arching-kaos-web-ui-afcedd44615d20423d58f4d9c9d8cfa3838a54d4.zip
Major refactoring
Diffstat (limited to 'src/js/ui/sections')
-rw-r--r--src/js/ui/sections/radioSection.js3
-rw-r--r--src/js/ui/sections/settingsSection.js53
-rw-r--r--src/js/ui/sections/welcomeSection.js70
3 files changed, 73 insertions, 53 deletions
diff --git a/src/js/ui/sections/radioSection.js b/src/js/ui/sections/radioSection.js
index 5aaacc3..9c98ac0 100644
--- a/src/js/ui/sections/radioSection.js
+++ b/src/js/ui/sections/radioSection.js
@@ -1,7 +1,8 @@
import { makeElement } from "../../arching-kaos-generator.js";
var radioSection = {
- element: 'radio-section',
+ element: "div",
+ id: 'radio-section',
hidden: true,
style: 'height: 100%;',
innerHTML: [
diff --git a/src/js/ui/sections/settingsSection.js b/src/js/ui/sections/settingsSection.js
index febd094..6f26393 100644
--- a/src/js/ui/sections/settingsSection.js
+++ b/src/js/ui/sections/settingsSection.js
@@ -1,21 +1,30 @@
import { makeElement } from "../../arching-kaos-generator.js";
-import { settings } from "../../arching-kaos-web-ui-settings.js";
+import { getSettings, settings } from "../../arching-kaos-web-ui-settings.js";
+
+// var settings = getSettings();
+console.log(settings);
var settingsSection = {
element: 'div',
id: "settings-section",
- innerHTML: `
- <div class="where-am-i">
- <img src="./img/logo.png" onclick="menusel({id:'#/welcome-section'})"/>
- <span>&gt;</span>
- <h2>🔧 Settings</h2>
- </div>
- `
-}
+ innerHTML: [
+ {element: "div",
+ className:"where-am-i",
+ innerHTML:[
+ {element: "img", src:"./img/logo.png", onclick: "menusel({id:'#/welcome-section'})"},
+ {element: "span", innerText:">"},
+ {element: "h2", innerText:"🔧 Settings"}
+ ]
+ }
+ ]
+};
makeElement(settingsSection, document.querySelector('.main'));
-var settingsPage = document.querySelector('#settings-section');
+export function settingsPage()
+{
+ return document.querySelector('#settings-section');
+}
// var scripts = [
// {
@@ -24,21 +33,21 @@ var settingsPage = document.querySelector('#settings-section');
// src:"./js/arching-kaos-web-ui-settings.js"
// }
// ];
-//
+//
// for ( var i = 0; i < scripts.length; i++ )
// {
// makeElement(scripts[i], document.querySelector('body'));
// }
-var server = new StellarSdk.Server(settings.stellar.horizon.list[settings.stellar.horizon.active], {allowHttp:true});
-
-if ( settings.stellar.scan )
-{
- scanStellarNetworkForPeers();
-}
+// var server = new StellarSdk.Server(settings.stellar.horizon.list[settings.stellar.horizon.active], {allowHttp:true});
-if ( settings.ak.scan )
-{
- ringlocalbell();
- setInterval(ringlocalbell, 10*60*1000);
-}
+// if ( getSettings().stellar.scan )
+// {
+// scanStellarNetworkForPeers();
+// }
+//
+// if ( getSettings().ak.scan )
+// {
+// ringlocalbell();
+// setInterval(ringlocalbell, 10*60*1000);
+// }
diff --git a/src/js/ui/sections/welcomeSection.js b/src/js/ui/sections/welcomeSection.js
index 7b4d6be..5636233 100644
--- a/src/js/ui/sections/welcomeSection.js
+++ b/src/js/ui/sections/welcomeSection.js
@@ -1,46 +1,56 @@
import { makeElement } from "../../arching-kaos-generator.js";
-var welcomeSection = {
- element: "div",
- id: "welcome-section",
- innerHTML: [
- {
- element : "div",
- className:"where-am-i",
- innerHTML: `
+var whereAmI = {
+ element : "div",
+ className:"where-am-i",
+ innerHTML: `
<img src="./img/logo.png" onclick="menusel({id:'#/welcome-section'})"/>
<span>&gt;</span>
<h2>Home</h2>
`
- },
- {
- element: "p",
- innerText: "Welcome to Arching Kaos project."
- },
- {
- element: "div",
- id: "home-grid",
- innerHTML: `
+};
+
+var greeting = {
+ element: "p",
+ innerText: "Welcome to Arching Kaos project."
+};
+
+var homeGrid = {
+ element: "div",
+ id: "home-grid",
+ innerHTML: `
<button class="menu-clickable" id="#/mixtapes-section" onclick="menusel(this)" style="background-image: url(img/mixtapes-logo.png); background-repeat: round;"></button>
<button class="menu-clickable" id="#/news-section" onclick="menusel(this)" style="background-image: url(img/news-logo.png); background-repeat: round;"></button>
<button class="menu-clickable" id="#/chat-section" onclick="menusel(this)" style="background-image: url(img/chat-logo.png); background-repeat: round;"></button>
<button class="menu-clickable" id="#/radio-section" onclick="menusel(this)" style="background-image: url(img/radio-logo.png); background-repeat: round; background-size: cover;"></button>
<button class="menu-clickable" id="#/stats-section" onclick="menusel(this)">Stats</button>
`
- },
- {
- element : "h3",
- innerText: "Render explicit zblock"
- },
- {
- element: "div",
- style:"padding: 1vh 1vw; display: flex; flex-direction: row; align-items: center; gap: 10px;",
- innerHTML: `
- <input id="search-field" type="text" name="search" placeholder="Enter a zblock hash"/>
- <button onclick="seekZblock(this.parentElement.querySelector('#search-field').value, ['search', false])">Render</button>
- `
- },
+};
+
+var renderTitle = {
+ element : "h3",
+ innerText: "Render explicit zblock"
+};
+
+var renderForm = {
+ element: "div",
+ style:"padding: 1vh 1vw; display: flex; flex-direction: row; align-items: center; gap: 10px;",
+ innerHTML: `
+ <input id="search-field" type="text" name="search" placeholder="Enter a zblock hash"/>
+ <button onclick="seekZblock(this.parentElement.querySelector('#search-field').value, ['search', false])">Render</button>
+ `
+};
+
+var welcomeSection = {
+ element: "div",
+ id: "welcome-section",
+ innerHTML: [
+ whereAmI,
+ greeting,
+ homeGrid,
+ renderTitle,
+ renderForm,
{
element: "div",
className: "results-area",