Browse Source

Updated styles, cleaned text with regex, and added some todos for later.

master
suroh 2 years ago
parent
commit
b0fa51ca0a
4 changed files with 40 additions and 11 deletions
  1. +31
    -3
      css/master.css
  2. +2
    -1
      index.html
  3. +5
    -0
      js/manifestoParse.js
  4. +2
    -7
      js/script.js

+ 31
- 3
css/master.css View File

@ -15,8 +15,9 @@ body {
}
h1#gengen {
font-weight: 400;
font-weight: 500;
font-size: 5em;
margin-bottom: 0.125em;
}
span#genWhat {
@ -31,10 +32,37 @@ span#genWhat {
div.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
grid-gap: 1em;
}
p#manifesto {
font-size: 1.25em;
grid-column: span 2;
font-size: 1.45em;
}
nav {
}
nav > a {
font-family: 'fira code', monospace;
font-size: 0.75em;
text-decoration: none;
color: #333;
background-color: white;
padding: 0 0.5em;
margin: 0.5em -0.25em 1em;
transition: background-color ease 0.5s;
}
nav > a:hover {
background-color: yellow;
transition: background-color ease 0.5s;
}
nav > a:visited {
color: #333;
}

+ 2
- 1
index.html View File

@ -17,13 +17,14 @@
<body>
<div id="gengenApp">
<h1 id="gengen">Generative <span id="genWhat">____________</span></h1>
<h1 id="gengen">Generative<br><span id="genWhat">____________</span></h1>
</div>
<div class="grid">
<p id="manifesto"></p>
</div>
</body>
</html>

+ 5
- 0
js/manifestoParse.js View File

@ -3,6 +3,9 @@
// Run the analysis and the bulk writer when
// there are new entries to the manifesto list.
//
// Replace SOME of the nnp (proper nouns) with
// the generated ______ title
//
console.log('manifestoParse!')
@ -89,6 +92,8 @@ export const manifestoWriter = async (file) => {
let sentences = rm.generateSentences(4)
manifesto = sentences.join(' ')
manifesto = manifesto.replace(/(\.(\.|\s)*\.)/gi, '...')
return manifesto
}

+ 2
- 7
js/script.js View File

@ -13,19 +13,14 @@ let generativeType = ""
// CLICK THE GENERATIVE
genButtonEl.addEventListener('click', async () => {
// generativeType = RiTa.randomWord("nn")
let manifestoFile = await dat.readFile(MANIFESTO_FILE)
let newManifesto = await manifestoWriter(manifestoFile)
Promise.all([manifestoFile], () => {
})
generativeType = RiTa.randomWord("nn")
dat.readFile(MANIFESTO_FILE)
.then((d) => {
manifestoWriter(d)
.then((d) => {
manifestoRender(d, manifestoEl)
genButtonEl.textContent = generativeType
})
})
})

Loading…
Cancel
Save