-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
180 lines (177 loc) · 4.92 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<html>
<head>
<style>
#notTwitter {
display: none;
}
#twitter {
display: none;
}
#choices {
display: grid;
gap: 5px;
}
#create {
display: none;
}
#createGrid {
display: grid;
}
#share {
display: none;
}
#result {
display: none;
}
#shareAnything {
display: none;
}
#shareLink {
display: none;
background: #ccc;
padding: 10px;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
}
#shareMessage {
display: none;
background: #ccc;
padding: 10px;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
}
#content {
margin: auto;
max-width: 700px;
padding: 10px;
border: 1px solid black;
}
#generate {
margin: 10px 0px;
padding: 10px;
background: #994444;
font-weight: bold;
font-size: 32px;
color: #fff;
}
#urlShareSpace {
background-color: #dddd00;
margin: 10px 0px;
padding: 20px;
border: 2px dashed black;
overflow-wrap: anywhere;
}
#credits {
margin-top: 20px;
display: grid;
text-align: center;
}
#credits a {
color: blue;
}
#credits img {
max-width: 200px;
}
</style>
</head>
<body>
<div id="content">
<div id="intro">
<h1>Hold on just to be sure...</h1>
<h2>Do you work for or own Twitter?</h2>
<div id="choices">
<button id="yes">Yes</button>
<button id="no">No</button>
</div>
<p>Please note that if you DO work for or own Twitter and lie, then you're officially accessing these resources without permission</p>
<p>I'm like 99% sure that accessing computing resources without permission is totally a violation of the Computer Fraud and Abuse Act.</p>
<p>Just saying.</p>
</div>
<div id="notTwitter">
<div id="shareAnything">
<h1>Since you can be trusted</h1>
<div id="shareLink">
You can find me at <a id="notMySocialHandleValue"></a>
</div>
<div id="shareMessage">
</div>
</div>
<div id="create">
<div id="createGrid">
<h2>Generate a link or message to share on Twitter (you can include both)</h2>
<p>The social media URL you want to share.</p>
<input type="text" id="notAHandleInput" />
<p>The message you want to share.</p>
<textarea id="messageInput"></textarea>
<button id="generate">Generate!</button>
<div id="result">
Copy this URL and share it:
<div id="urlShareSpace">
<a id="resultLink"></a>
</div>
</div>
</div>
</div>
</div>
<div id="twitter">
Wow, Cool! Twitter is such a great platform!
</div>
</div>
<div id="credits">
<div><a href="https://biffud.com" target="_new"><img src='biflogo.png' /></a></div>
<div>A <a href="https://biffud.com" target="_new">Bad Idea Factory</a> project</div>
<div>(<a href="https://github.com/BadIdeaFactory/notmyhandle" target="_new">Source code here</a>)</div>
</div>
<script>
const notMySocialHandleLink = document.getElementById('notMySocialHandleValue');
const yesButton = document.getElementById('yes');
const noButton = document.getElementById('no');
const intro = document.getElementById('intro');
const notTwitter = document.getElementById('notTwitter');
const twitter = document.getElementById('twitter');
const create = document.getElementById('create');
const shareLink = document.getElementById('shareLink');
const shareMessage = document.getElementById('shareMessage');
const shareAnything = document.getElementById('shareAnything');
const params = new URLSearchParams(window.location.search);
const generateButton = document.getElementById('generate');
const result = document.getElementById('result');
const notAHandleInput = document.getElementById('notAHandleInput');
const messageInput = document.getElementById('messageInput');
generateButton.onclick = () => {
const encodedLink = btoa(notAHandleInput.value);
const encodedMessage = btoa(messageInput.value);
const secretUrl = `${window.location.href.split('?')[0]}?h=${encodedLink}&m=${encodedMessage}`;
resultLink.href = secretUrl;
resultLink.text = secretUrl;
result.style.display='block';
}
yesButton.onclick = () => {
twitter.style.display='block';
intro.style.display='none';
};
noButton.onclick =() => {
if (params.get('h')) {
const notMySocialHandleValue = atob(params.get('h'));
notMySocialHandleLink.href = notMySocialHandleValue;
notMySocialHandleLink.text = notMySocialHandleValue;
shareAnything.style.display='block';
shareLink.style.display='block';
notTwitter.style.display='block';
intro.style.display='none';
}
if (params.get('m')) {
const notMySocialHandleValue = atob(params.get('m'));
shareMessage.innerHTML = notMySocialHandleValue;
shareAnything.style.display='block';
shareMessage.style.display='block';
notTwitter.style.display='block';
intro.style.display='none';
}
create.style.display='block';
notTwitter.style.display='block';
intro.style.display='none';
};
</script>
</body>
</html>