Browse Source

Basics setup and are more or less working. Need to add text manipulation

master
suroh 2 years ago
parent
commit
5d50376b14
13 changed files with 47827 additions and 1 deletions
  1. +6
    -0
      .datignore
  2. +0
    -0
      .gitignore
  3. +1
    -1
      README.md
  4. +1
    -0
      assets/manifestos.json
  5. +67
    -0
      assets/manifestos.original.json
  6. +40
    -0
      css/master.css
  7. +9
    -0
      dat.json
  8. BIN
      favicon.ico
  9. +29
    -0
      index.html
  10. +62
    -0
      js/manifestoParse.js
  11. +47521
    -0
      js/rita.js
  12. +35
    -0
      js/script.js
  13. +56
    -0
      js/script.old.js

+ 6
- 0
.datignore View File

@ -0,0 +1,6 @@
.git
.dat
node_modules
*.log
**/.DS_Store
Thumbs.db

+ 0
- 0
.gitignore View File


+ 1
- 1
README.md View File

@ -1,3 +1,3 @@
# generative.webRing
A simple webring to show the sketches and researches of 2019 PCA Generative _______ workshops.
A simple webring to show the sketches and researches of 2019 PCA Generative _______ workshops. Designed to work best in [beaker browser](https://beakerbrowser.com/) but will work almost as well on the original web.

+ 1
- 0
assets/manifestos.json
File diff suppressed because it is too large
View File


+ 67
- 0
assets/manifestos.original.json View File

@ -0,0 +1,67 @@
{
"manifestos": [
{
"title": "Discourses on Art",
"author": "Sir Joshua Reynolds",
"date": "1769",
"text": "I wished you to be persuaded, that success in your art depends almost entirely on your own industry; but the industry which I principally recommend, is not the industry of the hands, but of the mind... We may go so far as to assert, that a painter stands in need of more knowledge than is to be picked off his pallet, or collected by looking on his model, whether it be in life or in picture. He can never be a great artist, who is grossly illiterate... He ought to know something concerning the mind, as well as a great deal concerning the body of man.",
"analysis": null
},
{
"title": "Futurism",
"author": "FT Marinetti",
"date": "1909",
"text": "1. We intend to sing the love of danger, the habit of energy and fearlessness. 2. Courage, boldness, and rebellion will be the essential elements in our poetry. 3. Up to now, literature has extolled a comtemplative stillness, rapture and reverie. We intend to glorify aggressive action, a restive wakefulness, life at the double, the slap and the punching fist.",
"analysis": null
},
{
"title": "Staatliche Bauhaus",
"author": "Walter Gropius",
"date": "1919",
"text": "Architects, sculptors, painters – we all must return to craftsmanship! For there is no such thing as 'art by profession'. There is no essential difference between the artist and the artisan. The artist is an exalted artisan.",
"analysis": null
},
{
"title": "Concerning the Spiritual in Art",
"author": "Wassily Kandinsky",
"date": "1912",
"text": "The mutual influence of form and colour now becomes clear. A yellow triangle, a blue circle, a green square, or a green triangle, a yellow circle, a blue square – all these are different and have different spiritual values.",
"analysis": null
},
{
"title": "Dada",
"author": "Tristan Tzara",
"date": "1918",
"text": "A work of art is never beautiful by decree, objectively and for all. Hence criticism is useless, it exists only subjectively, for each man separately, without the slightest character of universality... Dada was born of a need for independence, of a distrust toward unity. Those who are with us preserve their freedom. We recognize no theory.",
"analysis": null
},
{
"title": "Five Points Towards a New Architecture",
"author": "Le Corbusier",
"date": "1926",
"text": "The following points in no way relate to aesthetic fantasies or a striving for fashionable effects, but concern architectural facts that imply an entirely new kind of building, from the dwelling house to palatial edifices... The age of the architects is coming.",
"analysis": null
},
{
"title": "The Laws of Sculptors",
"author": "Gilbert & George",
"date": "1967",
"text": "1. Always be smartly dressed, well groomed, relaxed, friendly, polite and in complete control. 2. Make the world believe in you and to pay heavily for this privilege. 3. Never worry, assess, discuss or criticize but remain quiet respectful and calm. 4. The Lord chisels still, so don't leave your bench for long.",
"analysis": null
},
{
"title": "The Stuckist Manifesto",
"author": "The Stuckists",
"date": "1999",
"text": "1. Stuckism is the quest for authenticity. 2. Painting is the medium of self-discovery. 3. Stuckism proposes a model of art which is holistic. 4. Artists who don't paint aren't artists. 5. Art that has to be in a gallery to be art isn't art.",
"analysis": null
},
{
"title": "Red Alan's Manifesto",
"author": "Grayson Perry RA",
"date": "2014",
"text": "1. Nothing in Art is New or Old fashioned only Good or Bad. 2. Failed paintings to be sent to DISASTER zones to be used to make tents. 3. Bad Sculpture should be installed outside companies guilty of FINANCIAL IRREGULARITIES. 4. POPULAR art will be displayed above head height to we can see it. 5. Videos should be no longer than 10 minutes comfy seating must be provided. 6. HALF of R.A.s must wear DRESSES. 7. An artist's BIGGEST work is very VERY rarely their BEST. 8. Artists are NOT Philosophers, comedians, politicians, priests etc. they will be JUDGED on their ART. 9. Special REMEDIAL help should be given to POSH people to help them become artists. 10. We must DARE to make that difficult first mark on the BLANK CANVAS of the FUTURE. 11. MY FAVOURITE ARTWORK IS THE NEXT ONE i MAKE",
"analysis": null
}
]
}

+ 40
- 0
css/master.css View File

@ -0,0 +1,40 @@
/* ==> IMPORTS <== */
@import url('https://cdn.jsdelivr.net/gh/tonsky/FiraCode@1.206/distr/fira_code.css');
@import url('https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700&subset=latin-ext');
/* ==> MASTER CSS <== */
body {
max-width: 1200px;
margin: 0px auto;
font-family: 'Playfair Display', serif;
font-size: 24px;
}
#gengen {
font-family: 'fira code', monospace;
}
h1#gengen {
font-weight: 400;
font-size: 5em;
}
span#genWhat {
position: relative;
left: -50px;
background-color: yellow;
border-left: 50px yellow solid;
border-right: 50px yellow solid;
cursor: pointer;
text-transform: capitalize;
}
div.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1em;
}
p#manifesto {
font-size: 1.25em;
}

+ 9
- 0
dat.json View File

@ -0,0 +1,9 @@
{
"title": "generative.webRing",
"experimental": {
"apis": [
"datPeers"
]
},
"fallback_page": "/index.html"
}

BIN
favicon.ico View File

Before After

+ 29
- 0
index.html View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<!-- CSS -->
<link rel="stylesheet" href="/css/master.css">
<!-- JS -->
<script src="/js/rita.js" charset="utf-8" defer></script>
<script src="/js/script.js" charset="utf-8" type="module"></script>
</head>
<body>
<div id="gengenApp">
<h1 id="gengen">Generative <span id="genWhat">____________</span></h1>
</div>
<div class="grid">
<p id="manifesto"></p>
</div>
</body>
</html>

+ 62
- 0
js/manifestoParse.js View File

@ -0,0 +1,62 @@
console.log('manifestoParse!')
const jsonParser = async (file) => {
try {
let json = JSON.parse(file)
return json
} catch(e) {
console.log('Error in jsonParser')
return
}
}
export const analyser = async (file) => {
const _j = await jsonParser(file)
if (!_j) {
console.error('No JSON to analyse')
return
}
for (let m of _j.manifestos) {
if (!m.analysis) {
console.log(`${m.title} analysing...`)
let rs = new RiString(m.text)
m.analysis = rs.analyze()
} else {
console.log(`${m.title} already analysed`)
}
}
return _j
}
export const analysisWriter = async (json, dat) => {
if (!json) {
console.error('No JSON to write to file')
return
}
dat.writeFile('/assets/manifestos.json', JSON.stringify(json))
}
export const manifestoWriter = async (file) => {
// Write new manifesto with new text
let json = await jsonParser(file)
let ranNum = Math.floor(Math.random() * (json.manifestos.length-1))
let manifesto = json.manifestos[ranNum]
return manifesto
}
export const manifestoRender = (manifesto, domEl) => {
// Render Manifesto to DOM
if (!manifesto) {
console.error('No manifesto to render')
return
}
domEl.textContent = manifesto.text
}

+ 47521
- 0
js/rita.js
File diff suppressed because it is too large
View File


+ 35
- 0
js/script.js View File

@ -0,0 +1,35 @@
import {
analyser,
analysisWriter,
manifestoWriter,
manifestoRender
} from '/js/manifestoParse.js'
const dat = new DatArchive(window.location)
const MANIFESTO_FILE = '/assets/manifestos.json'
// DOM ELEMENTS
const genButtonEl = document.querySelector('#genWhat')
const manifestoEl = document.querySelector('#manifesto')
// CLICK THE GENERATIVE
genButtonEl.addEventListener('click', () => {
dat.readFile(MANIFESTO_FILE)
.then((d) => {
manifestoWriter(d)
.then((d) => {
manifestoRender(d, manifestoEl)
})
})
})
// READ MANIFESTOS FILE
dat.readFile(MANIFESTO_FILE)
.then((d) => {
// ANALYSE MANIFESTOS CONTENTS
analyser(d)
// WRITE TO MANIFESTOS FILE
.then((j) => {
analysisWriter(j, dat)
})
})

+ 56
- 0
js/script.old.js View File

@ -0,0 +1,56 @@
// THE SCRIPTS FILE
console.log('hello from javascript.')
// gengen javascript
// using vanillajs
// APIs
const wordURL = 'https://api.wordnik.com/v4/word.json/'
const wordKEY = '?hasDefinition&=true&api_key=4fcbbcb9b2730014d20050f489203cca024f6f530cdcb3b65'
// DOM ELEMENTS
const app = document.querySelector('#gengenApp')
const defs = document.querySelector('#definitions')
// rita
// wordnik
// wiki?
let defGen = (word) => {
fetch(wordURL + word + '/definitions' + wordKEY)
.then(response => response.json())
.then(json => {
if (defs.childNodes.length <= 2) {
let div = document.createElement('div')
let h2 = document.createElement('h2')
h2.innerHTML = word
let p = document.createElement('p')
p.innerHTML = json[0].text
div.append(h2)
div.append(p)
defs.append(div)
} else {
defs.removeChild(defs.childNodes[2])
defGen(word)
}
})
}
// ONLOAD
defGen('generative')
// GENWHAT?!
const genWhat = document.querySelector('#genWhat')
genWhat.addEventListener('click', () => {
let word = RiTa.randomWord("nn")
genWhat.innerHTML = word
defGen(word)
})
genWhat.addEventListener('touch', () => {
let word = RiTa.randomWord("nn")
genWhat.innerHTML = word
defGen(word)
})

Loading…
Cancel
Save