diff options
Diffstat (limited to 'src/js/ui/sections')
-rw-r--r-- | src/js/ui/sections/aboutSection.js | 56 | ||||
-rw-r--r-- | src/js/ui/sections/akNodeInfoSection.js | 40 | ||||
-rw-r--r-- | src/js/ui/sections/chatSection.js | 34 | ||||
-rw-r--r-- | src/js/ui/sections/commentsSection.js | 38 | ||||
-rw-r--r-- | src/js/ui/sections/donationSection.js | 181 | ||||
-rw-r--r-- | src/js/ui/sections/filesSection.js | 41 | ||||
-rw-r--r-- | src/js/ui/sections/markdownSection.js | 40 | ||||
-rw-r--r-- | src/js/ui/sections/mixtapesSection.js | 38 | ||||
-rw-r--r-- | src/js/ui/sections/myPageSection.js | 54 | ||||
-rw-r--r-- | src/js/ui/sections/newsSection.js | 40 | ||||
-rw-r--r-- | src/js/ui/sections/notFoundSection.js | 47 | ||||
-rw-r--r-- | src/js/ui/sections/radioSection.js | 203 | ||||
-rw-r--r-- | src/js/ui/sections/settingsSection.js | 55 | ||||
-rw-r--r-- | src/js/ui/sections/statsSection.js | 51 | ||||
-rw-r--r-- | src/js/ui/sections/stellarBalancesSection.js | 41 | ||||
-rw-r--r-- | src/js/ui/sections/stellarDataConfigSection.js | 40 | ||||
-rw-r--r-- | src/js/ui/sections/stellarSection.js | 32 | ||||
-rw-r--r-- | src/js/ui/sections/welcomeSection.js | 215 | ||||
-rw-r--r-- | src/js/ui/sections/zchainDataSection.js | 40 |
19 files changed, 1286 insertions, 0 deletions
diff --git a/src/js/ui/sections/aboutSection.js b/src/js/ui/sections/aboutSection.js new file mode 100644 index 0000000..7c77f46 --- /dev/null +++ b/src/js/ui/sections/aboutSection.js @@ -0,0 +1,56 @@ +// Arching Kaos About Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function aboutSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"About"} + ] + }; + + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "p", innerText:"Arching Kaos is a project about radio, music, communications and decentralization."}, + { element: "p", innerText:'On site, you can listen to the latest mixes of music (menu entry "Mixtapes"), read latest news ("News") of the network and chat (you guessed it, "Chat" menu entry).'}, + { element: "p", innerText:'You can see the zchains appearing in "zchain" and logs of the process on "Logs"'}, + { element: "p", innerText:"Note that to participate you will need to set up your Arching Kaos set, which is not so convinient yet but possible."}, + { element: "p", innerText:"Furthermore, if you are using Freighter extension you can additionally see:"}, + { element: "ol", innerHTML: [ + { element:"li", innerText:"Your balances on your wallet"}, + { element:"li", innerText:"Your configuration IPNS address (if any)"}, + { element:"li", innerText:"Your Arching Kaos configuration (if any)"}, + { element:"li", innerText:"Your zchain (...)"}, + { element:"li", innerText:"Your posted newsfeed (...)"} + ]}, + { element:"p", innerText:"Also, on the stats page you can find people that are participating over the Stellar Network, using the ARCHINGKAOS token/asset/coin."}, + { element:"p", innerText:"If you like what you see or you think the project has potential, you can use the button below to donate."}, + { element: "button", onclick:'menusel({id:"#/donation-section"})', innerText:"Donation"} + ] + }; + + var aboutSection = { + element: "div", + hidden: true, + id:"about-section", + innerHTML: [ + whereAmI, + content + ] + }; + + makeElement(aboutSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/akNodeInfoSection.js b/src/js/ui/sections/akNodeInfoSection.js new file mode 100644 index 0000000..63f2a0a --- /dev/null +++ b/src/js/ui/sections/akNodeInfoSection.js @@ -0,0 +1,40 @@ +// Arching Kaos Node Info Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// +// +import { makeElement } from "../../arching-kaos-generator.js"; + +export function akNodeInfoSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Stellar"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Node Info" } + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"node-info-not-found", innerText:"No data found (yet?)!"} + ] + }; + var akNodeInfoSection = { + element: "div", + id: "arching-kaos-node-info", + innerHTML: [ + whereAmI, + content + ] + }; + makeElement(akNodeInfoSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/chatSection.js b/src/js/ui/sections/chatSection.js new file mode 100644 index 0000000..b6d2ce3 --- /dev/null +++ b/src/js/ui/sections/chatSection.js @@ -0,0 +1,34 @@ +// Arching Kaos Chat Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function chatSection() +{ + var chatSection = { + element: 'div', + id:"chat-section", + style:"height: 100%;", + innerHTML: [ + { + element: 'button', + style:"position: fixed;", + onclick:"refreshChat()", + innerText:"Refresh" + }, + { + element: 'iframe', + id: "chat-iframe", + src: "https://irc.arching-kaos.net", + style: "width: 100%; height: 100%;" + } + ] + }; + + makeElement(chatSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/commentsSection.js b/src/js/ui/sections/commentsSection.js new file mode 100644 index 0000000..a0ee7ad --- /dev/null +++ b/src/js/ui/sections/commentsSection.js @@ -0,0 +1,38 @@ +// Arching Kaos Comments Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function commentsSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Comments"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"comments-sec-not-found", innerText: "No data found (yet?)!"} + ] + }; + var commentsSection = { + element: 'div', + id: 'comments-section', + innerHTML: [ + whereAmI, + content + ] + }; + makeElement(commentsSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/donationSection.js b/src/js/ui/sections/donationSection.js new file mode 100644 index 0000000..46a41fe --- /dev/null +++ b/src/js/ui/sections/donationSection.js @@ -0,0 +1,181 @@ +// Arching Kaos Donation Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export async function freighterWalletConnect() +{ + if ( await window.freighterApi.isConnected() ) + { + let publicKey = ""; + let error = ""; + const accessObj = await window.freighterApi.requestAccess(); + if (accessObj.error) { + return accessObj.error; + } else { + document.querySelector("#freighter-connect-button").innerText = accessObj.address; + document.querySelector("#freighter-connect-button").onclick = ''; + // putKeyToField(accessObj.address); + return accessObj.address; + } + return publicKey; + } + else + { + console.log("fr fail"); + } +} + +function putKeyToField(k){ + const address = k; + var base = document.querySelector("#freighter-connect-button"); + base.innerText=address; + base.onclick=''; + // stellar_connection_status = 1; + // checkAddressForConfigurationVariable(k); +} + +export async function triggerDonation() +{ + // try { + // ................................................... this element where the address should go when you connect the + var sourcePublicKey = document.querySelector("#freighter-connect-button").innerHTML; // extension with + // ^ the id of the element we query // the page. + const SERVER_URL = "https://horizon.stellar.org"; + const server = new StellarSdk.Horizon.Server(SERVER_URL); + const account = await server.loadAccount(sourcePublicKey); + const fee = await server.fetchBaseFee(); + const receiverPublicKey = "GAEVVR57OWKRXH2WLTEVTNT3NFSXN7MIZNJH2NFNPBJF4MYT4BNKJGXA" + + const amount_to_send = document.querySelector("#donation-amount").value; + const kh_min = 20000000*amount_to_send; + const transaction = new StellarSdk.TransactionBuilder(account, { fee, networkPassphrase: StellarSdk.Networks.PUBLIC, }) + /* The part that changes */ + .addOperation(StellarSdk.Operation.pathPaymentStrictSend({ + destination: receiverPublicKey, + sendAsset: new StellarSdk.Asset("XLM"), + sendAmount: String(amount_to_send), + destAsset: new StellarSdk.Asset("KAOTISKHUND","GDLJKMETTIXAVTZ2XXR2LHUITT7GZBNWEKQDN7V7SP4MURVY6266BIMO"), + destMin: String(kh_min), + path: [new StellarSdk.Asset("XLM"),new StellarSdk.Asset("KAOTISKHUND","GDLJKMETTIXAVTZ2XXR2LHUITT7GZBNWEKQDN7V7SP4MURVY6266BIMO")] + })) + /* End of part that changes */ + .setTimeout(30) + // .addMemo(StellarSdk.Memo.text('Hello world!')) + .build(); + const xdr = transaction.toXDR(); + const userSignTransaction = async ( + xdr, + network, + signWith + ) => { + let signedTransaction = ""; + let error = ""; + try + { + signedTransaction = await window.freighterApi.signTransaction( + xdr, + { + address:signWith, + network + }); + console.log(signTransaction); + } + catch (e) + { + error = e; + } + if (error) + { + return error; + } + return signedTransaction; + }; + // const userSignedTransaction = await userSignTransaction(xdr, "PUBLIC", sourcePublicKey); + const userSignedTransaction = await window.freighterApi.signTransaction(xdr, {address: sourcePublicKey, network:"PUBLIC"}); + console.log(userSignedTransaction); + + + const transactionToSubmit = StellarSdk.TransactionBuilder.fromXDR( userSignedTransaction.signedTxXdr, StellarSdk.Networks.PUBLIC ); + try { + const response = await server.submitTransaction(transactionToSubmit); + // console.log(transaction.toEnvelope().toXDR('base64')); + console.log(JSON.stringify(response, null, 2)); + console.log('\nSuccess! View the transaction at: '); + console.log(response._links.transaction.href); + makeElement( + { + element:"iframe", + onLoad:"var c=this;window.addEventListener('message',function({data,source}){if(c&&source===c.contentWindow&&data.widget===c.src)c.style.height=data.height+'px'},false);", + src:`https://stellar.expert/widget/public/tx/info/${response.id}`, + style:"border:none;overflow:hidden;max-width:100%; min-width:300px;max-height:100%;min-height:200px;width:100%" + }, + document.querySelector("#donation-section").querySelector(".content") + ); + } catch (e) { + console.log('An error has occured:'); + console.log(e); + } + // } catch (e) { + // console.log(e); + // } +} + +export function donationSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Donation"} + ] + }; + + var content = { + element: "div", + className: "content", + style: "display: flex; flex-direction: column; gap: 10px;", + innerHTML: [ + { element: "p", innerText:"If you like what you see and you want to contribute some memecoins you are free to do so using the XLM Freighter wallet."}, + { element: "p", innerText:"To donate, press the connect button below to connect your wallet."}, + { + element:"button", + id:"freighter-connect-button", + onclick:"freighterWalletConnect()", + innerText: "Connect Freighter wallet" + }, + { element: "p", innerText:"You can enter the amount you want to donate in XLM on the input box below."}, + { + element: "div", + style: "display: flex; gap: 5px;", + innerHTML: [ + { element: "input", type:"number", value:"1.0", placeholder:"1.0", step:"0.01", min:"0.01", max:"10", id:"donation-amount" }, + { + element:"button", + id:"donate-button", + onclick:"triggerDonation()", + innerText: "Donate" + } + ] + } + ] + }; + var donationSection = { + element: "div", + hidden: true, + id:"donation-section", + innerHTML: [ + whereAmI, + content + ] + }; + + makeElement(donationSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/filesSection.js b/src/js/ui/sections/filesSection.js new file mode 100644 index 0000000..a8147dc --- /dev/null +++ b/src/js/ui/sections/filesSection.js @@ -0,0 +1,41 @@ +// Arching Kaos Files Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function filesSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Modules"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Files"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"files-sec-not-found", innerText: "No data found (yet?)!"} + ] + }; + var filesSection = { + element: 'div', + id: "files-section", + innerHTML: [ + whereAmI, + content + ] + }; + + makeElement(filesSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/markdownSection.js b/src/js/ui/sections/markdownSection.js new file mode 100644 index 0000000..9a51a32 --- /dev/null +++ b/src/js/ui/sections/markdownSection.js @@ -0,0 +1,40 @@ +// Arching Kaos Markdown Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function markdownSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Modules"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Markdown"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"markdown-sec-not-found", innerText: "No data found (yet?)!"} + ] + }; + var markdownSection = { + element: 'div', + id: 'markdown-section', + innerHTML: [ + whereAmI, + content + ] + }; + makeElement(markdownSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/mixtapesSection.js b/src/js/ui/sections/mixtapesSection.js new file mode 100644 index 0000000..4848f78 --- /dev/null +++ b/src/js/ui/sections/mixtapesSection.js @@ -0,0 +1,38 @@ +// Arching Kaos Mixtapes Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function mixtapesSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Mixtapes"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"mixtapes-sec-not-found", innerText:"No data found (yet?)!"} + ] + }; + var mixtapesSection = { + element: "div", + id: "mixtapes-section", + innerHTML: [ + whereAmI, + content + ] + }; + makeElement(mixtapesSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/myPageSection.js b/src/js/ui/sections/myPageSection.js new file mode 100644 index 0000000..5dbd2ab --- /dev/null +++ b/src/js/ui/sections/myPageSection.js @@ -0,0 +1,54 @@ +// Arching Kaos My Page Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function myPageSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Stellar"}, + { element: "span", innerText:">"}, + { element: "h2", innerText: "My Page" } + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "h2", innerText: "My page" }, + { element: "button", id: "stellar-freigher-connect-address-button", onclick:"connect()", innerText:"Connect with Freighter wallet" }, + { element: "div", id:"my-news", innerHTML:[ + { element: "h3", innerText:"My news"}, + { element: "em", id:"my-news-sec-not-found", innerText:"No data found (yet?)!" } + ]}, + { element: "div", id:"my-mixtapes", innerHTML:[ + { element: "h3", innerText:"My mixtapes"}, + { element: "em", id:"my-mixtapes-sec-not-found", innerText:"No data found (yet?)!" } + ]}, + { element: "div", id:"my-zchain", innerHTML:[ + { element: "h3", innerText:"My zchain"}, + { element: "em", id:"my-zchain-sec-not-found", innerText:"No data found (yet?)!" } + ]} + ] + }; + var myPageSection = { + element: "div", + id: "mypage-section", + innerHTML: [ + whereAmI, + content + ] + }; + + makeElement(myPageSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/newsSection.js b/src/js/ui/sections/newsSection.js new file mode 100644 index 0000000..983a031 --- /dev/null +++ b/src/js/ui/sections/newsSection.js @@ -0,0 +1,40 @@ +// Arching Kaos News Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function newsSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Modules"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"News"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { element: "em", id:"news-sec-not-found", innerText: "No data found (yet?)!"} + ] + }; + var newsSection = { + element: 'div', + id: 'news-section', + innerHTML: [ + whereAmI, + content + ] + }; + makeElement(newsSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/notFoundSection.js b/src/js/ui/sections/notFoundSection.js new file mode 100644 index 0000000..46fc421 --- /dev/null +++ b/src/js/ui/sections/notFoundSection.js @@ -0,0 +1,47 @@ +// Arching Kaos Not Found Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; + +export function notFoundSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Not found"} + ] + }; + var content = { + element: "div", + className: "content", + innerHTML: [ + { + element: 'p', + innerText: 'Soft 404' + }, + { + element: 'p', + innerText: 'Please select an entry from the menu' + } + ] + }; + var notFoundSection = { + element: 'div', + id: 'not-found-section', + hidden: true, + innerHTML: [ + whereAmI, + content + ] + }; + + makeElement(notFoundSection, document.querySelector('.main')); +} +// @license-end diff --git a/src/js/ui/sections/radioSection.js b/src/js/ui/sections/radioSection.js new file mode 100644 index 0000000..0cc131f --- /dev/null +++ b/src/js/ui/sections/radioSection.js @@ -0,0 +1,203 @@ +// Arching Kaos Radio Section +// +// Kaotisk Hund - 2024 +// +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0 +// + +import { makeElement } from "../../arching-kaos-generator.js"; +import { start_radio, sync_radio } from "../../radio-emulator.js"; + +window.start_radio = start_radio; +window.sync_radio = sync_radio; + +export function radioSection() +{ + var whereAmI = { + element: "div", + className: "where-am-i", + innerHTML: [ + { element: "img", src:"./img/logo.png", onclick:"menusel({id:'#/welcome-section'})"}, + { element: "span", innerText:">"}, + { element: "h2", innerText:"Radio"} + ] + }; + var radioContent = { + element:"div", + id: "radio-main", + innerHTML:[ + {element:"div",className:"start-top",innerHTML:[ + {element:"div",className:"div-groups",style:"flex-grow:1;",innerHTML:[ + {element:"div",className:"now-playing-details",innerHTML:[ + {element:"div",className:"div-groups-row",innerHTML:[ + {element:"img", className:"generated"}, + {element:"table", innerHTML:[ + {element:"tr",innerHTML:[ + {element:"th", innerText:"Artist"}, + {element:"td", className:"artist"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Title"}, + {element:"td", className:"title"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Starts On (ms)"}, + {element:"td", className:"starts-on"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Duration"}, + {element:"td",className:"show-duration"} + ]} + ]} + ]} + ]}, + {element:"div", className:"enhanced-player",innerHTML:[ + {element:"div", className:"radio-player",innerHTML:[ + {element:"audio", id: "radio-player", preload:"auto", controls:true, muted:true} + ]}, + {element:"div", className:"div-row",innerHTML:[ + {element:"button", id:"start-button",innerText:"Start!"}, + {element:"button", id:"sync-button",innerText:"Sync"} + ]} + ]} + ]}, + {element:"div",className:"previously-played"}, + ]}, + {element:"div", className:"more-details", innerHTML:[ + {element:"details",id:"progress-details", innerHTML:[ + {element:"summary", innerText:"Progress details"}, + {element:"div",innerHTML:[ + {element:"p", innerText:"Download progress:"}, + {element:"progress",className:"dl-progress", max:"100"} + ]}, + {element:"div",innerHTML:[ + {element:"p", innerText:"Live progress:"}, + {element:"progress",className:"play-progress"} + ]}, + {element:"div", className:"div-inline",innerHTML:[ + {element:"div", className:"div-inline",innerHTML:[ + {element:"p", innerText:"Listening at:"}, + {element:"p", className:"listening-at"}, + ]}, + {element:"div", className:"div-inline",innerHTML:[ + {element:"p", innerText:"Show playback:"}, + {element:"div", className:"no-break",innerHTML:[ + {element:"p", className:"relative-time"}, + {element:"p", innerText:"/"}, + {element:"p", className:"show-duration"} + ]} + ]} + ]} + ]}, + {element:"details",id:"sync-info", innerHTML:[ + {element:"summary", innerText:"Sync info"}, + {element:"div",className:"groups",innerHTML:[ + {element:"h3", innerText:"Timings"}, + {element:"table", innerHTML:[ + {element:"tr",innerHTML:[ + {element:"th", innerText:"Time of visit (ms)"}, + {element:"td", className:"time-of-visit"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Time elapsed since visited (s)"}, + {element:"td", className:"you-are-here"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"List started on (ms)"}, + {element:"td", className:"started-on"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"List duration (s)"}, + {element:"td",className:"list-duration"} + ]} + ]}, + {element:"h3", innerText:"Calculations"}, + {element:"table", innerHTML:[ + {element:"tr",innerHTML:[ + {element:"th", innerText:"Times Fully Played"}, + {element:"td", className:"min-played"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Times Played"}, + {element:"td", className:"max-played"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Dt = TP - TFP"}, + {element:"td", className:"d-t"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Delta time"}, + {element:"td",className:"delta-time"} + ]}, + {element:"tr",innerHTML:[ + {element:"th", innerText:"Initial \"tune in\" time (s)"}, + {element:"td",className:"current-time"} + ]} + + ]}, + ]} + ]}, + {element:"details",id:"about", innerHTML:[ + {element:"summary",innerText:"Info to get you started"}, + {element:"h2",innerText:"Notice"}, + {element:"p",innerText:"If you are visiting for the first time, you might need to \"Allow Audio\" first. Please do and refresh the page."}, + {element:"h2",innerText:"About"}, + {element:"p",innerText:"This is a \"Radio Station Emulator\". We create lists with shows to be played, but since we are not doing streaming of the playlists, we offer another way of \"tuning in\"."}, + {element:"p",innerText:"Providing the time a list started playing and having pre-calculated the starting timestamps of each show relevant to the list start timestamp, we can calculate which show is on and what its current time of playing is."}, + {element:"p",innerText:"Ultimately, you are hearing what we would be streaming, as you would do for a regular radio station."}, + {element:"h2",innerText:"Steps"}, + {element:"ol",innerHTML:[ + {element:"li",innerText:"First, your browser is going to ask our server here, what is the current list that plays right now. It will get a response and will fetch that list."}, + {element:"li",innerText:"Based on properties of the list overall and the time of visit, your browser will start comparing each show's properties found in the list, to figure the relative time of yours on the list. A progress bar labeled \"Live progress\" will be indicating the correct time on the show."}, + {element:"li",innerText:"Having figured out the show that is playing, it will go and download the whole show. Progress of that would be observable via the \"Download progress\" bar below."}, + {element:"li",innerText:"Upon completion of the download, the \"Sync\" button is auto pressed and the player start playing the show from the calculated second it calculated previously."}, + ]}, + {element:"h2",innerText:"Notes"}, + {element:"ul",innerHTML:[ + {element:"li",innerText:"Sometimes, you might need to press the \"Sync\" button more than once. That's mostly due to bandwidth capabilities of both the server and the client. The \"tune\" would be right if you press it multiple times and land near the same timespace over and over."}, + {element:"li",innerText:"Ideally, if \"Listening at:\" and \"Show playback:\" havea the same value |