-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (115 loc) · 5.58 KB
/
index.html
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/x-icon" href="favicon.svg">
<!-- Google tag (gtag.js) -->
<script defer async src="https://www.googletagmanager.com/gtag/js?id=G-6HEHXVJ98S"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-6HEHXVJ98S');
</script>
</head>
<body>
<script defer>
function setthestuff() {
var userInput = document.getElementById("userInput").value;
console.log(userInput);
var userDisplay = document.getElementById("userDisplay");
var linkValue = userInput.split("/");
var shareValue = linkValue[1] + "@" + linkValue[0];
if (userInput.length > 0) {
userDisplay.href = shareValue;
userDisplay.textContent = "mastofind.me/" + shareValue;
console.log(userInput);
localStorage.setItem('user_instance', linkValue[0]);
localStorage.setItem('user_name', linkValue[1]);
globalUsername = localStorage.getItem('user_name');
globalDomain = localStorage.getItem('user_instance');
}
}
async function onloadstuff() {
await sleep(100);
const inputBox = document.getElementById("userInput");
inputBox.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
setthestuff();;
}
});
if (localStorage.getItem('user_name') != null && localStorage.getItem('user_instance') != null) {
var userDisplay = document.getElementById("userDisplay");
var shareValue = localStorage.getItem('user_name') + "@" + localStorage.getItem('user_instance');
console.log(shareValue);
userDisplay.href = shareValue;
userDisplay.textContent = "mastofind.me/" + shareValue;
console.log(userInput);
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
window.onload = onloadstuff();
let globalUsername = localStorage.getItem('user_name');
let globalDomain = localStorage.getItem('user_instance');
</script>
<img src="header.svg">
<div class="wide">
<h1>Find yourself on Mastodon at</h1>
<h1><a href="mastofind.me" id="userDisplay">mastofind.me</a></h1>
</div>
<div class="button-groupie">
<div class="form-group">
<span>https://</span>
<input class="form-field" type="text" placeholder="domain.tld/@username" spellcheck="false" id="userInput">
</div>
<button class="btn" onclick="setthestuff()">
<span>Set Your Username & Domain</span>
<svg preserveAspectRatio="none" viewBox="0 0 132 45">
<g clip-path="url(#clip)" filter="url(#goo-big)">
<circle class="top-left" cx="49.5" cy="-0.5" r="26.5" />
<circle class="middle-bottom" cx="70.5" cy="40.5" r="26.5" />
<circle class="top-right" cx="104" cy="6.5" r="27" />
<circle class="right-bottom" cx="123.5" cy="36.5" r="26.5" />
<circle class="left-bottom" cx="16.5" cy="28" r="30" />
</g>
<defs>
<clipPath id="clip">
<rect width="132" height="45" rx="7" />
</clipPath>
</defs>
</svg>
</button>
</div>
<div>
<h2>What is mastofind.me?</h2>
<h3>This website provides an easy way to link to your Mastodon profile for others, without other people ending
up on a different server from their own</h3>
<h3>I.E it solves the problem of me sharing a <a rel="me" href="https://mastodon.social/@JayBigGuy10">mastodon.social/@JayBigGuy10</a> link to a user of
mstdn.social, spacey.space or any other server, where they would have to copy my @username@server to their
own app or website</h3>
<h3>Your server and username are stored entirely in your own local browser, and the source code can be viewed on
my github <a href="https://github.com/jaybigguy10/jaybigguy10.github.io">here</a></h3>
</div>
<svg width="0" height="0">
<defs>
<filter id="goo" x="-50%" width="200%" y="-50%" height="200%" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="3" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -7"
result="cm" />
</filter>
<filter id="goo-light" x="-50%" width="200%" y="-50%" height="200%" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="1.25" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -7"
result="cm" />
</filter>
<filter id="goo-big" x="-50%" width="200%" y="-50%" height="200%" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="7" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -7"
result="cm" />
</filter>
</defs>
</svg>
</body>
</html>