Sarah Ciston
commited on
Commit
·
2897982
1
Parent(s):
94d8833
recursive form test
Browse files
sketch.js
CHANGED
@@ -46,13 +46,13 @@ new p5(function(p5){
|
|
46 |
}
|
47 |
|
48 |
window.onload = function(){
|
49 |
-
console.log('
|
50 |
}
|
51 |
|
52 |
|
53 |
|
54 |
function makeInterface(){
|
55 |
-
console.log('
|
56 |
let title = p5.createElement('h1', 'p5.js Critical AI Prompt Battle')
|
57 |
title.position(0,50)
|
58 |
|
@@ -61,7 +61,8 @@ new p5(function(p5){
|
|
61 |
promptInput.size(500);
|
62 |
promptInput.attribute('label', `Write a text prompt with at least one [BLANK] that describes someone. You can also write [blank] where you want the bot to blank in a word.`)
|
63 |
promptInput.value(`The [BLANK] works as a [blank] but wishes for [blank].`)
|
64 |
-
promptInput.elt.style.fontSize = "15px";
|
|
|
65 |
p5.createP(promptInput.attribute('label')).position(0,100)
|
66 |
// p5.createP(`For example: "The BLANK has a job as a blank where their favorite thing to do is ...`)
|
67 |
|
@@ -107,11 +108,10 @@ new p5(function(p5){
|
|
107 |
}
|
108 |
|
109 |
function makeBlank(){
|
110 |
-
let i =
|
111 |
let b = p5.createInput("")
|
112 |
-
b.position(0, 240 + (i*30)) // positions new buttons below the prior buttons based on their place in the list
|
113 |
-
b.size(200)
|
114 |
-
b.elt.style.fontSize = "15px" // change this to CSS
|
115 |
b.addClass("blank")
|
116 |
blankA.append(b)
|
117 |
}
|
@@ -128,7 +128,7 @@ new p5(function(p5){
|
|
128 |
|
129 |
for (b in blanks){
|
130 |
// b = b.value()
|
131 |
-
inputArray
|
132 |
}
|
133 |
console.log(promptResult, inputArray)
|
134 |
}
|
|
|
46 |
}
|
47 |
|
48 |
window.onload = function(){
|
49 |
+
console.log('dom and js loaded')
|
50 |
}
|
51 |
|
52 |
|
53 |
|
54 |
function makeInterface(){
|
55 |
+
console.log('reached makeInterface')
|
56 |
let title = p5.createElement('h1', 'p5.js Critical AI Prompt Battle')
|
57 |
title.position(0,50)
|
58 |
|
|
|
61 |
promptInput.size(500);
|
62 |
promptInput.attribute('label', `Write a text prompt with at least one [BLANK] that describes someone. You can also write [blank] where you want the bot to blank in a word.`)
|
63 |
promptInput.value(`The [BLANK] works as a [blank] but wishes for [blank].`)
|
64 |
+
// promptInput.elt.style.fontSize = "15px";
|
65 |
+
promptInput.addClass("prompt")
|
66 |
p5.createP(promptInput.attribute('label')).position(0,100)
|
67 |
// p5.createP(`For example: "The BLANK has a job as a blank where their favorite thing to do is ...`)
|
68 |
|
|
|
108 |
}
|
109 |
|
110 |
function makeBlank(){
|
|
|
111 |
let b = p5.createInput("")
|
112 |
+
// b.position(0, 240 + (i*30)) // positions new buttons below the prior buttons based on their place in the list
|
113 |
+
// b.size(200)
|
114 |
+
// b.elt.style.fontSize = "15px" // change this to CSS
|
115 |
b.addClass("blank")
|
116 |
blankA.append(b)
|
117 |
}
|
|
|
128 |
|
129 |
for (b in blanks){
|
130 |
// b = b.value()
|
131 |
+
append(inputArray, b.value())
|
132 |
}
|
133 |
console.log(promptResult, inputArray)
|
134 |
}
|
style.css
CHANGED
@@ -8,9 +8,6 @@
|
|
8 |
html,
|
9 |
body {
|
10 |
height: 100%;
|
11 |
-
}
|
12 |
-
|
13 |
-
body {
|
14 |
padding: 32px;
|
15 |
}
|
16 |
|
@@ -77,4 +74,15 @@ canvas {
|
|
77 |
font-size: 12px;
|
78 |
margin: -16px 0 0 -2px;
|
79 |
padding: 1px;
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
html,
|
9 |
body {
|
10 |
height: 100%;
|
|
|
|
|
|
|
11 |
padding: 32px;
|
12 |
}
|
13 |
|
|
|
74 |
font-size: 12px;
|
75 |
margin: -16px 0 0 -2px;
|
76 |
padding: 1px;
|
77 |
+
}
|
78 |
+
|
79 |
+
input {
|
80 |
+
margin: 1rem;
|
81 |
+
size: 200;
|
82 |
+
}
|
83 |
+
|
84 |
+
button {
|
85 |
+
font-size: 15px;
|
86 |
+
margin: 1rem;
|
87 |
+
}
|
88 |
+
|