Upload files to "website"
This commit is contained in:
104
website/app.js
Normal file
104
website/app.js
Normal file
@@ -0,0 +1,104 @@
|
||||
(function () {
|
||||
function escapeHtml(str) {
|
||||
return String(str)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function chunk(arr, size) {
|
||||
var out = [];
|
||||
for (var i = 0; i < arr.length; i += size) out.push(arr.slice(i, i + size));
|
||||
return out;
|
||||
}
|
||||
|
||||
function renderLinksTable(links, columns) {
|
||||
columns = columns || 3;
|
||||
links = Array.isArray(links) ? links : [];
|
||||
|
||||
var rows = chunk(links, columns);
|
||||
if (rows.length) {
|
||||
var last = rows[rows.length - 1];
|
||||
while (last.length < columns) last.push(null);
|
||||
}
|
||||
|
||||
var html = "<table>";
|
||||
for (var r = 0; r < rows.length; r++) {
|
||||
html += "<tr>";
|
||||
for (var c = 0; c < columns; c++) {
|
||||
var item = rows[r][c];
|
||||
if (!item) {
|
||||
html += "<td></td>";
|
||||
continue;
|
||||
}
|
||||
|
||||
var href = escapeHtml(item.href || "#");
|
||||
var label = escapeHtml(item.label || "");
|
||||
var img = escapeHtml(item.image || "");
|
||||
var alt = escapeHtml(item.alt || item.label || "");
|
||||
|
||||
html +=
|
||||
'<td>' +
|
||||
'<a href="' + href + '">' +
|
||||
'<img alt="' + alt + '" src="' + img + '">' +
|
||||
"<p><b>" + label + "</b></p>" +
|
||||
"</a>" +
|
||||
"</td>";
|
||||
}
|
||||
html += "</tr>";
|
||||
}
|
||||
html += "</table>";
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderAllSections(containerId, sectionsObj) {
|
||||
var container = document.getElementById(containerId);
|
||||
if (!container) return;
|
||||
|
||||
sectionsObj = sectionsObj || {};
|
||||
var keys = Object.keys(sectionsObj);
|
||||
|
||||
// If you want a custom order, add an "order" number in links.js and sort here.
|
||||
// Default: object insertion order.
|
||||
var html = "";
|
||||
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var section = sectionsObj[key];
|
||||
|
||||
// support BOTH formats:
|
||||
// 1) new format: { title, links: [...] }
|
||||
// 2) old format: key: [ ...links... ]
|
||||
var title, links;
|
||||
if (Array.isArray(section)) {
|
||||
title = key; // fallback title
|
||||
links = section;
|
||||
} else {
|
||||
title = section && section.title ? section.title : key;
|
||||
links = section && Array.isArray(section.links) ? section.links : [];
|
||||
}
|
||||
|
||||
// Skip empty sections (optional)
|
||||
if (!links.length) continue;
|
||||
|
||||
html += "<h4>" + escapeHtml(title) + "</h4>";
|
||||
html += renderLinksTable(links, 3);
|
||||
|
||||
// divider between sections
|
||||
if (i !== keys.length - 1) html += "<hr>";
|
||||
}
|
||||
|
||||
container.innerHTML = html || "<p>No sections defined.</p>";
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", function () {
|
||||
// focus search input
|
||||
var q = document.getElementById("q");
|
||||
if (q) q.focus();
|
||||
|
||||
renderAllSections("sections", window.LAUNCHPAD_LINKS);
|
||||
});
|
||||
})();
|
||||
|
||||
67
website/index.html
Normal file
67
website/index.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>SumiLaunch</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
color: #222;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
a, a:visited { text-decoration: none; color: #a22121; }
|
||||
|
||||
.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grid {
|
||||
border: 1px solid black;
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.grid p { margin-top: 0; margin-bottom: 20px; }
|
||||
|
||||
table { width: 100%; }
|
||||
table img { width: 64px; height: 64px; }
|
||||
|
||||
/* Optional: keep empty cells from adding weird padding */
|
||||
td:empty { padding: 0; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="center">
|
||||
<h2>SumiLaunch</h2>
|
||||
|
||||
<!-- DuckDuckGo HTML search -->
|
||||
<form action="https://html.duckduckgo.com/html/" method="get">
|
||||
<input id="q" style="width: 250px;" type="text" placeholder="DuckDuckGo Search" name="q">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="grid" id="sections">
|
||||
<!-- JS will inject ALL sections here -->
|
||||
</div>
|
||||
|
||||
<h4>TIP: Launchpad Shortcut</h4>
|
||||
<img width="200" alt="Menu > Add to Home Screen" src="http://192.168.1.242:8087/images/tip.jpg" />
|
||||
<p>Designed for classic BBOS.</p>
|
||||
<p>© 2026 <a href="http://forum.sumisu.xyz"><b>Sumisu</b></a></p>
|
||||
<p>Based on <a href="http://lunarproject.org" target="_blank">LunarProject.org</a>.</p>
|
||||
</div>
|
||||
|
||||
<script src="links.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
37
website/links.js
Normal file
37
website/links.js
Normal file
@@ -0,0 +1,37 @@
|
||||
window.LAUNCHPAD_LINKS = {
|
||||
anyBrowser: {
|
||||
title: "Any Browser",
|
||||
links: [
|
||||
{ href: "./news/", label: "SumiNews", image: "http://192.168.1.242:8087/images/lunarnews.png", alt: "SumiNews" },
|
||||
{ href: "./weather/", label: "SumiWeather", image: "http://192.168.1.242:8087/images/weather.png", alt: "SumiWeather" },
|
||||
|
||||
{ href: "https://pb-appstore.netlify.app/", label: "PB - Appstore", image: "https://cdn.bio.link/uploads/profile_pictures/2025-11-19/2lWy5sAQy0Ox3AMMehIBSTWkIzb6vcvi.png", alt: "PB - Appstore" },
|
||||
{ href: "http://news.ycombinator.com", label: "Hacker News", image: "http://192.168.1.242:8087/images/newsz.png", alt: "Hacker News" },
|
||||
|
||||
{ href: "http://text.npr.org/", label: "NPR", image: "http://192.168.1.242:8087/images/npr.jpg", alt: "NPR" },
|
||||
|
||||
{ href: "http://williamsmobile.co.uk/apps.htm", label: "WM Apps", image: "http://192.168.1.242:8087/images/wm.jpg", alt: "WilliamsMobile" },
|
||||
{ href: "http://gdir.telae.net/", label: "Gmaps", image: "http://192.168.1.242:8087/images/gmaps.png", alt: "Gmaps" },
|
||||
{ href: "http://old.reddit.com/", label: "Old Reddit", image: "http://192.168.1.242:8087/images/reddit.png", alt: "Old Reddit" },
|
||||
{ href: "http://forums.crackberry.com/", label: "CB Forums", image: "http://192.168.1.242:8087/images/cb.png", alt: "CB Forums" },
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
search: {
|
||||
title: "Search",
|
||||
links: [
|
||||
{ href: "https://html.duckduckgo.com/html/", label: "DuckDuckGo", image: "https://duckduckgo.com/assets/logo_header.v109.svg", alt: "DuckDuckGo" },
|
||||
{ href: "https://frogfind.sumisu.xyz/", label: "FrogFind! Search", image: "http://frogfind.de/frosch.gif", alt: "FrogFind! Search" },
|
||||
{ href: "http://wiby.me/", label: "Wiby", image: "http://192.168.1.242:8087/images/wiby.png", alt: "Wiby" },
|
||||
]
|
||||
},
|
||||
|
||||
games: {
|
||||
title: "Games",
|
||||
links: [
|
||||
{ href: "./wordle/", label: "Wordle", image: "https://upload.wikimedia.org/wikipedia/commons/c/c5/Wordle_Logo.svg", alt: "Wordle" },
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user