Public
Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { myspaceCSS } from "https://esm.town/v/jdan/myspaceCSS";
interface MyspaceProfileArgs {
displayName: string;
info: {
imageUrl: string;
allImagesUrl?: string;
status: string;
gender?: string;
age: number;
location: string[];
lastLogin: string;
};
contact: {
sendMessage: string;
forwardToFriend: string;
addToFriends: string;
addToFavorites: string;
};
links: { url: string; text: string }[];
interests: {
general?: string;
music?: string;
movies?: string;
television?: string;
books?: string;
heroes?: string;
};
details: {
status?: string;
hereFor?: string;
hometown?: string;
sign?: string;
smokeDrink?: string;
occupation?: string;
};
schools: {
details: string[];
start: string;
end: string;
}[];
blog: {
allPostsUrl?: string;
posts: { title: string; url: string }[];
};
blurbs: {
aboutMe: string;
whoIdLikeToMeet: string;
};
top8: {
allFriendsUrl?: string;
friends: Friend[];
};
comments: {
friend: Friend;
timestamp: string;
content: string;
}[];
seo: {
title: string;
description?: string;
iconUrl?: string;
};
}
interface Friend {
name: string;
url: string;
imageUrl: string;
}
export function myspaceHtml(
{
displayName,
links,
info,
contact,
interests,
details,
schools,
blog,
blurbs,
top8,
comments,
seo,
}: MyspaceProfileArgs,
) {
const css = myspaceCSS();
return `
<html>
<head>
<title>${seo.title}</title>
${seo.description ? `<meta name="description" content="${seo.description}">` : ""}
${seo.iconUrl ? `<link rel="Shortcut Icon" type="image/x-icon" href="${seo.iconUrl}">` : ""}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>${myspaceCSS}</style>
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 28, 2024