trunkless/templates/index.tmpl
2024-08-17 14:28:13 -05:00

192 lines
5.4 KiB
Cheetah

<!DOCTYPE html>
<html>
<head>
<title>Trunkless</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8">
<style>
@font-face {
font-family: "cutive";
src: url("/cutive.ttf");
}
body {
font-family: "cutive", monospace;
font-size:125%;
background-color: white;
color: black;
background-image: url("/bg_light.gif");
}
.main {
background-color: white;
border: 1px solid grey;
padding: 5px
}
#about {
background-color: grey;
display: none;
color: black;
}
h1 {
background-color: white;
}
a {
color: black;
}
.controls {
margin: 0;
margin-bottom:4px;
font-size:80%;
}
.controls form {
background-color: white;
}
.rainbow {
animation-name: rainbow;
animation-duration: 1s;
}
.movetarget {
/* animation-name: rainbow-top-border;
animation-duration: 1s; */
border-top: 2px solid grey;
}
@keyframes rainbow-top-border {
20%{border-top: 2px solid red;}
20%{border-top: 2px solid orange;}
60%{border-top: 2px solid yellow;}
80%{border-top: 2px solid green;}
100%{border-top: 2px solid blue;}
}
@keyframes rainbow {
20%{color: red;}
40%{color: orange;}
60%{color: yellow;}
80%{color: green;}
100%{color: blue;}
}
</style>
</head>
<body>
<template id="line-editor-tmpl">
<form style="display:inline">
<input type="text" name="editedLine" style="min-width: 30em; max-width:40em">
<input type="submit" style="display: none">
</form>
</template>
<template id="linetmpl">
<style>
.linetext {
font-size: 100%;
}
div.source {
font-size: 50%;
font-style: oblique;
padding-left: 10px;
text-align: right;
}
.linetext:hover {
cursor: auto;
}
.line:hover {
background-color: rgba(125,125,125,.40);
}
.cont:hover {
cursor: grab;
}
div.linectrl {
text-align: right;
}
div.linectrl button {
width: 60px;
height: 30px;
}
div.line:not(.unpinned) .linetext {
font-weight: bold;
}
button.pinned {
font-weight:bold;
}
</style>
<div class="cont" style="display: grid; grid-template-columns: 80% 20%">
<div>
<span class="linetext"></span>
</div>
<div class="linectrl">
<button is="line-pinner">PIN</button><button is="line-regenner">REGEN</button><button is="line-editor">EDIT</button><button is="line-remover">KILL</button>
</div>
</div>
<div is="source-text" class="source"></div>
</template>
<h1 style="display:block;margin:0">Trunkless</h1>
<p style="margin-top:0;font-size:80%">
<a is="about-toggler"></a>
<a is="theme-toggler"></a>
</p>
<div id="about">
<p>
HELLO. THIS IS A <a href="https://github.com/vilmibm/trunkless">SOFT WARE</a> FOR MAKING <a href="https://en.wikipedia.org/wiki/Cut-up_technique">CUT-UP POETRY</a>. THERE ARE A VARIETY OF CORPORA TO CHOOSE FROM:
</p>
<ul>
<li><code>gutenberg</code>, THE ENTIRE ENGLISH CONTENT OF <a href="https://gutenberg.org">PROJECT GUTENBERG</a>. IT IS UNABRIDGED: BE WARNED.</li>
<li><code>geocities</code>, THE EXTRACTED TEXT OF <a href="https://wiki.archiveteam.org/index.php/GeoCities">THE GEOCITIES ARCHIVE</a>. IT IS UNABRIDGED: BE WARNED.</li>
<li><code>gamefaqs</code>, TWENTY YEARS WORTH OF PLAINTEXT FAQS/GUIDES FROM <a href="https://gamefaqs.com">GAMEFAQS</a>.</li>
<li><code>cyberpunk</code>, THE TEXT OF THIRTY-ONE <a href="https://archive.org/details/cbprop/page/n43/mode/2up">CYBERPUNK NOVELS</a>.</li>
<li><code>lovecraft</code>, THE TEXT OF SIXTY-SEVEN <a href="https://github.com/vilmibm/lovecraftcorpus/tree/master">LOVECRAFT STORIES</a>.</li>
</ul>
<p>
THE AUTHOR OF THIS SOFT WARE IS <a href="https://tilde.town/~vilmibm">~VILMIBM</a>.
</p>
</div>
<div class="controls">
<button is="poem-resetter"></button>
<form method="GET" action="/" style="display:inline">
<label for="corpus-select">corpus:</label>
<select name="corpus" id="corpus-select">
{{$selected := .SelectedCorpus}}
{{range .Corpora}}
{{if eq $selected .ID}}
<option selected="selected" value="{{.ID}}">{{.Name}} ({{.MaxID}} possible lines)</option>
{{else}}
<option value="{{.ID}}">{{.Name}} ({{.MaxID}} possible lines)</option>
{{end}}
{{end}}
</select>
<button type="submit">go</button>
</form>
<form is="poem-saver" style="border: 1px solid grey; display:inline; padding:4px;">
<button class="copy" type="submit">copy</button>
<button class="save" type="submit">save</button>
<input name="type" value="text" type="radio" checked />as text
<input name="type" value="image" type="radio"/>as image
<input name="sources" type="checkbox"/>include sources
</form>
</div>
<div class="main">
<div style="margin-bottom: 5px">
<button is="poem-regenner">regenerate unpinned lines</button>
</div>
<div is="poem-lines"></div>
<div>
<button is="line-adder" title="add new line">add new line</button>
</div>
</div>
<script src="/html2canvas.min.js"></script>
<script src="/main.js"></script>
</body>
</html>