Compare commits

..

11 Commits

Author SHA1 Message Date
metacryst
07b42ccbc3 partiful link 2026-01-22 19:21:38 -06:00
metacryst
f1c7c340f9 new quill 2025-12-26 06:13:29 -06:00
metacryst
f8861666dd cleaning 2025-12-19 04:49:28 -06:00
metacryst
cd5f92b55f making loading faster 2025-12-19 04:34:53 -06:00
metacryst
8d57a507d1 Merge branch 'main' of https://git.sun.museum/sam/Hyperia 2025-12-17 22:16:41 -06:00
metacryst
9567e4e284 Mobile improvements 2025-12-17 22:16:38 -06:00
metacryst
5b564fbfb3 putting content back in the gitignore 2025-12-07 22:07:14 -06:00
metacryst
279be987a4 Processing Stripe Dance Payments 2025-12-07 22:01:37 -06:00
metacryst
9a1aa55297 bank updates 2025-12-03 11:34:28 -06:00
metacryst
be155ae913 Merge branch 'main' of https://git.sun.museum/sam/Hyperia 2025-12-01 03:14:59 -06:00
metacryst
9d43362cae webp vs. png for fabric background 2025-12-01 03:14:57 -06:00
36 changed files with 899 additions and 783 deletions

9
.gitignore vendored
View File

@@ -1,9 +1,8 @@
.DS_Store .DS_Store
package-lock.json package-lock.json
node_modules node_modules
_/build
content
server/.env
abetaccredited.html
qrCodes/qr_codes
.env .env
content
db/db.json
qrCodes/qr_codes

View File

@@ -1,394 +0,0 @@
{
"nodes": {
"HY-1": {
"fullName": "Founder"
},
"MEMBER-1": {
"id": 1,
"email": "samrussell99@pm.me",
"firstName": "Sam",
"lastName": "Russell",
"password": "$argon2id$v=19$m=65536,t=3,p=4$PDu5qx47zzY0dX0/4iQuqw$JxePLouwOEi2Q0wA4JHQQ4GwvqAvxqWhj7n9aC8HZIk",
"address": {
"address1": "2014 E 9th St",
"address2": "Unit A",
"zip": "78702",
"state": "Texas",
"city": "Austin"
},
"tokenUsed": "810387b6-851e-4883-b9a3-c59703dc0fc9",
"joined": "11.24.2025-12:54:360784am"
},
"MEMBER-2": {
"id": 2,
"email": "nate@sun.museum",
"firstName": "Nate",
"lastName": "De Luna",
"password": "$argon2id$v=19$m=65536,t=3,p=4$laoMb54lVHlXD+VsWe2lNg$YSNqIk/MC32jUc+Hj48LBTSul3+WXQAyfYasfH6L0k4",
"address": {
"address1": "2014 E 9th St",
"address2": "Unit A",
"zip": "78702",
"state": "Texas",
"city": "Austin"
},
"tokenUsed": "1d57b6e0-e6c3-4ab6-808f-72b64b8303ee",
"joined": "11.25.2025-6:34:040998pm"
},
"TOKEN-810387b6-851e-4883-b9a3-c59703dc0fc9": {
"index": 1,
"url": "https://hyperia.so/signup?token=",
"uuid": "810387b6-851e-4883-b9a3-c59703dc0fc9",
"used": true
},
"TOKEN-d0b417c4-d69a-4958-9e1d-0658176d2710": {
"index": 2,
"url": "https://hyperia.so/signup?token=",
"uuid": "d0b417c4-d69a-4958-9e1d-0658176d2710",
"used": false
},
"TOKEN-1719b6d8-9b13-4720-ab94-9af5cbe42137": {
"index": 3,
"url": "https://hyperia.so/signup?token=",
"uuid": "1719b6d8-9b13-4720-ab94-9af5cbe42137",
"used": false
},
"TOKEN-16659e04-afbb-4192-9195-90f2f49277b2": {
"index": 4,
"url": "https://hyperia.so/signup?token=",
"uuid": "16659e04-afbb-4192-9195-90f2f49277b2",
"used": false
},
"TOKEN-88abc4b3-8416-4499-9fa7-6778841e4b23": {
"index": 5,
"url": "https://hyperia.so/signup?token=",
"uuid": "88abc4b3-8416-4499-9fa7-6778841e4b23",
"used": false
},
"TOKEN-e3342dd5-a214-4280-9488-f48f91e728ce": {
"index": 6,
"url": "https://hyperia.so/signup?token=",
"uuid": "e3342dd5-a214-4280-9488-f48f91e728ce",
"used": false
},
"TOKEN-a8176432-4e72-42b7-ac9a-2d799039f729": {
"index": 7,
"url": "https://hyperia.so/signup?token=",
"uuid": "a8176432-4e72-42b7-ac9a-2d799039f729",
"used": false
},
"TOKEN-1d57b6e0-e6c3-4ab6-808f-72b64b8303ee": {
"index": 8,
"url": "https://hyperia.so/signup?token=",
"uuid": "1d57b6e0-e6c3-4ab6-808f-72b64b8303ee",
"used": true
},
"TOKEN-67264f06-c4b1-4334-8ba8-0e5e045021df": {
"index": 9,
"url": "https://hyperia.so/signup?token=",
"uuid": "67264f06-c4b1-4334-8ba8-0e5e045021df",
"used": false
},
"TOKEN-e9fa5701-d90f-45d0-8e2b-7c3ef9022362": {
"index": 10,
"url": "https://hyperia.so/signup?token=",
"uuid": "e9fa5701-d90f-45d0-8e2b-7c3ef9022362",
"used": false
},
"TOKEN-c082880a-f12c-4eb0-b136-e11df9e6bde8": {
"index": 11,
"url": "https://hyperia.so/signup?token=",
"uuid": "c082880a-f12c-4eb0-b136-e11df9e6bde8",
"used": false
},
"TOKEN-083a18f5-6491-4dbf-9a28-2b22b6b4a5bd": {
"index": 12,
"url": "https://hyperia.so/signup?token=",
"uuid": "083a18f5-6491-4dbf-9a28-2b22b6b4a5bd",
"used": false
},
"TOKEN-af94443c-a0c5-4c58-a2e5-16a8c6d573c8": {
"index": 13,
"url": "https://hyperia.so/signup?token=",
"uuid": "af94443c-a0c5-4c58-a2e5-16a8c6d573c8",
"used": false
},
"TOKEN-5673dd07-25b1-441f-abbc-89b5e5a2b3e9": {
"index": 14,
"url": "https://hyperia.so/signup?token=",
"uuid": "5673dd07-25b1-441f-abbc-89b5e5a2b3e9",
"used": false
},
"TOKEN-f2b30979-1ece-41e1-87ec-6a102a21e809": {
"index": 15,
"url": "https://hyperia.so/signup?token=",
"uuid": "f2b30979-1ece-41e1-87ec-6a102a21e809",
"used": false
},
"TOKEN-d52c1bcc-8b97-4535-8395-dfdab4ee543a": {
"index": 16,
"url": "https://hyperia.so/signup?token=",
"uuid": "d52c1bcc-8b97-4535-8395-dfdab4ee543a",
"used": false
},
"TOKEN-7fed8604-1801-4500-8615-2ac8eb50c896": {
"index": 17,
"url": "https://hyperia.so/signup?token=",
"uuid": "7fed8604-1801-4500-8615-2ac8eb50c896",
"used": false
},
"TOKEN-e312c854-8df7-4c68-9f3f-1822b718b092": {
"index": 18,
"url": "https://hyperia.so/signup?token=",
"uuid": "e312c854-8df7-4c68-9f3f-1822b718b092",
"used": false
},
"TOKEN-5979853c-1755-4403-bea5-3b111384ffb3": {
"index": 19,
"url": "https://hyperia.so/signup?token=",
"uuid": "5979853c-1755-4403-bea5-3b111384ffb3",
"used": false
},
"TOKEN-d93307e4-a0a0-4b4a-86d0-897ca5382cdd": {
"index": 20,
"url": "https://hyperia.so/signup?token=",
"uuid": "d93307e4-a0a0-4b4a-86d0-897ca5382cdd",
"used": false
},
"TOKEN-b73b803a-c49d-4ea9-b8ed-f04be0373157": {
"index": 21,
"url": "https://hyperia.so/signup?token=",
"uuid": "b73b803a-c49d-4ea9-b8ed-f04be0373157",
"used": false
},
"TOKEN-5a0a7a8c-f080-4708-a2e1-fcd2d613adb1": {
"index": 22,
"url": "https://hyperia.so/signup?token=",
"uuid": "5a0a7a8c-f080-4708-a2e1-fcd2d613adb1",
"used": false
},
"TOKEN-99c547fe-1ec1-4ddc-bfcb-b95d73fdd907": {
"index": 23,
"url": "https://hyperia.so/signup?token=",
"uuid": "99c547fe-1ec1-4ddc-bfcb-b95d73fdd907",
"used": false
},
"TOKEN-6da35b58-81ea-478f-9ef5-8a70b407bfcf": {
"index": 24,
"url": "https://hyperia.so/signup?token=",
"uuid": "6da35b58-81ea-478f-9ef5-8a70b407bfcf",
"used": false
},
"TOKEN-402f4f83-165b-4b5a-b1f2-3dccc7ec5ef6": {
"index": 25,
"url": "https://hyperia.so/signup?token=",
"uuid": "402f4f83-165b-4b5a-b1f2-3dccc7ec5ef6",
"used": false
},
"TOKEN-04afd891-1250-4a6d-b239-3bdd06082c71": {
"index": 26,
"url": "https://hyperia.so/signup?token=",
"uuid": "04afd891-1250-4a6d-b239-3bdd06082c71",
"used": false
},
"TOKEN-c807c67f-2d8d-4f54-b657-8cb3aaf19b28": {
"index": 27,
"url": "https://hyperia.so/signup?token=",
"uuid": "c807c67f-2d8d-4f54-b657-8cb3aaf19b28",
"used": false
},
"TOKEN-5cf7639e-22b3-4469-8155-d490cc164367": {
"index": 28,
"url": "https://hyperia.so/signup?token=",
"uuid": "5cf7639e-22b3-4469-8155-d490cc164367",
"used": false
},
"TOKEN-90e82173-c7f8-47d9-9619-b333e032d1af": {
"index": 29,
"url": "https://hyperia.so/signup?token=",
"uuid": "90e82173-c7f8-47d9-9619-b333e032d1af",
"used": false
},
"TOKEN-5eed9d33-81ea-420f-834b-a71b01eb6f54": {
"index": 30,
"url": "https://hyperia.so/signup?token=",
"uuid": "5eed9d33-81ea-420f-834b-a71b01eb6f54",
"used": false
},
"TOKEN-2e96ecaa-bf8e-403c-89f3-8b2924788df3": {
"index": 31,
"url": "https://hyperia.so/signup?token=",
"uuid": "2e96ecaa-bf8e-403c-89f3-8b2924788df3",
"used": false
},
"TOKEN-7edb52b1-35ce-42c6-8cd0-341f3ee38f4c": {
"index": 32,
"url": "https://hyperia.so/signup?token=",
"uuid": "7edb52b1-35ce-42c6-8cd0-341f3ee38f4c",
"used": false
},
"TOKEN-ad5f483d-338f-4efc-936d-8253854b38a5": {
"index": 33,
"url": "https://hyperia.so/signup?token=",
"uuid": "ad5f483d-338f-4efc-936d-8253854b38a5",
"used": false
},
"TOKEN-d49a3c80-d0b8-4796-b1e2-f42d5ae0cc69": {
"index": 34,
"url": "https://hyperia.so/signup?token=",
"uuid": "d49a3c80-d0b8-4796-b1e2-f42d5ae0cc69",
"used": false
},
"TOKEN-382a7ffd-9227-4edc-8bc6-8c3ae82ccf14": {
"index": 35,
"url": "https://hyperia.so/signup?token=",
"uuid": "382a7ffd-9227-4edc-8bc6-8c3ae82ccf14",
"used": false
},
"TOKEN-27762835-f211-4c72-8187-b3f87ccb846c": {
"index": 36,
"url": "https://hyperia.so/signup?token=",
"uuid": "27762835-f211-4c72-8187-b3f87ccb846c",
"used": false
},
"TOKEN-7344f7ce-2609-46f4-b2cb-28dafc547270": {
"index": 37,
"url": "https://hyperia.so/signup?token=",
"uuid": "7344f7ce-2609-46f4-b2cb-28dafc547270",
"used": false
},
"TOKEN-fd23ce26-d78a-49fc-b198-1a73071a2db4": {
"index": 38,
"url": "https://hyperia.so/signup?token=",
"uuid": "fd23ce26-d78a-49fc-b198-1a73071a2db4",
"used": false
},
"TOKEN-869227be-1c80-421f-a17e-e052929c43e3": {
"index": 39,
"url": "https://hyperia.so/signup?token=",
"uuid": "869227be-1c80-421f-a17e-e052929c43e3",
"used": false
},
"TOKEN-3ac9b048-a132-4fad-bb2d-9bb1820592c8": {
"index": 40,
"url": "https://hyperia.so/signup?token=",
"uuid": "3ac9b048-a132-4fad-bb2d-9bb1820592c8",
"used": false
},
"TOKEN-7d9c71ac-646b-4a6b-b758-f55f632cec6f": {
"index": 41,
"url": "https://hyperia.so/signup?token=",
"uuid": "7d9c71ac-646b-4a6b-b758-f55f632cec6f",
"used": false
},
"TOKEN-6ad3a682-14fa-48d7-96bd-fd61b2b314dd": {
"index": 42,
"url": "https://hyperia.so/signup?token=",
"uuid": "6ad3a682-14fa-48d7-96bd-fd61b2b314dd",
"used": false
},
"TOKEN-c02ae012-089a-4c3b-bd28-8d7cedc2df0d": {
"index": 43,
"url": "https://hyperia.so/signup?token=",
"uuid": "c02ae012-089a-4c3b-bd28-8d7cedc2df0d",
"used": false
},
"TOKEN-df82c2b6-bd8c-4b69-bc8c-a1d7df53727c": {
"index": 44,
"url": "https://hyperia.so/signup?token=",
"uuid": "df82c2b6-bd8c-4b69-bc8c-a1d7df53727c",
"used": false
},
"TOKEN-1444c46c-4985-4e52-8cbf-f6d77795deae": {
"index": 45,
"url": "https://hyperia.so/signup?token=",
"uuid": "1444c46c-4985-4e52-8cbf-f6d77795deae",
"used": false
},
"TOKEN-38954160-0865-4f55-b190-e2a5a2268df1": {
"index": 46,
"url": "https://hyperia.so/signup?token=",
"uuid": "38954160-0865-4f55-b190-e2a5a2268df1",
"used": false
},
"TOKEN-0e88166f-936a-4156-a89d-e71e825db36e": {
"index": 47,
"url": "https://hyperia.so/signup?token=",
"uuid": "0e88166f-936a-4156-a89d-e71e825db36e",
"used": false
},
"TOKEN-a94aee8f-c47d-4606-a734-69355dfc642e": {
"index": 48,
"url": "https://hyperia.so/signup?token=",
"uuid": "a94aee8f-c47d-4606-a734-69355dfc642e",
"used": false
},
"TOKEN-de407269-9e31-485b-a857-5ba5d1a5ca5b": {
"index": 49,
"url": "https://hyperia.so/signup?token=",
"uuid": "de407269-9e31-485b-a857-5ba5d1a5ca5b",
"used": false
},
"TOKEN-f2016b40-a179-47ec-a415-84caa7da8521": {
"index": 50,
"url": "https://hyperia.so/signup?token=",
"uuid": "f2016b40-a179-47ec-a415-84caa7da8521",
"used": false
},
"POST-HY-1": {
"text": "This is the first message ever.",
"time": "11.24.2025-12:54:360784am",
"sentBy": "MEMBER-1"
},
"POST-HY-2": {
"text": "asdf",
"sentBy": "MEMBER-1",
"time": "11.25.2025-5:36:510165pm"
},
"POST-HY-3": {
"text": "Hey guys!",
"sentBy": "MEMBER-2",
"time": "11.25.2025-6:35:420148pm"
},
"POST-HY-4": {
"text": "(I am not real)",
"sentBy": "MEMBER-2",
"time": "11.25.2025-6:43:280160pm"
},
"POST-HY-5": {
"text": "asd",
"sentBy": "MEMBER-2",
"time": "11.25.2025-9:02:490950pm"
},
"CONVERSATION-1": {
"id": 1,
"between": [
"MEMBER-1",
"MEMBER-2"
],
"lastUpdated": "11.25.2025-6:43:280160pm"
},
"DM-1": {
"id": 1,
"conversation": "CONVERSATION-1",
"from": "MEMBER-1",
"text": "What's up?",
"time": "11.25.2025-6:43:280160pm"
},
"DM-2": {
"time": "11.26.2025-12:12:590659am",
"from": "MEMBER-2",
"conversation": "CONVERSATION-1",
"text": "Nothin much, you?",
"id": 2
},
"DM-3": {
"time": "11.26.2025-12:13:180437am",
"from": "MEMBER-1",
"conversation": "CONVERSATION-1",
"text": "Just grindin it out",
"id": 3
}
},
"edges": {}
}

View File

@@ -11,8 +11,7 @@ function createWindow() {
height: 800, height: 800,
webPreferences: { webPreferences: {
nodeIntegration: true, nodeIntegration: true,
contextIsolation: false, contextIsolation: false
icon: path.join(__dirname, '_', 'fabric.png')
} }
}); });
win.loadFile(path.join(__dirname, 'index.html')); win.loadFile(path.join(__dirname, 'index.html'));

View File

@@ -15,6 +15,7 @@
"express-useragent": "^2.0.2", "express-useragent": "^2.0.2",
"jsonwebtoken": "^9.0.2", "jsonwebtoken": "^9.0.2",
"moment": "^2.30.1", "moment": "^2.30.1",
"stripe": "^20.0.0",
"ws": "^8.18.3", "ws": "^8.18.3",
"zod": "^4.1.12" "zod": "^4.1.12"
}, },

View File

@@ -5,6 +5,7 @@ import QuillDB from "../_/quilldb.js"
import Titles from "./model/Titles.js" import Titles from "./model/Titles.js"
import Members from './model/Members.js' import Members from './model/Members.js'
import Tokens from './model/Tokens.js' import Tokens from './model/Tokens.js'
import Payments from "./model/Payments.js"
import Posts from "./model/Forum/Posts.js" import Posts from "./model/Forum/Posts.js"
import Conversations from "./model/Messages/Conversations.js" import Conversations from "./model/Messages/Conversations.js"
import Messages from "./model/Messages/Messages.js" import Messages from "./model/Messages/Messages.js"
@@ -13,6 +14,7 @@ export default class Database {
titles = new Titles() titles = new Titles()
members = new Members() members = new Members()
tokens = new Tokens() tokens = new Tokens()
payments = new Payments()
posts = new Posts() posts = new Posts()
conversations = new Conversations() conversations = new Conversations()
messages = new Messages() messages = new Messages()
@@ -21,6 +23,7 @@ export default class Database {
"HY": this.titles, "HY": this.titles,
"MEMBER": this.members, "MEMBER": this.members,
"TOKEN": this.tokens, "TOKEN": this.tokens,
"PAYMENT": this.payments,
"POST": this.posts, "POST": this.posts,
"CONVERSATION": this.conversations, "CONVERSATION": this.conversations,
"DM": this.messages "DM": this.messages
@@ -79,8 +82,8 @@ export default class Database {
this.tokens.entries, this.tokens.entries,
this.posts.entries, this.posts.entries,
this.conversations.entries, this.conversations.entries,
this.messages.entries this.messages.entries,
this.payments.entries,
] ]
let ids = [ let ids = [
Object.entries(this.titles.ids), Object.entries(this.titles.ids),
@@ -89,7 +92,7 @@ export default class Database {
Object.entries(this.posts.ids), Object.entries(this.posts.ids),
Object.entries(this.conversations.ids), Object.entries(this.conversations.ids),
Object.entries(this.messages.ids), Object.entries(this.messages.ids),
Object.entries(this.payments.ids),
] ]
for(let i=0; i<arrs.length; i++) { for(let i=0; i<arrs.length; i++) {
let arr = arrs[i] let arr = arrs[i]

View File

@@ -0,0 +1,42 @@
import OrderedObject from "./OrderedObject.js"
const { z } = require("zod")
export default class Payments extends OrderedObject {
schema = z.object({
id: z.number(),
name: z.string(),
email: z.string(),
time: z.string(),
amount: z.number(),
product: z.string(),
})
save(payment) {
let id = `PAYMENT-${payment.id}`
let result = this.schema.safeParse(payment)
if(result.success) {
try {
super.add(id, payment)
} catch(e) {
console.error(e)
throw e
}
} else {
console.error(result.error)
throw new global.ServerError(400, "Invalid Member Data!");
}
}
add(paymentObj) {
let toSave = {
id: this.entries.length+1,
...paymentObj
}
this.save(toSave)
}
get(id) {
return this.entries[this.ids[`PAYMENT-${id}`]]
}
}

View File

@@ -12,6 +12,7 @@ import "./util.js"
import Socket from './ws/ws.js' import Socket from './ws/ws.js'
import Database from "./db/db.js" import Database from "./db/db.js"
import AuthHandler from './auth.js'; import AuthHandler from './auth.js';
import PaymentsHandler from "./payments.js"
class Server { class Server {
db; db;
@@ -20,10 +21,16 @@ class Server {
DBPath = path.join(__dirname, './db') DBPath = path.join(__dirname, './db')
registerRoutes(router) { registerRoutes(router) {
// router.post('/api/location', handlers.updateLocation) /* Stripe */
router.post("/create-checkout-session", PaymentsHandler.danceTicket)
router.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook)
/* Auth */
router.post('/login', this.auth.login) router.post('/login', this.auth.login)
router.get('/profile', this.auth.getProfile) router.get('/profile', this.auth.getProfile)
router.get('/signout', this.auth.logout) router.get('/signout', this.auth.logout)
/* Site */
router.get('/signup', this.verifyToken, this.get) router.get('/signup', this.verifyToken, this.get)
router.post('/signup', this.verifyToken, this.newUserSubmission) router.post('/signup', this.verifyToken, this.newUserSubmission)
router.get('/db/images/*', this.getUserImage) router.get('/db/images/*', this.getUserImage)
@@ -162,6 +169,7 @@ class Server {
global.db = this.db global.db = this.db
this.auth = new AuthHandler() this.auth = new AuthHandler()
const app = express(); const app = express();
app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook)
app.use(cors({ origin: '*' })); app.use(cors({ origin: '*' }));
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: true })); app.use(express.urlencoded({ extended: true }));

68
server/payments.js Normal file
View File

@@ -0,0 +1,68 @@
const Stripe = require("stripe")
const dotenv = require("dotenv")
dotenv.config();
const stripe = new Stripe(process.env.STRIPE_SECRET);
export default class PaymentsHandler {
static async danceTicket(req, res) {
try {
const session = await stripe.checkout.sessions.create({
mode: "payment",
payment_method_types: ["card"],
metadata: {
productId: "austin_winter_ball_2025_ticket"
},
line_items: [
{
price_data: {
currency: "usd",
product_data: {
name: "Hyperia Winter Ball"
},
unit_amount: 3500
},
quantity: 1
}
],
success_url: `${process.env.PROTOCOL + process.env.BASE_URL}/success`,
cancel_url: `${process.env.PROTOCOL + process.env.BASE_URL}/events`
});
res.json({ url: session.url });
} catch (err) {
console.error(err);
res.status(500).json({ error: "Something went wrong." });
}
}
static webhook = (req, res) => {
const sig = req.headers["stripe-signature"];
try {
const event = stripe.webhooks.constructEvent(
req.body,
sig,
process.env.WEBHOOK_SECRET
);
if (event.type === "checkout.session.completed") {
const session = event.data.object;
let toStore = {
"product": session.metadata.productId,
"email": session.customer_details.email,
"name": session.customer_details.name,
"time": global.currentTime(),
"amount": session.amount_total,
}
global.db.payments.add(toStore)
}
res.sendStatus(200);
} catch (err) {
console.error(err);
res.sendStatus(400);
}
}
}

View File

@@ -1,6 +1,9 @@
/* /*
Sam Russell Sam Russell
Captured Sun Captured Sun
12.26.25 - State for arrays, nested objects. State for stacks (Shadow-only)
12.17.25 - [Hyperia] - adding width, height functions. adding "e" to onClick. adding the non-window $$ funcs.
12.16.25 - [comalyr] - State
11.25.25.1 - Added minHeight and minWidth to be counted as numerical styles 11.25.25.1 - Added minHeight and minWidth to be counted as numerical styles
11.25.25 - Added onChange for check boxes, added setQuery / onQueryChanged for easy filtering 11.25.25 - Added onChange for check boxes, added setQuery / onQueryChanged for easy filtering
11.24.25 - Fixing onClick because it was reversed, adding event to onHover params 11.24.25 - Fixing onClick because it was reversed, adding event to onHover params
@@ -68,6 +71,12 @@ window.$ = function(selector, el = document) {
window.$$ = function(selector, el = document) { window.$$ = function(selector, el = document) {
return Array.from(el.querySelectorAll(selector)) return Array.from(el.querySelectorAll(selector))
} }
HTMLElement.prototype.$$ = function(selector) {
return window.$$(selector, this)
}
DocumentFragment.prototype.$$ = function(selector) {
return window.$$(selector, this)
}
/* CONSOLE */ /* CONSOLE */
@@ -163,6 +172,7 @@ Object.defineProperty(Array.prototype, 'last', {
window.quill = { window.quill = {
rendering: [], rendering: [],
lastState: null,
render: (el) => { render: (el) => {
if(el instanceof Shadow) { if(el instanceof Shadow) {
@@ -193,19 +203,6 @@ window.quill = {
quill.rendering.pop() quill.rendering.pop()
}, },
loadPage: () => {
let URL = window.location.pathname
if(!window.routes[URL]) {
throw new Error("No URL for this route: ", URL)
}
let pageClass = window[routes[URL]]
document.title = pageClass.title ?? document.title
document.body.innerHTML = ""
let page = new pageClass()
quill.render(page)
},
isStack: (el) => { isStack: (el) => {
return el.classList.contains("HStack") || el.classList.contains("ZStack") || el.classList.contains("VStack") return el.classList.contains("HStack") || el.classList.contains("ZStack") || el.classList.contains("VStack")
}, },
@@ -216,6 +213,7 @@ window.Shadow = class extends HTMLElement {
super() super()
} }
} }
window.register = (el, tagname) => { window.register = (el, tagname) => {
if (typeof el.prototype.render !== 'function') { if (typeof el.prototype.render !== 'function') {
throw new Error("Element must have a render: " + el.prototype.constructor.name) throw new Error("Element must have a render: " + el.prototype.constructor.name)
@@ -230,6 +228,75 @@ window.register = (el, tagname) => {
window[el.prototype.constructor.name] = function (...params) { window[el.prototype.constructor.name] = function (...params) {
let instance = new el(...params) let instance = new el(...params)
if(instance.state) {
const proxyCache = new WeakMap();
function reactive(value, path=[]) {
if (value && typeof value === "object") {
if (proxyCache.has(value)) return proxyCache.get(value);
const p = new Proxy(value, createHandlers(path));
proxyCache.set(value, p);
return p;
}
return value;
}
function isNumericKey(prop) {
return typeof prop === "string" && prop !== "" && String(+prop) === prop;
}
function createHandlers(path) {
return {
get(target, prop, receiver) {
if (typeof prop === "symbol") {
return Reflect.get(target, prop, receiver);
}
let nextPath = (Array.isArray(target) && !isNumericKey(prop)) ? path : path.concat(prop) // To filter out arr.length, arr.map, arr.forEach, etc.
quill.lastState = nextPath.join(".");
const v = Reflect.get(target, prop, receiver);
return reactive(v, nextPath);
},
set(target, prop, value, receiver) {
const oldLength = Array.isArray(target) ? target.length : undefined;
const oldValue = target[prop];
if (oldValue === value) return true;
const result = Reflect.set(target, prop, value, receiver);
let changedPath = (Array.isArray(target) && (!isNumericKey(prop) || target.length !== oldLength)) ? path : path.concat(prop).join("."); // To filter out arr.length, arr.map, arr.forEach, and also a push/pop/unshift.
const watchers = instance.stateWatchers[changedPath];
if (watchers) {
watchers.forEach(cb => cb());
}
return result;
}
};
}
let proxy = reactive(instance.state)
Object.defineProperty(instance, "state", {
value: proxy,
writable: false,
configurable: false,
enumerable: true
});
let stateWatchers = {}
Object.keys(instance.state).forEach((key) => stateWatchers[key] = [])
Object.defineProperty(instance, "stateWatchers", {
value: stateWatchers,
writable: false,
configurable: false,
enumerable: true
});
}
quill.render(instance) quill.render(instance)
return instance return instance
} }
@@ -314,6 +381,7 @@ function extendHTMLElementWithStyleSetters() {
case "marginRight": case "marginRight":
case "textUnderlineOffset": case "textUnderlineOffset":
case "letterSpacing":
return "unit-number" return "unit-number"
@@ -333,24 +401,27 @@ function extendHTMLElementWithStyleSetters() {
switch (type) { switch (type) {
case "unit-number": case "unit-number":
HTMLElement.prototype[prop] = function(value, unit = "px") { HTMLElement.prototype[prop] = StyleFunction(function(value, unit = "px") {
if ((typeof value !== "number" || isNaN(value)) && value !== "auto") {
throw new Error(`Invalid value for ${prop}: ${value}. Expected a number.`);
}
if(value === "auto") { if(value === "auto") {
this.style[prop] = value this.style[prop] = value
return this return this
} }
this.style[prop] = value + unit; this.style[prop] = value + unit;
if (value !== "" && this.style[prop] === "") {
throw new Error(`Invalid CSS value for ${prop}: ` + value + unit);
}
return this; return this;
}; });
break; break;
case "string": case "string":
HTMLElement.prototype[prop] = function(value) { HTMLElement.prototype[prop] = StyleFunction(function(value) {
this.style[prop] = value; this.style[prop] = value;
if (value !== "" && this.style[prop] === "") {
throw new Error(`Invalid CSS value for ${prop}: ` + value);
}
return this; return this;
}; });
break; break;
} }
}); });
@@ -358,46 +429,86 @@ function extendHTMLElementWithStyleSetters() {
extendHTMLElementWithStyleSetters(); extendHTMLElementWithStyleSetters();
HTMLElement.prototype.addStateWatcher = function(field, cb) {
let parent = this
while(!(parent instanceof Shadow)) {
parent = parent.parentNode
}
parent.stateWatchers[field].push(cb)
}
// Currently only works for one state variable in the function
// Could probably be fixed by just making lastState an array and clearing it out every function call?
HTMLElement.prototype.setUpState = function(styleFunc, cb) {
let format = (value) => {return Array.isArray(value) ? value : [value]}
// 1. Run the callback to get the style argument and also update lastState
let styleArgs = format(cb())
// 2. Check if lastState has really been updated. If not, the user-provided cb did not access valid state
if(!quill.lastState) {
throw new Error("Quill: style state function does not access valid state")
}
// 3. Construct function to run when state changes
let onStateChange = () => {
styleFunc.call(this, ...format(cb()))
}
// 4. Now listen for the state to change
this.addStateWatcher(quill.lastState, onStateChange)
// 5. Run the original function again, this time with the actual arguments
quill.lastState = null
styleFunc.call(this, ...styleArgs)
}
function StyleFunction(func) {
let styleFunction = function(value, unit = "px") {
if(typeof value === 'function') {
this.setUpState(styleFunction, value)
return this
} else {
func.call(this, value, unit); // ".call" ensures that "this" is correct
return this
}
}
return styleFunction
}
HTMLElement.prototype.styles = function(cb) { HTMLElement.prototype.styles = function(cb) {
cb.call(this, this) cb.call(this, this)
return this return this
} }
HTMLElement.prototype.paddingVertical = function(value, unit = "px") { /* Type 1 */
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`); HTMLElement.prototype.paddingVertical = StyleFunction(function(value, unit = "px") {
this.style.paddingTop = value + unit this.style.paddingTop = value + unit
this.style.paddingBottom = value + unit this.style.paddingBottom = value + unit
return this return this
} })
HTMLElement.prototype.paddingHorizontal = function(value, unit = "px") { HTMLElement.prototype.paddingHorizontal = StyleFunction(function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
this.style.paddingRight = value + unit this.style.paddingRight = value + unit
this.style.paddingLeft = value + unit this.style.paddingLeft = value + unit
return this return this
} })
HTMLElement.prototype.marginVertical = function(value, unit = "px") { HTMLElement.prototype.marginVertical = StyleFunction(function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
this.style.marginTop = value + unit this.style.marginTop = value + unit
this.style.marginBottom = value + unit this.style.marginBottom = value + unit
return this return this
} })
HTMLElement.prototype.marginHorizontal = function(value, unit = "px") { HTMLElement.prototype.marginHorizontal = StyleFunction(function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
this.style.marginRight = value + unit this.style.marginRight = value + unit
this.style.marginLeft = value + unit this.style.marginLeft = value + unit
return this return this
} })
HTMLElement.prototype.fontSize = function(value, unit = "px") { HTMLElement.prototype.fontSize = StyleFunction(function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
switch(value) { switch(value) {
case "6xl": case "6xl":
@@ -441,6 +552,27 @@ HTMLElement.prototype.fontSize = function(value, unit = "px") {
} }
this.style.fontSize = value + unit this.style.fontSize = value + unit
return this return this
})
HTMLElement.prototype.width = function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
this.style.width = value + unit
if(window.getComputedStyle(this).display === "inline") {
this.style.display = "block"
}
return this
}
HTMLElement.prototype.height = function(value, unit = "px") {
if ((typeof value !== 'number' && value !== "auto") || Number.isNaN(value))
throw new Error(`Invalid value: ${value}. Expected a number.`);
this.style.height = value + unit
if(window.getComputedStyle(this).display === "inline") {
this.style.display = "block"
}
return this
} }
function checkPositionType(el) { function checkPositionType(el) {
@@ -661,7 +793,7 @@ window.form = function(cb) {
return el return el
} }
window.input = function(placeholder, width, height) { window.input = function(placeholder = "", width, height) {
let el = document.createElement("input") let el = document.createElement("input")
el.placeholder = placeholder el.placeholder = placeholder
el.style.width = width el.style.width = width
@@ -670,14 +802,18 @@ window.input = function(placeholder, width, height) {
return el return el
} }
window.label = function(text) { window.label = function(inside) {
let el = document.createElement("label") let el = document.createElement("label")
el.innerText = text if(typeof inside === "string") {
el.innerText = inside
} else {
el.render = inside
}
quill.render(el) quill.render(el)
return el return el
} }
window.textarea = function(placeholder) { window.textarea = function(placeholder = "") {
let el = document.createElement("textarea") let el = document.createElement("textarea")
el.placeholder = placeholder el.placeholder = placeholder
quill.render(el) quill.render(el)
@@ -687,25 +823,35 @@ window.textarea = function(placeholder) {
/* STACKS */ /* STACKS */
handleStack = function(cb, name, styles="") {
let nowRendering = quill.rendering[quill.rendering.length-1]
if (nowRendering.innerHTML.trim() === "" && !quill.isStack(nowRendering)) {
nowRendering.style.cssText += styles
nowRendering.classList.add(name)
cb()
if(quill.lastState) {
nowRendering.addStateWatcher(quill.lastState, () => {
nowRendering.innerHTML = ""
cb()
})
}
return nowRendering
} else {
let div = document.createElement("div")
div.classList.add(name)
div.style.cssText += styles
div.render = cb
quill.render(div)
return div
}
}
window.VStack = function (cb = () => {}) { window.VStack = function (cb = () => {}) {
let styles = ` let styles = `
display: flex; display: flex;
flex-direction: column; flex-direction: column;
` `
let nowRendering = quill.rendering[quill.rendering.length-1] return handleStack(cb, "VStack", styles)
if (nowRendering.innerHTML.trim() === "" && !quill.isStack(nowRendering)) {
nowRendering.style.cssText += styles
nowRendering.classList.add("VStack")
cb()
return nowRendering
}
let div = document.createElement("div")
div.classList.add("VStack")
div.style.cssText += styles
div.render = cb
quill.render(div)
return div
} }
window.HStack = function (cb = () => {}) { window.HStack = function (cb = () => {}) {
@@ -713,35 +859,11 @@ window.HStack = function (cb = () => {}) {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
`; `;
let nowRendering = quill.rendering[quill.rendering.length - 1]; return handleStack(cb, "HStack", styles)
if (nowRendering.innerHTML.trim() === "" && !quill.isStack(nowRendering)) {
nowRendering.style.cssText += styles;
nowRendering.classList.add("HStack")
cb();
return nowRendering;
}
let div = document.createElement("div");
div.classList.add("HStack");
div.style.cssText += styles;
div.render = cb;
quill.render(div);
return div;
}; };
window.ZStack = function (cb = () => {}) { window.ZStack = function (cb = () => {}) {
let nowRendering = quill.rendering[quill.rendering.length - 1]; return handleStack(cb, "ZStack")
if (nowRendering.innerHTML.trim() === "" && !quill.isStack(nowRendering)) {
nowRendering.classList.add("ZStack")
cb();
return nowRendering;
}
let div = document.createElement("div");
div.classList.add("ZStack");
div.render = cb;
quill.render(div);
return div;
}; };
/* SHAPES */ /* SHAPES */
@@ -845,8 +967,8 @@ HTMLElement.prototype.onAppear = function(func) {
}; };
HTMLElement.prototype.onClick = function(func) { HTMLElement.prototype.onClick = function(func) {
const onMouseDown = () => func.call(this, false); const onMouseDown = (e) => func.call(this, false, e);
const onMouseUp = () => func.call(this, true); const onMouseUp = (e) => func.call(this, true, e);
this._storeListener("mousedown", onMouseDown); this._storeListener("mousedown", onMouseDown);
this._storeListener("mouseup", onMouseUp); this._storeListener("mouseup", onMouseUp);
return this; return this;
@@ -929,34 +1051,38 @@ HTMLElement.prototype.onTap = function(cb) {
}; };
/* WHY THIS LISTENER IS THE WAY IT IS: /* WHY THIS LISTENER IS THE WAY IT IS:
- If we dispatch the "navigate" event on the window (as one would expect for a "navigate" event), a listener placed on the element will not pick it up. - We can't just put a listener on the element, because a window "navigate" event won't trigger it
- However, if we add the listener on the window, it won't have the "this" scope that a callback normally would. Which makes it much less useful. - We can't just put a listener on the window, because the "this" variable will only refer to the window
- Then, if we try to add that scope using bind(), it makes the function.toString() unreadable, which means we cannot detect duplicate listeners. - And, if we try to re-add that scope using bind(), it makes the return value of .toString() unreadable, which means we cannot detect duplicate listeners.
- Therefore, we just have to attach the navigate event to the element, and manually trigger that when the window listener fires. - Therefore, we attach a global navigate event to the window, and each navigate event in this array, and manually trigger each event when the global one fires.
*/ */
navigateListeners = [] navigateListeners = []
HTMLElement.prototype.onNavigate = function(cb) {
this._storeListener("navigate", cb);
let found = false
for(entry of navigateListeners) {
if(entry.cb.toString() === cb.toString() &&
this.nodeName === entry.el.nodeName) {
found = true
break;
}
}
if(found === false) {
navigateListeners.push({el: this, cb: cb})
}
return this;
};
window.addEventListener("navigate", () => { window.addEventListener("navigate", () => {
for(entry of navigateListeners) { for(entry of navigateListeners) {
entry.el.dispatchEvent(new CustomEvent("navigate")) entry.el.dispatchEvent(new CustomEvent("navigate"))
} }
}) })
HTMLElement.prototype.onNavigate = function(cb) {
this._storeListener("navigate", cb);
let found = false
let elementIndex = Array.from(this.parentNode.children).indexOf(this)
for(entry of navigateListeners) {
if(
entry.cb.toString() === cb.toString()
&& entry.index === elementIndex
&& this.nodeName === entry.el.nodeName
) {
found = true
break;
}
}
if(found === false) {
navigateListeners.push({el: this, cb: cb, index: elementIndex})
}
return this;
};
/* /*
Same principle applies Same principle applies

View File

@@ -43,12 +43,19 @@
} }
body { body {
margin: 0px;
font-family: 'Bona Nova', sans-serif; font-family: 'Bona Nova', sans-serif;
font-size: 16px; font-size: 16px;
background-color: var(--main); background-color: var(--main);
color: var(--accent); color: var(--accent);
} }
@media (max-width: 480px) {
body, html{
overflow-x: hidden;
}
}
#title { #title {
padding: 5px 10px; padding: 5px 10px;
font-size: 1.7rem; font-size: 1.7rem;

View File

@@ -10,8 +10,8 @@ class Connection {
} }
init() { init() {
if(window.location.hostname === "localhost") { if(window.location.hostname.includes("local")) {
this.ws = new WebSocket("ws://" + "localhost:3003") this.ws = new WebSocket("ws://" + window.location.host)
} else { } else {
this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname) this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname)
} }

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -140 780 780" enable-background="new 0 0 780 500" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect width="780" height="500" fill="#FFF" stroke-width="15px" stroke="#000000"/><path d="m409.41 197.26c30.938 0 56.02 23.58 56.02 52.709v0.033c0 29.129-25.082 52.742-56.02 52.742-30.941 0-56.022-23.613-56.022-52.742v-0.033c0-29.129 25.081-52.709 56.022-52.709z" fill="#F47216"/><path d="m321.43 197.94c8.836 0 16.247 1.785 25.27 6.09v22.753c-8.544-7.863-15.955-11.154-25.757-11.154-19.265 0-34.413 15.015-34.413 34.051 0 20.074 14.681 34.195 35.368 34.195 9.312 0 16.586-3.12 24.802-10.856v22.764c-9.343 4.142-16.912 5.775-25.757 5.775-31.277 0-55.581-22.597-55.581-51.736-2e-3 -28.83 24.949-51.882 56.068-51.882zm-97.113 0.626c11.546 0 22.109 3.721 30.942 10.994l-10.748 13.248c-5.351-5.646-10.411-8.027-16.563-8.027-8.854 0-15.301 4.744-15.301 10.988 0 5.354 3.618 8.188 15.944 12.481 23.364 8.043 30.289 15.176 30.289 30.926 0 19.193-14.976 32.554-36.319 32.554-15.631 0-26.993-5.795-36.457-18.871l13.268-12.03c4.73 8.608 12.622 13.223 22.42 13.223 9.163 0 15.947-5.95 15.947-13.983 0-4.164-2.056-7.733-6.158-10.258-2.066-1.195-6.158-2.978-14.199-5.646-19.292-6.538-25.91-13.527-25.91-27.186-1e-3 -16.227 14.213-28.413 32.845-28.413zm234.72 1.729h22.436l28.084 66.592 28.447-66.592h22.267l-45.493 101.69h-11.054l-44.687-101.69zm-301.21 0.152h20.541v99.143h-20.541v-99.143zm411.73 0h58.253v16.799h-37.726v22.006h36.336v16.791h-36.336v26.762h37.726v16.785h-58.253v-99.143zm115.59 57.377c15.471-2.965 23.983-12.926 23.983-28.105 0-18.562-13.575-29.271-37.266-29.271h-30.454v99.144h20.516v-39.83h2.681l28.43 39.828h25.26l-33.15-41.766zm-17.218-11.736h-6.002v-30.025h6.326c12.791 0 19.744 5.049 19.744 14.697 2e-3 9.967-6.951 15.328-20.068 15.328zm-576.09-45.641h-30.149v99.143h29.992c15.946 0 27.465-3.543 37.573-11.445 12.014-9.359 19.117-23.467 19.117-38.057 1e-3 -29.259-23.221-49.641-56.533-49.641zm23.997 74.479c-6.454 5.484-14.837 7.879-28.108 7.879h-5.514v-65.559h5.513c13.271 0 21.323 2.238 28.108 8.018 7.104 5.956 11.377 15.184 11.377 24.682 1e-3 9.513-4.273 19.024-11.376 24.98z"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -9 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="57" height="39" rx="3.5" fill="white" stroke="#F3F3F3"/>
<path d="M34.3102 28.9765H23.9591V10.5122H34.3102V28.9765Z" fill="#FF5F00"/>
<path d="M24.6223 19.7429C24.6223 15.9973 26.3891 12.6608 29.1406 10.5107C27.1285 8.93843 24.5892 7.99998 21.8294 7.99998C15.2961 7.99998 10 13.2574 10 19.7429C10 26.2283 15.2961 31.4857 21.8294 31.4857C24.5892 31.4857 27.1285 30.5473 29.1406 28.975C26.3891 26.8249 24.6223 23.4884 24.6223 19.7429" fill="#EB001B"/>
<path d="M48.2706 19.7429C48.2706 26.2283 42.9745 31.4857 36.4412 31.4857C33.6814 31.4857 31.1421 30.5473 29.1293 28.975C31.8815 26.8249 33.6483 23.4884 33.6483 19.7429C33.6483 15.9973 31.8815 12.6608 29.1293 10.5107C31.1421 8.93843 33.6814 7.99998 36.4412 7.99998C42.9745 7.99998 48.2706 13.2574 48.2706 19.7429" fill="#F79E1B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 -140 780 780" enable-background="new 0 0 780 500" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40 C0,17.909,17.909,0,40,0z" fill="#0E4595"/><path d="m293.2 348.73l33.361-195.76h53.36l-33.385 195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725 0-89.865 26.55-90.18 64.603-0.299 28.13 26.514 43.822 46.752 53.186 20.771 9.595 27.752 15.714 27.654 24.283-0.131 13.121-16.586 19.116-31.922 19.116-21.357 0-32.703-2.967-50.227-10.276l-6.876-3.11-7.489 43.823c12.463 5.464 35.51 10.198 59.438 10.443 56.09 0 92.5-26.246 92.916-66.882 0.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268 0-8.137 9.668-16.839 30.557-16.839 17.449-0.27 30.09 3.535 39.938 7.5l4.781 2.26 7.232-42.429m137.31-4.223h-41.232c-12.773 0-22.332 3.487-27.941 16.234l-79.244 179.4h56.031s9.16-24.123 11.232-29.418c6.125 0 60.555 0.084 68.338 0.084 1.596 6.853 6.49 29.334 6.49 29.334h49.514l-43.188-195.64zm-65.418 126.41c4.412-11.279 21.26-54.723 21.26-54.723-0.316 0.522 4.379-11.334 7.074-18.684l3.605 16.879s10.219 46.729 12.354 56.528h-44.293zm-363.3-126.41l-52.24 133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766 171.2 56.456-0.064 84.004-195.39h-56.521" fill="#ffffff"/><path d="m146.92 152.96h-86.041l-0.681 4.073c66.938 16.204 111.23 55.363 129.62 102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527" fill="#F2AE14"/></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

5
ui/_/icons/jobs.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.3 KiB

4
ui/_/icons/letter.svg Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<path d="M0 0 C33 0 66 0 100 0 C100 23.76 100 47.52 100 72 C67 72 34 72 0 72 C0 48.24 0 24.48 0 0 Z M4 4 C3.46383745 8.70053019 3.46383745 8.70053019 5.30664062 10.5546875 C5.91701172 10.99039062 6.52738281 11.42609375 7.15625 11.875 C7.84114502 12.37870117 8.52604004 12.88240234 9.23168945 13.40136719 C9.98023193 13.92891602 10.72877441 14.45646484 11.5 15 C13.06813799 16.14868129 14.63450237 17.29978719 16.19921875 18.453125 C17.40070557 19.33194336 17.40070557 19.33194336 18.62646484 20.22851562 C22.28176453 22.95664302 25.79456149 25.84835522 29.3125 28.75 C31.2591282 30.33484221 33.20813973 31.91671841 35.15722656 33.49853516 C36.36876709 34.48568066 37.57657813 35.4774244 38.78027344 36.47412109 C40.40268905 37.81286849 42.04179632 39.1275644 43.6875 40.4375 C44.59886719 41.17871094 45.51023438 41.91992188 46.44921875 42.68359375 C48.88630843 44.26660079 48.88630843 44.26660079 51.37890625 43.5859375 C54.95082046 41.42468986 58.06328957 38.87595616 61.25 36.1875 C67.05660886 31.37582668 72.93368091 26.68843648 78.9375 22.125 C80.0061731 21.30745239 80.0061731 21.30745239 81.09643555 20.47338867 C84.06177854 18.20933035 87.03509444 15.97490703 90.0703125 13.8046875 C91.30394531 12.91136719 91.30394531 12.91136719 92.5625 12 C93.24441406 11.525625 93.92632812 11.05125 94.62890625 10.5625 C96.54964019 8.72009187 96.54964019 8.72009187 96 4 C65.64 4 35.28 4 4 4 Z M4 15 C4 32.49 4 49.98 4 68 C34.36 68 64.72 68 96 68 C96 50.51 96 33.02 96 15 C91.10723979 18.66957016 86.23777639 22.33985116 81.4375 26.125 C80.5556604 26.81843506 80.5556604 26.81843506 79.65600586 27.52587891 C76.42735841 30.06945531 73.21156659 32.62826175 70.0078125 35.203125 C69.01890015 35.99759033 69.01890015 35.99759033 68.01000977 36.80810547 C66.75119369 37.82090246 65.49376977 38.83543328 64.23803711 39.85205078 C63.07629198 40.7874235 61.90867537 41.71555794 60.73486328 42.63574219 C59.54616335 43.57050931 58.37318371 44.52551784 57.21435547 45.49707031 C54.26370419 47.84496996 52.75924576 48.97890984 48.90625 49.0859375 C45.41094599 47.77989648 43.28715117 46.10681719 40.5 43.625 C39.44697905 42.70771873 38.39222174 41.79242782 37.3359375 40.87890625 C36.7903418 40.40340332 36.24474609 39.92790039 35.68261719 39.43798828 C32.89861809 37.05874355 30.01440497 34.81161154 27.125 32.5625 C26.54911133 32.11293945 25.97322266 31.66337891 25.37988281 31.20019531 C24.19857561 30.27805578 23.01693136 29.35634787 21.83496094 28.43505859 C19.90812651 26.92814897 17.98846374 25.41247563 16.0703125 23.89453125 C15.43077637 23.38913818 14.79124023 22.88374512 14.13232422 22.36303711 C12.90121746 21.38980809 11.671035 20.41540842 10.44189453 19.43969727 C7.37045638 16.99238729 7.37045638 16.99238729 4 15 Z " fill="#000000" transform="translate(0,14)"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
ui/_/images/fabric.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

BIN
ui/_/images/knight.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

View File

@@ -9,6 +9,6 @@
<script src="/_/code/zod.js"></script> <script src="/_/code/zod.js"></script>
<script type="module" src="75820185/index.js"></script> <script type="module" src="75820185/index.js"></script>
</head> </head>
<body style="margin: 0px"> <body>
</body> </body>
</html> </html>

View File

@@ -10,8 +10,8 @@ class Connection {
} }
init() { init() {
if(window.location.hostname === "localhost") { if(window.location.hostname.includes("local")) {
this.ws = new WebSocket("ws://" + "localhost:3003") this.ws = new WebSocket("ws://" + window.location.host)
} else { } else {
this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname) this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname)
} }

View File

@@ -30,41 +30,6 @@ class Forum extends Shadow {
render() { render() {
ZStack(() => { ZStack(() => {
HStack(() => {
VStack(() => {
img("/_/icons/logo.svg", "2em")
.padding(0.8, em)
.borderRadius(12, px)
.marginHorizontal(1, em)
.onHover(function (hovering) {
if(hovering) {
this.style.background = "var(--darkbrown)"
} else {
this.style.background = ""
}
})
.opacity(0)
img("/_/icons/place/austin.svg", "2em")
.padding(0.8, em)
.borderRadius(12, px)
.marginHorizontal(1, em)
.onHover(function (hovering) {
if(hovering) {
this.style.background = "var(--darkbrown)"
} else {
this.style.background = ""
}
})
.opacity(0)
})
.height(100, vh)
.paddingLeft(2, em)
.paddingRight(2, em)
.gap(1, em)
.marginTop(20, vh)
VStack(() => { VStack(() => {
ForumPanel() ForumPanel()
@@ -90,10 +55,7 @@ class Forum extends Shadow {
.alignHorizontal("center") .alignHorizontal("center")
.alignVertical("end") .alignVertical("end")
}) })
.width(100, "%") .onAppear(() => document.body.style.backgroundColor = "var(--darkbrown)")
.height(87, vh)
.x(0).y(0, vh)
})
.width(100, pct) .width(100, pct)
.height(100, pct) .height(100, pct)
} }

View File

@@ -54,14 +54,12 @@ class ForumPanel extends Shadow {
.paddingLeft(4, pct) .paddingLeft(4, pct)
.backgroundColor("var(--darkbrown)") .backgroundColor("var(--darkbrown)")
.onAppear(async () => { .onAppear(async () => {
console.log("appear")
requestAnimationFrame(() => { requestAnimationFrame(() => {
this.scrollTop = this.scrollHeight this.scrollTop = this.scrollHeight
}); });
let res = await Socket.send({app: "FORUM", operation: "GET", msg: {forum: "HY", number: 100}}) let res = await Socket.send({app: "FORUM", operation: "GET", msg: {forum: "HY", number: 100}})
if(!res) console.error("failed to get messages") if(!res) console.error("failed to get messages")
if(res.msg.length > 0 && this.messages.length === 0) { if(res.msg.length > 0 && this.messages.length === 0) {
console.log("rerendering", res.msg)
this.messages = res.msg this.messages = res.msg
this.rerender() this.rerender()
} }

View File

@@ -1,19 +1,74 @@
class AppMenu extends Shadow { class AppMenu extends Shadow {
selected = ""
onNewSelection() {
this.$$("img").forEach((image) => {
image.style.background = ""
})
}
render() { render() {
console.log("rendering")
HStack(() => { HStack(() => {
img("/_/icons/mail.png", "2em", "2em") img("/_/icons/Column.svg", "1.5em", "1.5em")
img("/_/icons/Column.svg", "2em", "2em") .attr({app: "forum"})
p("S") .padding(0.5, em)
p("S") .borderRadius(10, px)
p("S") .onAppear(function () {
this.style.border = "1px solid black"
})
.onClick((finished, e) => {
if(finished) {
this.onNewSelection()
}
e.target.style.background = "var(--accent)"
console.log(e.target, e.target.style.background)
if(finished) {
window.navigateTo("/")
}
})
img("/_/icons/letter.svg", "1.5em", "1.5em")
.attr({app: "messages"})
.padding(0.5, em)
.borderRadius(10, px)
.onAppear(function () {
this.style.border = "1px solid black"
})
.onClick((finished, e) => {
if(finished) {
this.onNewSelection()
}
e.target.style.background = "rgb(112 150 114)"
if(finished) {
window.navigateTo("/messages")
}
})
img("/_/icons/jobs.svg", "1.5em", "1.5em")
.attr({app: "jobs"})
.padding(0.5, em)
.borderRadius(10, px)
.onAppear(function () {
this.style.border = "1px solid black"
})
.onClick((finished, e) => {
if(finished) {
this.onNewSelection()
}
e.target.style.background = "#9392bb"
if(finished) {
window.navigateTo("/jobs")
}
})
}) })
.borderTop("1px solid black") .borderTop("1px solid black")
.height(3, em) .height("auto")
.position('fixed')
.background("var(--main)")
.zIndex(1)
.x(0).yBottom(0) .x(0).yBottom(0)
.justifyContent("space-between") .justifyContent("space-between")
.paddingHorizontal(2, em) .paddingHorizontal(4, em)
.paddingVertical(1, em) .paddingVertical(1, em)
.transform("translateY(-50%)")
.width(100, vw) .width(100, vw)
.boxSizing("border-box") .boxSizing("border-box")
} }

View File

@@ -1,11 +1,36 @@
import "./AppMenu.js" import "./AppMenu.js"
import "../apps/Forum/Forum.js"
import "../apps/Messages/Messages.js"
import "../apps/Jobs/Jobs.js"
class Home extends Shadow { class Home extends Shadow {
render() { render() {
ZStack(() => { ZStack(() => {
ZStack(() => {
switch(window.location.pathname) {
case "/":
Forum()
break;
case "/messages":
Messages()
break;
case "/jobs":
Jobs()
break;
}
})
.onNavigate(function () {
console.log("navigate")
this.rerender()
})
AppMenu() AppMenu()
}) })
.overflowX("hidden")
} }
} }

View File

@@ -0,0 +1,25 @@
class LoadingCircle extends Shadow {
render() {
div()
.borderRadius(100, pct)
.width(2, em).height(2, em)
.x(45, pct).y(50, pct)
.center()
.backgroundColor("var(--accent")
.transition("transform 1.75s ease-in-out")
.onAppear(function () {
let growing = true;
setInterval(() => {
if (growing) {
this.style.transform = "scale(1.5)";
} else {
this.style.transform = "scale(0.7)";
}
growing = !growing;
}, 750);
});
}
}
register(LoadingCircle)

View File

@@ -9,6 +9,6 @@
<script src="/_/code/zod.js"></script> <script src="/_/code/zod.js"></script>
<script type="module" src="75820185/index.js"></script> <script type="module" src="75820185/index.js"></script>
</head> </head>
<body style="margin: 0px"> <body>
</body> </body>
</html> </html>

View File

@@ -1,4 +1,4 @@
import Socket from "./ws/Socket.js" import Socket from "/_/code/ws/Socket.js"
import "./components/Home.js" import "./components/Home.js"
import util from "./util.js" import util from "./util.js"

View File

@@ -5,11 +5,25 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/_/icons/logo.svg"> <link rel="icon" href="/_/icons/logo.svg">
<link rel="stylesheet" href="/_/code/shared.css"> <link rel="stylesheet" href="/_/code/shared.css">
<link
rel="preload"
href="/_/fonts/BonaNova/BonaNova-Regular.woff"
as="font"
type="font/woff2"
crossorigin
>
<link
rel="preload"
href="/_/fonts/BonaNova/BonaNova-Bold.woff"
as="font"
type="font/woff"
crossorigin
>
<style> <style>
body { body {
font-size: 16px; font-size: 16px;
background-image: url("/_/images/fabric.png"); background-image: url("/_/images/fabric.webp");
background-size: 33vw auto; /* width height of each tile */ background-size: 33vw auto; /* width height of each tile */
} }
</style> </style>

View File

@@ -10,8 +10,12 @@ class Events extends Shadow {
] ]
render() { render() {
ZStack(() => {
VStack(() => { VStack(() => {
h1("HYPERIA")
.marginBottom(0, em)
p("Public Events") p("Public Events")
.fontSize(1.2, em) .fontSize(1.2, em)
.marginBottom(2, em) .marginBottom(2, em)
@@ -20,7 +24,7 @@ class Events extends Shadow {
Stack(() => { Stack(() => {
VStack(() => { VStack(() => {
p(`January 23, 2025`) p(`February 7, 2026`)
p(`Hyperia Winter Ball`) p(`Hyperia Winter Ball`)
.fontSize(1.2, em) .fontSize(1.2, em)
@@ -29,14 +33,31 @@ class Events extends Shadow {
}) })
p(`Join us in Austin, Texas for a great dance, with free drinks and live music. <br><br>Admission: $30 for men, women are free.`) p(`Join us in Austin, Texas for two-stepping and live music by Noah Kurtis. 21 and up.`)
.marginRight(4, em) .marginRight(4, em)
button("Tickets Available Soon") HStack(() => {
img("/_/icons/creditcards/visa.svg")
img("/_/icons/creditcards/mastercard.svg")
img("/_/icons/creditcards/discover.svg")
img("/_/icons/creditcards/amex.svg")
})
.alignSelf("flex-start")
.height(2, em)
.maxWidth(40, vw)
button("RSVP")
.color("var(--darkbrown") .color("var(--darkbrown")
.border("1px solid #ab2f007d") .border("1px solid #ab2f007d")
.background('var(--grey)') .background('var(--green)')
.marginLeft("auto") .marginLeft("auto")
.onClick(async function() {
window.open("https://partiful.com/e/XqnPwBKS9vUMd8GYX3xz?c=HLU81h69", "_blank", "noopener");
// this.innerText = "Loading..."
// const res = await fetch("/create-checkout-session", { method: "POST" });
// const data = await res.json();
// window.location = data.url;
})
}) })
.gap(3, em) .gap(3, em)
.color("var(--darkbrown)") .color("var(--darkbrown)")
@@ -47,7 +68,258 @@ class Events extends Shadow {
}) })
.marginLeft(window.isMobile() ? 0 : 15, vmax) .marginLeft(window.isMobile() ? 0 : 15, vmax)
.marginRight(window.isMobile() ? 0 : 15, vmax) .marginRight(window.isMobile() ? 0 : 15, vmax)
.marginTop(15, vmax) .marginTop(10, vmax)
HStack(() => {
p("Privacy Policy")
.onHover(function (hovering) {
if(hovering) {
this.style.color = "var(--darkbrown)"
} else {
this.style.color = ""
}
})
.onClick(() => {
this.$("#policyWindow").style.display = "flex"
})
p("Refund and Return Policy")
.onHover(function (hovering) {
if(hovering) {
this.style.color = "var(--darkbrown)"
} else {
this.style.color = ""
}
})
.onClick(() => {
this.$("#refundWindow").style.display = "flex"
})
p("Contact Us")
.onHover(function (hovering) {
if(hovering) {
this.style.color = "var(--darkbrown)"
} else {
this.style.color = ""
}
})
.onClick(() => {
this.$("#contactWindow").style.display = "flex"
})
})
.x(50, vw).yBottom(0, vh)
.center()
.gap(2, em)
.opacity(0.5)
.cursor("default")
})
VStack(() => {
p("Privacy Policy")
.fontSize(2, em)
.fontWeight(600)
.marginBottom(1, em)
p("We value your privacy. This Privacy Policy explains how we collect, use, store, and protect your information when you use our website or services.")
p("1. Information We Collect")
.fontWeight(600)
.marginTop(1, em)
p("• Personal information you provide, such as your name, email address, or other contact details.")
p("• Automatically collected data, including IP address, browser type, device information, and usage statistics.")
p("• Cookies or similar tracking technologies that help us improve the user experience.")
p("2. How We Use Your Information")
.fontWeight(600)
.marginTop(1, em)
p("• To operate and improve our website and services.")
p("• To communicate with you about updates, support requests, or account-related matters.")
p("• To maintain security, prevent fraud, and ensure proper functionality.")
p("3. How We Share Information")
.fontWeight(600)
.marginTop(1, em)
p("We do not sell your personal information. We may share data only with trusted service providers who help us operate the platform, or when required by law.")
p("4. Data Storage & Security")
.fontWeight(600)
.marginTop(1, em)
p("We use reasonable technical and administrative safeguards to protect your information. However, no system is completely secure, and we cannot guarantee absolute protection.")
p("5. Cookies")
.fontWeight(600)
.marginTop(1, em)
p("Our site may use cookies to remember preferences, analyze traffic, and enhance usability. You can disable cookies in your browser settings, but some features may stop working.")
p("6. Your Rights")
.fontWeight(600)
.marginTop(1, em)
p("Depending on your location, you may have rights to access, update, delete, or request a copy of your personal data. Contact us if you wish to exercise these rights.")
p("7. Third-Party Links")
.fontWeight(600)
.marginTop(1, em)
p("Our website may contain links to third-party sites. We are not responsible for their content or privacy practices.")
p("8. Changes to This Policy")
.fontWeight(600)
.marginTop(1, em)
p("We may update this Privacy Policy from time to time. Updated versions will be posted on this page with the effective date.")
p("9. Contact Us")
.fontWeight(600)
.marginTop(1, em)
p("If you have any questions about this Privacy Policy, feel free to contact us at info@hyperia.so.")
p("x")
.onClick(function (done) {
if(done) {
this.parentElement.style.display = "none"
}
})
.color("var(--red)")
.xRight(1, em).y(1, em)
.fontSize(2, em)
.cursor("pointer")
})
.x(50, vw).y(50, vh)
.width(70, vw).height(70, vh)
.center()
.backgroundColor("var(--accent)")
.display("none")
.overflow("scroll")
.padding(1, em)
.border("3px solid black")
.color("var(--darkbrown)")
.attr({ id: "policyWindow" })
VStack(() => {
p("Refund & Return Policy")
.fontSize(2, em)
.fontWeight(600)
.marginBottom(1, em)
p("1. Eligibility for Refunds")
.fontWeight(600)
.marginTop(1, em)
p("• Refund requests may be considered when submitted within 14 days of purchase.")
p("• To qualify, you must provide proof of purchase and a valid reason for the request.")
p("• Certain digital products or services may be non-refundable once accessed or downloaded.")
p("2. Non-Refundable Items")
.fontWeight(600)
.marginTop(1, em)
p("• Products or services that have already been delivered, downloaded, or accessed in full.")
p("• Custom work, personalized items, or one-time service fees.")
p("• Any promotional or discounted items, unless required by law.")
p("3. Returns (If Applicable)")
.fontWeight(600)
.marginTop(1, em)
p("• Physical items must be returned in their original condition.")
p("• You are responsible for return shipping costs unless the item was defective or incorrect.")
p("• Items damaged through misuse or neglect cannot be returned.")
p("4. Processing Refunds")
.fontWeight(600)
.marginTop(1, em)
p("• Approved refunds are issued to the original payment method.")
p("• Processing times may vary depending on your bank or payment provider.")
p("• We will notify you once your refund has been initiated.")
p("5. Cancellations")
.fontWeight(600)
.marginTop(1, em)
p("• Orders or subscriptions may be cancelled before fulfillment or renewal.")
p("• If Hyperia declare a cancellation of any product or event, a refund will be issued to all parties.")
p("6. Contact for Refund Requests")
.fontWeight(600)
.marginTop(1, em)
p("If you need to request a refund, return an item, or cancel an order, please contact us at info@hyperia.so. Include your order number and relevant details so we can assist you promptly.")
p("7. Policy Updates")
.fontWeight(600)
.marginTop(1, em)
p("We may update this Refund & Return Policy from time to time. Any changes will be posted on this page with the effective date.")
p("x")
.onClick(function (done) {
if(done) {
this.parentElement.style.display = "none"
}
})
.color("var(--red)")
.xRight(1, em).y(1, em)
.fontSize(2, em)
.cursor("pointer")
})
.x(50, vw).y(50, vh)
.width(70, vw).height(70, vh)
.center()
.backgroundColor("var(--accent)")
.display("none")
.overflow("scroll")
.padding(1, em)
.border("3px solid black")
.color("var(--darkbrown)")
.attr({ id: "refundWindow" })
VStack(() => {
p("Contact Us")
.fontSize(2, em)
.fontWeight(600)
.marginBottom(1, em)
p("Email: info@hyperia.so")
p("Phone: 813-373-9100")
p("Address: 2014 E 9th St, Unit A, Austin TX")
p("x")
.onClick(function (done) {
if(done) {
this.parentElement.style.display = "none"
}
})
.color("var(--red)")
.xRight(1, em).y(1, em)
.fontSize(2, em)
.cursor("pointer")
})
.gap(2, em)
.x(50, vw).y(50, vh)
.width(50, vw).height(50, vh)
.center()
.backgroundColor("var(--accent)")
.display("none")
.overflow("scroll")
.padding(1, em)
.border("3px solid black")
.color("var(--darkbrown)")
.attr({ id: "contactWindow" })
} }
} }

View File

@@ -4,6 +4,7 @@ import "./Why.js"
import "./Events.js" import "./Events.js"
import "./Join.js" import "./Join.js"
import "./SignIn.js" import "./SignIn.js"
import "./Success.js"
class Home extends Shadow { class Home extends Shadow {
render() { render() {
@@ -24,27 +25,37 @@ class Home extends Shadow {
switch(window.location.pathname) { switch(window.location.pathname) {
case "/": case "/":
img("/_/images/knight.png", "29vmax") img("/_/images/knight.webp", "29vmax")
.position("absolute") .position("absolute")
.left(50, vw).top(isMobile() ? 50 : 53, vh) .left(50, vw).top(isMobile() ? 50 : 53, vh)
.center() .center()
if(!isMobile()) {
p("H &nbsp; Y &nbsp; P &nbsp; E &nbsp; R &nbsp; I &nbsp; A &nbsp;") p("H &nbsp; Y &nbsp; P &nbsp; E &nbsp; R &nbsp; I &nbsp; A &nbsp;")
.x(50, vw).y(isMobile() ? 50 : 53, vh) .x(50, vw).y(53, vh)
.textAlign("center") .textAlign("center")
.center() .center()
.color("var(--gold)") .color("var(--gold)")
.fontSize(isMobile() ? 6 : 5, vw) .fontSize(5, vw)
.maxWidth(isMobile() ? 0.8 : 100, em) .maxWidth(isMobile() ? 1000 : 100, em)
} else {
p("H &nbsp; Y &nbsp; P &nbsp; E &nbsp; R &nbsp; I &nbsp; A &nbsp;")
.x(46, vw).y(isMobile() ? 50 : 53, vh)
.textAlign("center")
.color("var(--gold)")
.fontSize(5, vw)
}
let text = "A Classical Christian Association" if(!isMobile()) {
let text = "A Classical Christian Network"
p(isMobile() ? text : text.toUpperCase()) p(isMobile() ? text : text.toUpperCase())
.x(50, vw).yBottom(isMobile() ? 1 : 3, vh) .x(50, vw).yBottom(isMobile() ? 1 : 3, vh)
.center() .center()
.letterSpacing(0.3, em) .letterSpacing(0.1, em)
.width(isMobile() ? 80 : 100, vw) .width(isMobile() ? 80 : 100, vw)
.fontSize(isMobile() ? 0.8 : 1, em) .fontSize(isMobile() ? 0.8 : 1, em)
.textAlign("center") .textAlign("center")
}
break; break;
case "/why": case "/why":
Why() Why()
@@ -55,6 +66,9 @@ class Home extends Shadow {
case "/join": case "/join":
Join() Join()
break; break;
case "/success":
Success()
break;
default: default:
if(window.location.pathname.startsWith("/signup")) { if(window.location.pathname.startsWith("/signup")) {

View File

@@ -0,0 +1,9 @@
class Success extends Shadow {
render() {
p("Thanks for your purchase! You will receive a confirmation email shortly. <br><br> <b>Keep that email; it will be checked at the door.</b>")
.x(50, vw).y(50, vh)
.center()
}
}
register(Success)

View File

@@ -1,68 +0,0 @@
// Create the hover display element
const hoverBox = document.createElement('div');
hoverBox.style.id = "hoverBox"
hoverBox.style.position = 'fixed';
hoverBox.style.padding = '8px 12px';
hoverBox.style.backgroundColor = 'var(--green)';
hoverBox.style.border = '1px solid var(--tan)';
hoverBox.style.color = 'var(--tan)';
hoverBox.style.opacity = '80%';
hoverBox.style.pointerEvents = 'none';
hoverBox.style.zIndex = '9999';
hoverBox.style.fontFamily = 'sans-serif';
hoverBox.style.fontSize = '14px';
hoverBox.style.display = 'none';
document.body.appendChild(hoverBox);
let currentTarget = null;
function capitalizeWords(str) {
return str
.split('-')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}
function onMouseOver(e) {
const target = e.target;
let paintingName; let artistName;
if(target.id === "back") {
paintingName = "The Garden Terrace"
artistName = "Caspar David Friedrich"
} else if (target.tagName.toLowerCase() === 'img' && target.classList.contains('interactive')) {
const match = target.src.match(/([^\/]+)\.([a-z]{3,4})(\?.*)?$/i); // extract filename
if (!match) return;
const filename = match[1];
const parts = filename.split('_');
if (parts.length !== 2) return;
paintingName = capitalizeWords(parts[0]);
artistName = capitalizeWords(parts[1]);
} else {
return
}
hoverBox.innerHTML = `<strong>${paintingName}</strong><br><span style="font-size: 12px;">${artistName}</span>`;
hoverBox.style.display = 'block';
currentTarget = target;
hoverBox.style.left = `${e.clientX + 15}px`;
hoverBox.style.top = `${e.clientY + 15}px`;
}
function onMouseOut(e) {
if (e.target === currentTarget) {
hoverBox.style.display = 'none';
currentTarget = null;
}
}
function onMouseMove(e) {
if (hoverBox.style.display === 'block') {
hoverBox.style.left = `${e.clientX + 15}px`;
hoverBox.style.top = `${e.clientY + 15}px`;
}
}
document.addEventListener('mouseover', onMouseOver);
document.addEventListener('mouseout', onMouseOut);
document.addEventListener('mousemove', onMouseMove);

View File

@@ -1,56 +0,0 @@
let treeOriginalTop = null;
let currentVelocity = 0;
let isAnimating = false;
window.addEventListener('wheel', (e) => {
if(window.innerWidth < 600) {
return;
}
// Add scroll delta to the velocity
currentVelocity += e.deltaY;
// Start animation loop if not running
if (!isAnimating) {
isAnimating = true;
requestAnimationFrame(animateScroll);
}
}, { passive: false });
function animateScroll() {
const tree = document.getElementById("tree");
if (!treeOriginalTop) {
treeOriginalTop = parseInt(getComputedStyle(tree).top);
}
const treeHeightPX = 0.83 * window.innerHeight;
let treeTopPX = parseInt(getComputedStyle(tree).top);
// Limit per-frame speed (but NOT total speed)
let multiplier = window.innerHeight / 2000;
let delta = Math.max(-100 * multiplier, Math.min(100 * multiplier, currentVelocity));
// Apply the scroll
let newTop = treeTopPX - delta;
// Clamp top/bottom bounds
const maxTop = treeOriginalTop;
const minTop = treeOriginalTop - treeHeightPX;
if (newTop > maxTop) newTop = maxTop;
if (newTop < minTop) newTop = minTop;
tree.style.top = `${newTop}px`;
// Slowly reduce velocity
currentVelocity *= 0.85;
// If velocity is small, stop
if (Math.abs(currentVelocity) > 0.5) {
requestAnimationFrame(animateScroll);
} else {
isAnimating = false;
currentVelocity = 0;
}
}

View File

@@ -1,20 +1,5 @@
See https://github.com/return-to-the-land/go-backend for instructions. # Installs
# Style Guidelines Stripe CLI
- Font size is defined in the index.html. Only use rem as a unit.
# Documentation stripe listen --forward-to localhost:3003/webhook
```go install golang.org/x/tools/cmd/godoc@latest```
```$HOME/go/bin/godoc -http=:6060``` (to run on Mac)
Fix Redirect Issues:
Have the go server determine redirect, generate a random URL from it
When random url is accessed by frontend -> redirect to home
# Resources
Convert image to webp (so it's smaller)
https://www.freeconvert.com/jpg-to-webp/download