Spaces:
Running
Running
add grid classes
Browse files
sketch.js
CHANGED
|
@@ -130,12 +130,12 @@ new p5(function (p5){
|
|
| 130 |
}
|
| 131 |
|
| 132 |
function makeTextModules(){
|
| 133 |
-
const introDiv = p5.createDiv().class('module').id('intro')
|
| 134 |
p5.createElement('h1','p5.js Critical AI Prompt Battle').parent(introDiv)
|
| 135 |
p5.createP(`What do AI models really 'know' about you — about your community, your language, your culture? What do they 'know' about different concepts, ideas, and worldviews?`).parent(introDiv)
|
| 136 |
p5.createP(`This tool lets you compare the results of multiple AI-generated texts and images side-by-side, using blanks you fill in to explore variations on a single prompt. For more info on prompt programming and critical AI, see [TUTORIAL-LINK].`).parent(introDiv)
|
| 137 |
|
| 138 |
-
const instructDiv = p5.createDiv().class('module').id('instructions')
|
| 139 |
p5.createElement('h4', 'INSTRUCTIONS').class('header').parent(instructDiv)
|
| 140 |
p5.createP(`Write your prompt using [BLANK] and [MASK], where [BLANK] will be the variation you choose and fill in below, and [MASK] is a variation that the model will complete.`).parent(instructDiv)
|
| 141 |
p5.createP(`For best results, try to phrase your prompt so that [BLANK] and [MASK] highlight the qualities you want to investigate. <A href="http://p5js.org">See examples.</a>`).parent(instructDiv)
|
|
@@ -143,8 +143,8 @@ new p5(function (p5){
|
|
| 143 |
|
| 144 |
function makeInputModule(){
|
| 145 |
const inputDiv = p5.createDiv()
|
| 146 |
-
inputDiv.id('inputDiv').class('module')
|
| 147 |
p5.createElement('h4', 'INPUT').class('header').parent(inputDiv)
|
|
|
|
| 148 |
p5.createElement('h3', 'Enter your prompt').class('header').parent(inputDiv)
|
| 149 |
p5.createP('Write your prompt in the box below using one [BLANK] and one [MASK].').parent(inputDiv)
|
| 150 |
p5.createP('e.g. Write "The [BLANK] was a [MASK]..." and in the three blanks choose three occupations.').parent(inputDiv)
|
|
@@ -166,7 +166,7 @@ new p5(function (p5){
|
|
| 166 |
const submitButton = p5.createButton("RUN PROMPT")
|
| 167 |
submitButton.size(170)
|
| 168 |
submitButton.class('button').parent(inputDiv)
|
| 169 |
-
submitButton.mousePressed(
|
| 170 |
}
|
| 171 |
|
| 172 |
function addField(){
|
|
@@ -193,21 +193,21 @@ new p5(function (p5){
|
|
| 193 |
|
| 194 |
function makeOutputModule(){
|
| 195 |
const outDiv = p5.createDiv()
|
| 196 |
-
outDiv.id('outputDiv').class('module')
|
| 197 |
const outHeader = p5.createElement('h4',"OUTPUT").parent(outDiv)
|
| 198 |
|
| 199 |
//make output placeholders
|
| 200 |
|
| 201 |
// text-only output
|
| 202 |
-
p5.createElement('h3', 'Text output').
|
| 203 |
outText = p5.createP('').id('outText').parent(outDiv)
|
| 204 |
|
| 205 |
//a placeholder DIV for images and captions
|
| 206 |
-
p5.createElement('h3', 'Text-to-image output').
|
| 207 |
outPics = p5.createDiv().id('outPics').parent(outDiv)
|
| 208 |
// img1 = p5.createImg('URL')
|
| 209 |
|
| 210 |
-
p5.createElement('h3', 'Prompting info').
|
| 211 |
outInfo = p5.createP('').id('outInfo').parent(OutDiv)
|
| 212 |
}
|
| 213 |
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
function makeTextModules(){
|
| 133 |
+
const introDiv = p5.createDiv().class('module').class('header').id('intro')
|
| 134 |
p5.createElement('h1','p5.js Critical AI Prompt Battle').parent(introDiv)
|
| 135 |
p5.createP(`What do AI models really 'know' about you — about your community, your language, your culture? What do they 'know' about different concepts, ideas, and worldviews?`).parent(introDiv)
|
| 136 |
p5.createP(`This tool lets you compare the results of multiple AI-generated texts and images side-by-side, using blanks you fill in to explore variations on a single prompt. For more info on prompt programming and critical AI, see [TUTORIAL-LINK].`).parent(introDiv)
|
| 137 |
|
| 138 |
+
const instructDiv = p5.createDiv().class('module').class('left-sidebar').id('instructions')
|
| 139 |
p5.createElement('h4', 'INSTRUCTIONS').class('header').parent(instructDiv)
|
| 140 |
p5.createP(`Write your prompt using [BLANK] and [MASK], where [BLANK] will be the variation you choose and fill in below, and [MASK] is a variation that the model will complete.`).parent(instructDiv)
|
| 141 |
p5.createP(`For best results, try to phrase your prompt so that [BLANK] and [MASK] highlight the qualities you want to investigate. <A href="http://p5js.org">See examples.</a>`).parent(instructDiv)
|
|
|
|
| 143 |
|
| 144 |
function makeInputModule(){
|
| 145 |
const inputDiv = p5.createDiv()
|
|
|
|
| 146 |
p5.createElement('h4', 'INPUT').class('header').parent(inputDiv)
|
| 147 |
+
inputDiv.id('inputDiv').class('module').class('main')
|
| 148 |
p5.createElement('h3', 'Enter your prompt').class('header').parent(inputDiv)
|
| 149 |
p5.createP('Write your prompt in the box below using one [BLANK] and one [MASK].').parent(inputDiv)
|
| 150 |
p5.createP('e.g. Write "The [BLANK] was a [MASK]..." and in the three blanks choose three occupations.').parent(inputDiv)
|
|
|
|
| 166 |
const submitButton = p5.createButton("RUN PROMPT")
|
| 167 |
submitButton.size(170)
|
| 168 |
submitButton.class('button').parent(inputDiv)
|
| 169 |
+
submitButton.mousePressed(displayOutput)
|
| 170 |
}
|
| 171 |
|
| 172 |
function addField(){
|
|
|
|
| 193 |
|
| 194 |
function makeOutputModule(){
|
| 195 |
const outDiv = p5.createDiv()
|
| 196 |
+
outDiv.id('outputDiv').class('module').class('main')
|
| 197 |
const outHeader = p5.createElement('h4',"OUTPUT").parent(outDiv)
|
| 198 |
|
| 199 |
//make output placeholders
|
| 200 |
|
| 201 |
// text-only output
|
| 202 |
+
p5.createElement('h3', 'Text output').parent(outDiv)
|
| 203 |
outText = p5.createP('').id('outText').parent(outDiv)
|
| 204 |
|
| 205 |
//a placeholder DIV for images and captions
|
| 206 |
+
p5.createElement('h3', 'Text-to-image output').parent(outDiv)
|
| 207 |
outPics = p5.createDiv().id('outPics').parent(outDiv)
|
| 208 |
// img1 = p5.createImg('URL')
|
| 209 |
|
| 210 |
+
p5.createElement('h3', 'Prompting info').parent(outDiv)
|
| 211 |
outInfo = p5.createP('').id('outInfo').parent(OutDiv)
|
| 212 |
}
|
| 213 |
|