Skip to content

Commit

Permalink
Basic Init (will test later)
Browse files Browse the repository at this point in the history
  • Loading branch information
Notplayingallday383 authored Feb 26, 2024
1 parent 6a34d91 commit 22c1dda
Show file tree
Hide file tree
Showing 87 changed files with 269 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lighthouse CI
on:
push:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install && pnpm install -g @lhci/[email protected] tsx
- name: Run build
run: pnpm run build
- name: Run Lighthouse CI
run: lhci autorun
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<p align="center">
<img src="./sodium-static/public/sodium.png" height="135" width="135">
</p>
<h1 align="center">Sodium Source</h1>
<h1 align="center">Sodium aliceJS beta</h1>
<p align="center">Sodium is a site used for evading internet censorship</p>
</div>

Expand Down
23 changes: 23 additions & 0 deletions components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default function () {
return (
<div>
<div id="footer" class="fullwidth">
<div class="footerflex">
<div class="footerbrand">
<h3><a href="/">Sodium</a></h3>
<p>Evading Internet Censorship for over 6 Months!</p>
</div>
<div class="footerlist">
<p style="margin-top: 58px;">Sodium © z1g Project 2024</p>
</div>
</div>
<div class="footersocials">
<img src="assets/img/z1g.png" alt="z1g Project" title="The z1g Project GitHub organization" height="30" width="30" on:click="location.href='/github/z1g-project/'"></img>
<img src="assets/img/discord.jpg" alt="Discord" title="The z1g Project Discord" height="30" width="30" on:click="location.href='/discord/'"></img>
<img src="assets/img/github.png" alt="GitHub" title="The official deployment repository for Sodium" height="30" width="30" on:click="location.href='/github/'"></img>
<img src="assets/img/license.svg" alt="Credits" title="License information" height="30" width="30" on:click="location.href='/credits/'"></img>
</div>
</div>
</div>
)
}
25 changes: 25 additions & 0 deletions components/nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default function Nav() {
return (
<div>
<div class="second-bar">
<a href="/" title="Home" class="second-bar-link home-link"></a>
<a href="/games/" title="Games" class="second-bar-link games-link"></a>
<a href="/apps/" title="Apps" class="second-bar-link apps-link"></a>
<a href="/settings/" title="Settings" class="second-bar-link settings-link"></a>
<div class="info-menu" id="info-menu" style="margin-left: auto">
<div class="info-menu-item" id="transferRate"></div>
<div class="info-menu-item" id="latency"></div>
<div class="info-menu-item" id="fps"></div>
</div>
<div class="top-bar-item" id="time"></div>
<div class="top-bar-item">
<div class="battery-icon-container">
<div id="battery" class="battery-icon"></div>
<div class="battery-fill"></div>
<p class="battery-text"></p>
</div>
</div>
</div>
</div>
)
}
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Sodium is a site used for evading internet censorship." />
<meta property="og:image" content="/sodium.png">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#27639f"/>
<meta name="googlebot" content="noindex, nofollow, nosnippet" />
<link rel="shortcut icon" content="favicon.ico" />
<link rel="stylesheet" href="assets/css/ui.css" id="custom-css"/>
<link rel="stylesheet" href="assets/css/montserrat.css"/>
<script src="assets/js/settings.js" defer></script>
<script src="assets/js/fade.js" defer></script>
<link rel="manifest" href="manifest.webmanifest"/>
<link id="favicon" rel="icon" type="image/png" href="favicon.ico">
<script src="regcache.js" defer></script>
</head>
<body>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"description": "Sodium is a site used for evading internet censorship",
"type": "module",
"engines": {
"npm": ">=9.8.1",
"node": ">=18.0.0 <24.0.0"
"npm": ">=9.8.1"
},
"scripts": {
"start": "node index.js"
"start": "tsx "
},
"keywords": [
"proxy"
Expand All @@ -17,11 +16,17 @@
"license": "MIT",
"dependencies": {
"@tomphttp/bare-server-node": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@types/axios": "^0.14.0",
"axios": "^1.6.2",
"cors": "^2.8.5",
"express": "^4.18.2",
"ip": "^1.1.8",
"ultraviolet-static": "file:sodium-static"
"eslint": "^8.56.0",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"autoprefixer": "10.4.2",
"tsx": "4.7.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions public/assets/css/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#apploader {
display: none;
position: fixed;
top: 50%;
left: 50%;
z-index: 999;
}

.show-iframe #apploader {
display: block;
}

#loading-overlay {
display: none;
justify-content: center;
align-items: center;
position: fixed;
top: 40px;
left: 0;
width: 100%;
height: calc(100% - 6.5%);
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
}

.loading-content {
text-align: center;
color: #fff;
}

.loading-title {
font-size: 24px;
margin-bottom: 10px;
}

.loading-message {
font-size: 18px;
}

.info-menu {
display: block;
}

.info-menu-item {
font-size: 12px;
}

.close {
position: absolute;
top: 10px;
right: 15px;
font-size: 24px;
cursor: pointer;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions src/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Nav from "../components/Nav"
import Footer from "../components/Footer"
export default function notfound() {
async function regSW() {
console.log('Waiting on SW Cache to Register...');
const stockSW = "/sw.js";
const dynSW = "/dyn.sw.js"
const swAllowedHostnames = ["localhost", "127.0.0.1"];

if (
location.protocol !== "https:" &&
!swAllowedHostnames.includes(location.hostname)
)
throw new Error("Service workers cannot be registered without https.");

if (!navigator.serviceWorker)
throw new Error("Your browser doesn't support service workers.");

await navigator.serviceWorker.register(stockSW, {
scope: "/sw/",
});

await navigator.serviceWorker.register(dynSW, {
scope: "/service/",
});

window.location.reload()
}
return (
<div>
<Nav />
<div class="box-error text-center">
<h1>404 Error</h1>
<p style="text-align: center;">The requested file was not found on this server!</p>
<div style="text-align: center;">
<button id="uv-register-sw" on:click="regsw()" value="Register service worker">Register Serviceworkers</button>
</div>
</div>
<Footer />
</div>
)
}
55 changes: 55 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Nav from "../components/Nav"
import Footer from "../components/Footer"
import "../public/assets/css/home.css"
export default function home() {
return (
<div>
<Nav />
<div id="changelogModal" class="modal">
<div class="modal-content">
<span class="close">&times;</span>
<h2 style="font-weight: 700;">What's New</h2>
<p class="release-date">Release Date: Feburary 4th, 2023</p>
<ul class="changes-list">
<li>Add Bare switching to UV</li>
<li>Refresh some older UI Elements</li>
<li>Fix weird radius color issue</li>
<li>Fix slow load times</li>
<li>More Minor Changes & Bug Fixes view <a style="color:white;" href="https://github.com/z1g-project/sodium">here</a></li>
</ul>
<p>Version 2.0.0 - The 2024 Refresh</p>
<button class="ok-button">OK</button>
</div>
</div>

<div title="Sodium Logo" class="flex-center logo-wrapper header-center">
<img class="logo" src="assets/img/logo.svg" alt="Sodium" />
<h1>Sodium</h1>
</div>
<div class="flex-center desc">
<p>Sodium is a site used for evading internet censorship</p>
</div>
<form id="uv-form" class="flex-center">
<input id="uv-search-engine" value="https://www.google.com/search?q=%s" type="hidden" />
<input id="uv-address" type="text" placeholder="Search the web freely" />
</form>

<div class="desc left-margin">
<p id="uv-error"></p>
<pre id="uv-error-code"></pre>
</div>

<div id="loading-overlay">
<div class="loading-content">
<img src="sodium.png" alt="Logo" width="125" height="125"></img>
<h1 class="loading-title">Sodium is loading your content!</h1>
<img src="assets/img/loader.svg" alt="Loading Animation" width="50" height="50"></img>
<p class="loading-message">Please wait...</p>
</div>
</div>

<iframe id="apploader"></iframe>
<Footer />
</div>
)
}
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "vite";
import path from "path";
const __dirname = path.resolve();
export default defineConfig({
esbuild: {
jsxInject: `import "@mercuryworkshop/alicejs";`,
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});

0 comments on commit 22c1dda

Please sign in to comment.