From 45ddaf5aa2acddd2b157a66a7dbb0809a1a97d6c Mon Sep 17 00:00:00 2001 From: Lee Edwards Date: Thu, 28 Oct 2021 13:34:30 -0700 Subject: [PATCH] Populate geocities page --- config/commands.js | 7 +++++- config/fs.js | 9 +++++-- js/geo.js | 54 +++++++++++++++++++++-------------------- js/terminal-ext.js | 3 ++- home.htm => welcome.htm | 26 +++++++++++--------- 5 files changed, 57 insertions(+), 42 deletions(-) rename home.htm => welcome.htm (96%) diff --git a/config/commands.js b/config/commands.js index 84727053..f52ccad0 100644 --- a/config/commands.js +++ b/config/commands.js @@ -347,7 +347,12 @@ const commands = { }, open: function(args) { - term.command(`cat ${args.join(" ")}`); + if (args[0].split(".")[1] == "htm") { + console.log(args[0]); + term.openURL(`./${args[0]}`); + } else { + term.command(`cat ${args.join(" ")}`); + } }, more: function(args) { diff --git a/config/fs.js b/config/fs.js index 35a8ce62..3fea44c9 100644 --- a/config/fs.js +++ b/config/fs.js @@ -4,10 +4,11 @@ const _LOCAL_FILES = { const _REMOTE_FILES = { "README.md": "https://raw.githubusercontent.com/rootvc/cli-website/main/README.md", + "welcome.htm": "https://raw.githubusercontent.com/rootvc/cli-website/main/welcome.htm", }; const DIRS = { - "~": ["id_rsa", "README.md"], + "~": ["id_rsa", "welcome.htm", "README.md"], "bin": ["zsh"], "home": Object.keys(team).concat("guest", "root").sort(), "/": ["bin", "home"], @@ -38,6 +39,10 @@ function _insertFileToDOM(name, txt) { } function getFileContents(filename) { + console.log(filename); const div = document.getElementById(filename); - return div.innerHTML.replaceAll("
", "\r\n"); + return div.innerHTML + .replaceAll("
", "\r\n") + .replaceAll(">", ">") + .replaceAll("<", "<"); } diff --git a/js/geo.js b/js/geo.js index fbb6438c..8345cc70 100644 --- a/js/geo.js +++ b/js/geo.js @@ -4,6 +4,34 @@ function buildGeoPage() { const whois = document.getElementById("whois"); whois.innerHTML = whoisRoot.split(" Try")[0]; + const portfolioTable = document.getElementById("portfolio"); + for (p in portfolio) { + const row = portfolioTable.insertRow(-1); + const logoCell = row.insertCell(); + const descriptionCell = row.insertCell(); + const urlCell = row.insertCell(); + + logoCell.setAttribute("class", "portfolio-photo"); + descriptionCell.setAttribute("class", "portfolio-description"); + + const logoImgTag = document.createElement("img"); + logoImgTag.setAttribute("src", `images/${p}.jpg`); + logoImgTag.setAttribute("alt", `${portfolio[p].name}`); + logoCell.appendChild(logoImgTag); + + if (portfolio[p].url != "(inactive)") { + const urlATag = document.createElement("a"); + urlATag.setAttribute("href", portfolio[p].url); + urlATag.setAttribute("alt", `${portfolio[p].name}`); + urlATag.innerHTML = portfolio[p].url; + urlCell.appendChild(urlATag); + } else { + urlCell.innerHTML = portfolio[p].url; + } + + descriptionCell.innerHTML = portfolio[p].description; + } + const teamTable = document.getElementById("team"); for (t in team) { const row = teamTable.insertRow(-1); @@ -29,30 +57,4 @@ function buildGeoPage() { titleCell.innerHTML = team[t].title; descriptionCell.innerHTML = team[t].description; } - - const portfolioTable = document.getElementById("portfolio"); - for (p in portfolio) { - if (portfolio[p].url != "(inactive)") { - const row = portfolioTable.insertRow(-1); - const logoCell = row.insertCell(); - const urlCell = row.insertCell(); - const descriptionCell = row.insertCell(); - - logoCell.setAttribute("class", "portfolio-photo"); - descriptionCell.setAttribute("class", "portfolio-description"); - - const logoImgTag = document.createElement("img"); - logoImgTag.setAttribute("src", `images/${p}.jpg`); - logoImgTag.setAttribute("alt", `${portfolio[p].name}`); - logoCell.appendChild(logoImgTag); - - const urlATag = document.createElement("a"); - urlATag.setAttribute("href", portfolio[p].url); - urlATag.setAttribute("alt", `${portfolio[p].name}`); - urlATag.innerHTML = portfolio[p].url; - urlCell.appendChild(urlATag); - - descriptionCell.innerHTML = portfolio[p].description; - } - } } \ No newline at end of file diff --git a/js/terminal-ext.js b/js/terminal-ext.js index 2d3c626d..1fb2651b 100644 --- a/js/terminal-ext.js +++ b/js/terminal-ext.js @@ -126,7 +126,8 @@ extend = (term) => { term.reset(); term.printLogoType(); term.stylePrint('Welcome to the Root Ventures terminal. Seeding bold engineers!'); - term.stylePrint(`Type ${colorText("help", "command")} to get started.`); + term.stylePrint(`Type ${colorText("help", "command")} to get started, or type ${colorText("web", "command")} to see our website. (Not recommended)`); + term.user = user; if (!preserveHistory) { term.history = []; diff --git a/home.htm b/welcome.htm similarity index 96% rename from home.htm rename to welcome.htm index 5d5a7464..95c98d3e 100644 --- a/home.htm +++ b/welcome.htm @@ -75,7 +75,9 @@

- + + +

@@ -119,9 +121,13 @@

About Us


-
-

Team

- +
+

+ + Portfolio + +

+
@@ -131,13 +137,9 @@

Team

-
-

- - Portfolio - -

- +
+

Team

+
@@ -165,7 +167,7 @@

- Built by Root Ventures Team + Built by Root Ventures Team