-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
136 lines (124 loc) · 4.24 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
const Spaces = {
livingRoom: "Living Room",
bedroom: "Bedroom",
kitchen: "Kitchen",
diningRoom: "Dining Room",
bathroom: "Bathroom",
homeOffice: "Home Office",
gym: "Gym",
yogaStudio: "Yoga Studio",
artStudio: "Art Studio",
library: "Library",
playroom: "Playroom",
wineCellar: "Wine Cellar",
homeTheater: "Home Theater",
gameRoom: "Game Room",
sunroom: "Sunroom",
patio: "Patio",
balcony: "Balcony",
rooftopTerrace: "Rooftop Terrace",
pool: "Pool",
hotTub: "Hot Tub",
sauna: "Sauna",
steamRoom: "Steam Room",
mudroom: "Mudroom",
foyer: "Foyer",
hallway: "Hallway",
staircase: "Staircase",
loft: "Loft",
attic: "Attic",
basement: "Basement",
garage: "Garage",
workshop: "Workshop",
gardenShed: "Garden Shed",
greenhouse: "Greenhouse",
barn: "Barn",
stable: "Stable",
warehouse: "Warehouse",
factory: "Factory",
laboratory: "Laboratory",
classroom: "Classroom",
lectureHall: "Lecture Hall",
conferenceRoom: "Conference Room",
receptionArea: "Reception Area",
waitingRoom: "Waiting Room",
church: "Church",
mosque: "Mosque",
synagogue: "Synagogue",
temple: "Temple",
theater: "Theater",
concertVenue: "Concert Venue",
nightclub: "Nightclub"
};
const ArchitecturalStyles = {
colonial: "Colonial",
victorian: "Victorian",
artDeco: "Art Deco",
gothic: "Gothic",
baroque: "Baroque",
rococo: "Rococo",
neoclassical: "Neoclassical",
modernist: "Modernist",
postmodern: "Postmodern",
brutalist: "Brutalist",
deconstructivist: "Deconstructivist",
international: "International",
bauhaus: "Bauhaus",
romanesque: "Romanesque",
renaissance: "Renaissance",
medieval: "Medieval",
contemporary: "Contemporary",
minimalist: "Minimalist",
industrial: "Industrial",
organic: "Organic"
};
const LivingSpaceDescriptors = {
minimalist: "Minimalist",
cozy: "Cozy",
spacious: "Spacious",
rustic: "Rustic",
modern: "Modern",
traditional: "Traditional",
urban: "Urban",
suburban: "Suburban",
industrial: "Industrial",
beachy: "Beachy",
coastal: "Coastal",
bohemian: "Bohemian",
eclectic: "Eclectic",
retro: "Retro",
vintage: "Vintage",
chic: "Chic",
elegant: "Elegant",
edgy: "Edgy",
luxurious: "Luxurious",
organic: "Organic"
};
// Get the button element and the prompt element
const generateButton = document.getElementById("generate-button");
const promptElement = document.getElementById("prompt");
// Add an event listener to the button
generateButton.addEventListener("click", generatePrompt);
// Generates a random text prompt using a random selection from the Spaces, ArchitecturalStyles, and LivingSpaceDescriptors arrays
function generatePrompt() {
const spaceKeys = Object.keys(Spaces);
const randomSpaceKey = spaceKeys[Math.floor(Math.random() * spaceKeys.length)];
const randomSpace = Spaces[randomSpaceKey];
const styleKeys = Object.keys(ArchitecturalStyles);
const randomStyleKey = styleKeys[Math.floor(Math.random() * styleKeys.length)];
const randomStyle = ArchitecturalStyles[randomStyleKey];
const descriptorKeys = Object.keys(LivingSpaceDescriptors);
const randomDescriptorKey = descriptorKeys[Math.floor(Math.random() * descriptorKeys.length)];
const randomDescriptor = LivingSpaceDescriptors[randomDescriptorKey];
const orientationSelect = document.getElementById("orientation-select");
const orientation = orientationSelect.value;
let orientationText = "";
if (orientation === "portrait") {
orientationText = " --ar 2:3";
} else if (orientation === "landscape") {
orientationText = " --ar 3:2";
}
const randomTextPrompt = `/imagine prompt: a mockup of an empty, blank poster, frame, in a ${randomDescriptor} ${randomSpace} with a ${randomStyle} architectural style empty, blank 24"x36" ray tracing, 12mm, 15mm, 18mm, f2.8 bokeh sony a9 High Quality --no text font letters ${orientationText} --v 4 `;
console.log(randomTextPrompt);
promptElement.textContent = randomTextPrompt;
}