Compare commits
No commits in common. "f9190a87730b17f956dfa9665f4270fafc68d1b2" and "ae9280af686946711492fab48571ecfde304ca6b" have entirely different histories.
f9190a8773
...
ae9280af68
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
this is the code for [blackout.tilde.town](https://blackout.tilde.town).
|
this is the code for [blackout.tilde.town](https://blackout.tilde.town).
|
||||||
|
|
||||||
the database that powers this was made using [gutchunk](https://git.tilde.town/vilmibm/gutchunk).
|
the database that powers this was made using [gutchunk](https://git.tilde.town/~vilmibm/gutchunk).
|
||||||
|
|
4
main.go
4
main.go
|
@ -50,9 +50,6 @@ func main() {
|
||||||
randMax := big.NewInt(maxID)
|
randMax := big.NewInt(maxID)
|
||||||
|
|
||||||
spaceRE := regexp.MustCompile(`[\t\v\f\r ]+`)
|
spaceRE := regexp.MustCompile(`[\t\v\f\r ]+`)
|
||||||
r.HEAD("/", func(c *gin.Context) {
|
|
||||||
c.String(http.StatusOK, "")
|
|
||||||
})
|
|
||||||
|
|
||||||
r.GET("/", func(c *gin.Context) {
|
r.GET("/", func(c *gin.Context) {
|
||||||
db, err := connectDB()
|
db, err := connectDB()
|
||||||
|
@ -61,7 +58,6 @@ func main() {
|
||||||
c.String(http.StatusInternalServerError, "oh no.")
|
c.String(http.StatusInternalServerError, "oh no.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer db.Close()
|
|
||||||
|
|
||||||
id, err := rand.Int(rand.Reader, randMax)
|
id, err := rand.Int(rand.Reader, randMax)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: black;
|
|
||||||
}
|
}
|
||||||
.rainbow {
|
.rainbow {
|
||||||
animation-name: rainbow;
|
animation-name: rainbow;
|
||||||
|
@ -64,10 +63,6 @@
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#paper span.black:hover {
|
|
||||||
background-color: grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
#aboutToggle {
|
#aboutToggle {
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -102,7 +97,7 @@
|
||||||
-->
|
-->
|
||||||
<center>
|
<center>
|
||||||
<p>
|
<p>
|
||||||
<button id="copy">copy text to clipboard</button>
|
<button id="copy">copy to clipboard</button>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a id="aboutToggle" href="">ABOUT</a>
|
<a id="aboutToggle" href="">ABOUT</a>
|
||||||
|
@ -117,9 +112,6 @@
|
||||||
<p>
|
<p>
|
||||||
IT IS <strong>#{{.ID}}</strong> OUT OF <strong>{{.MaxID}}</strong> POSSIBLE TEXT CHUNKS. RELOAD FOR ANOTHER.
|
IT IS <strong>#{{.ID}}</strong> OUT OF <strong>{{.MaxID}}</strong> POSSIBLE TEXT CHUNKS. RELOAD FOR ANOTHER.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
THIS IS A <a href="https://tilde.town/~vilmibm/blog/#blackout">BLOG POST</a>. THIS IS <a href="https://git.tilde.town/vilmibm/gutchunk">SOURCE</a> <a href="https://git.tilde.town/vilmibm/blackout">CODE</a>.
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
THIS IS A PROJECT BY <a href="https://tilde.town/~vilmibm">~VILMIBM</a>.
|
THIS IS A PROJECT BY <a href="https://tilde.town/~vilmibm">~VILMIBM</a>.
|
||||||
</p>
|
</p>
|
||||||
|
@ -138,18 +130,6 @@
|
||||||
let toCopy = "";
|
let toCopy = "";
|
||||||
document.querySelectorAll("#paper span").forEach(span => {
|
document.querySelectorAll("#paper span").forEach(span => {
|
||||||
let guts = span.innerHTML;
|
let guts = span.innerHTML;
|
||||||
if (!span.classList.contains("black")) {
|
|
||||||
toCopy += guts.trim()+" ";
|
|
||||||
}
|
|
||||||
if (guts.includes("\n") && toCopy[toCopy.length-1] != "\n") {
|
|
||||||
toCopy += "\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
// I think this method of converting to plaintext is interesting but
|
|
||||||
// it's not very practical--it's way too many characters to
|
|
||||||
// realistically put in a toot or alt text or similar. I may add a
|
|
||||||
// "copy wide text" button that re-introduces this behavior.
|
|
||||||
let out = "";
|
let out = "";
|
||||||
if (span.classList.contains("black")) {
|
if (span.classList.contains("black")) {
|
||||||
for (let i = 0; i < guts.length; i++) {
|
for (let i = 0; i < guts.length; i++) {
|
||||||
|
@ -162,8 +142,8 @@
|
||||||
} else {
|
} else {
|
||||||
out = guts;
|
out = guts;
|
||||||
}
|
}
|
||||||
toCopy += out
|
|
||||||
*/
|
toCopy += out;
|
||||||
});
|
});
|
||||||
|
|
||||||
navigator.clipboard.writeText(toCopy).then(() => {
|
navigator.clipboard.writeText(toCopy).then(() => {
|
||||||
|
|
Loading…
Reference in New Issue