PageSourceSearch

https://directlayout.github.io/assets/js/scripts.js

js directlayout.github.io collected 2026-10-03 09:00:39 UTC 17,295 bytes, 278 lines download raw bytes

1'use strict';
2
3(function() {
4    // Format video selector for compositional prompts.
5    let captions = ["a DSLR photo of a squirrel  chopping vegetables",
6"a DSLR photo of a squirrel  dancing",
7"a DSLR photo of a squirrel  eating a hamburger",
8"a DSLR photo of a squirrel  playing the saxophone",
9"a DSLR photo of a squirrel  reading a book",
10"a DSLR photo of a squirrel  ",
11"a DSLR photo of a squirrel  riding a motorcycle",
12"a DSLR photo of a squirrel  riding a skateboard",
13"a DSLR photo of a squirrel  sitting at a pottery wheel shaping a clay bowl",
14"a DSLR photo of a squirrel wearing a kimono chopping vegetables",
15"a DSLR photo of a squirrel wearing a kimono dancing",
16"a DSLR photo of a squirrel wearing a kimono eating a hamburger",
17"a DSLR photo of a squirrel wearing a kimono playing the saxophone",
18"a DSLR photo of a squirrel wearing a kimono reading a book",
19"a DSLR photo of a squirrel wearing a kimono ",
20"a DSLR photo of a squirrel wearing a kimono riding a motorcycle",
21"a DSLR photo of a squirrel wearing a kimono riding a skateboard",
22"a DSLR photo of a squirrel wearing a kimono sitting at a pottery wheel shaping a clay bowl",
23"a DSLR photo of a squirrel wearing a kimono wielding a katana",
24"a DSLR photo of a squirrel wearing a medieval suit of armor chopping vegetables",
25"a DSLR photo of a squirrel wearing a medieval suit of armor dancing",
26"a DSLR photo of a squirrel wearing a medieval suit of armor eating a hamburger",
27"a DSLR photo of a squirrel wearing a medieval suit of armor playing the saxophone",
28"a DSLR photo of a squirrel wearing a medieval suit of armor reading a book",
29"a DSLR photo of a squirrel wearing a medieval suit of armor ",
30"a DSLR photo of a squirrel wearing a medieval suit of armor riding a motorcycle",
31"a DSLR photo of a squirrel wearing a medieval suit of armor riding a skateboard",
32"a DSLR photo of a squirrel wearing a medieval suit of armor sitting at a pottery wheel shaping a clay bowl",
33"a DSLR photo of a squirrel wearing a medieval suit of armor wielding a katana",
34"a DSLR photo of a squirrel wearing an elegant ballgown chopping vegetables",
35"a DSLR photo of a squirrel wearing an elegant ballgown dancing",
36"a DSLR photo of a squirrel wearing an elegant ballgown eating a hamburger",
37"a DSLR photo of a squirrel wearing an elegant ballgown playing the saxophone",
38"a DSLR photo of a squirrel wearing an elegant ballgown reading a book",
39"a DSLR photo of a squirrel wearing an elegant ballgown ",
40"a DSLR photo of a squirrel wearing an elegant ballgown riding a motorcycle",
41"a DSLR photo of a squirrel wearing an elegant ballgown riding a skateboard",
42"a DSLR photo of a squirrel wearing an elegant ballgown sitting at a pottery wheel shaping a clay bowl",
43"a DSLR photo of a squirrel wearing an elegant ballgown wielding a katana",
44"a DSLR photo of a squirrel wearing a purple hoodie chopping vegetables",
45"a DSLR photo of a squirrel wearing a purple hoodie dancing",
46"a DSLR photo of a squirrel wearing a purple hoodie eating a hamburger",
47"a DSLR photo of a squirrel wearing a purple hoodie playing the saxophone",
48"a DSLR photo of a squirrel wearing a purple hoodie reading a book",
49"a DSLR photo of a squirrel wearing a purple hoodie ",
50"a DSLR photo of a squirrel wearing a purple hoodie riding a motorcycle",
51"a DSLR photo of a squirrel wearing a purple hoodie riding a skateboard",
52"a DSLR photo of a squirrel wearing a purple hoodie sitting at a pottery wheel shaping a clay bowl",
53"a DSLR photo of a squirrel wearing a purple hoodie wielding a katana",
54"a DSLR photo of a squirrel  wielding a katana",
55"a highly detailed metal sculpture of a squirrel  chopping vegetables",
56"a highly detailed metal sculpture of a squirrel  dancing",
57"a highly detailed metal sculpture of a squirrel  eating a hamburger",
58"a highly detailed metal sculpture of a squirrel  playing the saxophone",
59"a highly detailed metal sculpture of a squirrel  reading a book",
60"a highly detailed metal sculpture of a squirrel  ",
61"a highly detailed metal sculpture of a squirrel  riding a motorcycle",
62"a highly detailed metal sculpture of a squirrel  riding a skateboard",
63"a highly detailed metal sculpture of a squirrel  sitting at a pottery wheel shaping a clay bowl",
64"a highly detailed metal sculpture of a squirrel wearing a kimono chopping vegetables",
65"a highly detailed metal sculpture of a squirrel wearing a kimono dancing",
66"a highly detailed metal sculpture of a squirrel wearing a kimono eating a hamburger",
67"a highly detailed metal sculpture of a squirrel wearing a kimono playing the saxophone",
68"a highly detailed metal sculpture of a squirrel wearing a kimono reading a book",
69"a highly detailed metal sculpture of a squirrel wearing a kimono ",
70"a highly detailed metal sculpture of a squirrel wearing a kimono riding a motorcycle",
71"a highly detailed metal sculpture of a squirrel wearing a kimono riding a skateboard",
72"a highly detailed metal sculpture of a squirrel wearing a kimono sitting at a pottery wheel shaping a clay bowl",
73"a highly detailed metal sculpture of a squirrel wearing a kimono wielding a katana",
74"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor chopping vegetables",
75"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor dancing",
76"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor eating a hamburger",
77"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor playing the saxophone",
78"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor reading a book",
79"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor ",
80"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor ri
80ding a motorcycle",
81"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor riding a skateboard",
82"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor sitting at a pottery wheel shaping a clay bowl",
83"a highly detailed metal sculpture of a squirrel wearing a medieval suit of armor wielding a katana",
84"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown chopping vegetables",
85"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown dancing",
86"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown eating a hamburger",
87"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown playing the saxophone",
88"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown reading a book",
89"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown ",
90"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown riding a motorcycle",
91"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown riding a skateboard",
92"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown sitting at a pottery wheel shaping a clay bowl",
93"a highly detailed metal sculpture of a squirrel wearing an elegant ballgown wielding a katana",
94"a highly detailed metal sculpture of a squirrel wearing a purple hoodie chopping vegetables",
95"a highly detailed metal sculpture of a squirrel wearing a purple hoodie dancing",
96"a highly detailed metal sculpture of a squirrel wearing a purple hoodie eating a hamburger",
97"a highly detailed metal sculpture of a squirrel wearing a purple hoodie playing the saxophone",
98"a highly detailed metal sculpture of a squirrel wearing a purple hoodie reading a book",
99"a highly detailed metal sculpture of a squirrel wearing a purple hoodie ",
100"a highly detailed metal sculpture of a squirrel wearing a purple hoodie riding a motorcycle",
101"a highly detailed metal sculpture of a squirrel wearing a purple hoodie riding a skateboard",
102"a highly detailed metal sculpture of a squirrel wearing a purple hoodie sitting at a pottery wheel shaping a clay bowl",
103"a highly detailed metal sculpture of a squirrel wearing a purple hoodie wielding a katana",
104"a highly detailed metal sculpture of a squirrel  wielding a katana",
105"an intricate wooden carving of a squirrel  chopping vegetables",
106"an intricate wooden carving of a squirrel  dancing",
107"an intricate wooden carving of a squirrel  eating a hamburger",
108"an intricate wooden carving of a squirrel  playing the saxophone",
109"an intricate wooden carving of a squirrel  reading a book",
110"an intricate wooden carving of a squirrel  ",
111"an intricate wooden carving of a squirrel  riding a motorcycle",
112"an intricate wooden carving of a squirrel  riding a skateboard",
113"an intricate wooden carving of a squirrel  sitting at a pottery wheel shaping a clay bowl",
114"an intricate wooden carving of a squirrel wearing a kimono chopping vegetables",
115"an intricate wooden carving of a squirrel wearing a kimono dancing",
116"an intricate wooden carving of a squirrel wearing a kimono eating a hamburger",
117"an intricate wooden carving of a squirrel wearing a kimono playing the saxophone",
118"an intricate wooden carving of a squirrel wearing a kimono reading a book",
119"an intricate wooden carving of a squirrel wearing a kimono ",
120"an intricate wooden carving of a squirrel wearing a kimono riding a motorcycle",
121"an intricate wooden carving of a squirrel wearing a kimono riding a skateboard",
122"an intricate wooden carving of a squirrel wearing a kimono sitting at a pottery wheel shaping a clay bowl",
123"an intricate wooden carving of a squirrel wearing a kimono wielding a katana",
124"an intricate wooden carving of a squirrel wearing a medieval suit of armor chopping vegetables",
125"an intricate wooden carving of a squirrel wearing a medieval suit of armor dancing",
126"an intricate wooden carving of a squirrel wearing a medieval suit of armor eating a hamburger",
127"an intricate wooden carving of a squirrel wearing a medieval suit of armor playing the saxophone",
128"an intricate wooden carving of a squirrel wearing a medieval suit of armor reading a book",
129"an intricate wooden carving of a squirrel wearing a medieval suit of armor ",
130"an intricate wooden carving of a squirrel wearing a medieval suit of armor ri
130ding a motorcycle",
131"an intricate wooden carving of a squirrel wearing a medieval suit of armor riding a skateboard",
132"an intricate wooden carving of a squirrel wearing a medieval suit of armor sitting at a pottery wheel shaping a clay bowl",
133"an intricate wooden carving of a squirrel wearing a medieval suit of armor wielding a katana",
134"an intricate wooden carving of a squirrel wearing an elegant ballgown chopping vegetables",
135"an intricate wooden carving of a squirrel wearing an elegant ballgown dancing",
136"an intricate wooden carving of a squirrel wearing an elegant ballgown eating a hamburger",
137"an intricate wooden carving of a squirrel wearing an elegant ballgown playing the saxophone",
138"an intricate wooden carving of a squirrel wearing an elegant ballgown reading a book",
139"an intricate wooden carving of a squirrel wearing an elegant ballgown ",
140"an intricate wooden carving of a squirrel wearing an elegant ballgown riding a motorcycle",
141"an intricate wooden carving of a squirrel wearing an elegant ballgown riding a skateboard",
142"an intricate wooden carving of a squirrel wearing an elegant ballgown sitting at a pottery wheel shaping a clay bowl",
143"an intricate wooden carving of a squirrel wearing an elegant ballgown wielding a katana",
144"an intricate wooden carving of a squirrel wearing a purple hoodie chopping vegetables",
145"an intricate wooden carving of a squirrel wearing a purple hoodie dancing",
146"an intricate wooden carving of a squirrel wearing a purple hoodie eating a hamburger",
147"an intricate wooden carving of a squirrel wearing a purple hoodie playing the saxophone",
148"an intricate wooden carving of a squirrel wearing a purple hoodie reading a book",
149"an intricate wooden carving of a squirrel wearing a purple hoodie ",
150"an intricate wooden carving of a squirrel wearing a purple hoodie riding a motorcycle",
151"an intricate wooden carving of a squirrel wearing a purple hoodie riding a skateboard",
152"an intricate wooden carving of a squirrel wearing a purple hoodie sitting at a pottery wheel shaping a clay bowl",
153"an intricate wooden carving of a squirrel wearing a purple hoodie wielding a katana",
154"an intricate wooden carving of a squirrel  wielding a katana"];
155
156    let imagen_pieces = [
157        ["a DSLR photo of a squirrel", "an intricate wooden carving of a squirrel", "a highly detailed metal sculpture of a squirrel"],
158        ["", "wearing a kimono", "wearing a medieval suit of armor", "wearing a purple hoodie", "wearing an elegant ballgown"],
159        ["", "reading a book", "riding a motorcycle", "playing the saxophone", "chopping vegetables", "sitting at a pottery wheel shaping a clay bowl",
160        "riding a skateboard", "wielding a katana", "eating a hamburger", "dancing"],
161    ];
162
163    const updateCompositionVideo = () => {
164        let phrase = "";
165        for (let depth = 1; depth <= imagen_pieces.length; depth++) {
166            let tagContainer = document.getElementById('compositional_tags_depth_' + depth);
167            let selected = tagContainer.querySelectorAll('.selected');
168
169            // Make sure at most one item is selected at this level.
170            if (selected.length > 1) {
171                // Too many tags selected at this level. Shouldn't have happened, but unselect them.
172                selected.slice(1, selected.length).forEach((chunk) => {
173                    chunk.classList = "";
174                });
175            }
176
177            // Make sure at least one item is selected at this level.
178            if (selected.length == 0) {
179                tagContainer.querySelector('span').classList = "selected";
180                updateCompositionVideo();
181                return;
182            }
183
184            let segment = selected[0].getAttribute("data-segment");
185            phrase = phrase + segment;
186        }
187
188        if (captions.includes(phrase)) {
189            let compositionalVideo = document.getElementById('compositionalVideo');
190            let container = compositionalVideo.parentNode;
191            let videoName = phrase.replaceAll(' ', '_') + '_rgbdn_hq_15000.mp4';
192            let sourceURL = "https://pub-b1f092b6867f4495b8f149d222a3bffe.r2.dev/journey_sept28/cropped/full_continuous/" + videoName;
193            console.log('phrase found: ', phrase, sourceURL);
194
195            let width = compositionalVideo.offsetWidth;
196            let height = compositionalVideo.offsetHeight;
197
198            // let oldSourceEl = compositionalVideo.querySelector('source');
199            let oldSourceEl = document.getElementById('compositionalVideoSrc');
200            oldSourceEl.src = sourceURL;
201
202            container.style = "opacity: 0;";
203            setTimeout(() => {
204                container.style = "opacity: 1;";
205                compositionalVideo.load();
206            }, 750);
207
208            let captionEl = document.getElementById('compositionalCaption');
209            if (captionEl)
210                captionEl.innerHTML = phrase;
211        } else {
212            console.log('phrase NOT found: ' + phrase);
213        }
214    };
215
216    const deselect = (element) => {
217        element.classList = ("" + element.classList).replace('selected', ' ');  // not clean, what about spaces?
218    }
219
220    const tagClicked = (event) => {
221        event.target.parentNode.querySelectorAll('.selected').forEach(deselect);
222        event.target.classList = "selected";
223        updateCompositionVideo();
224    };
225
226    let phraseContainer = document.querySelector('.compositional .text');
227    imagen_pieces.forEach((phrases, depth) => {
228        depth = depth + 1;
229        let tagContainer = document.createElement("P");
230        tagContainer.classList = "selectable left";
231        tagContainer.id = "compositional_tags_depth_" + depth;
232
233        phrases.forEach((segment, i) => {
234            if (depth > 1) {
235                segment = " " + segment;
236            }
237
238            let tag = document.createElement("SPAN");
239            let text = segment.trim();
240            if (!text)
241                text = '[...]';
242
243            tag.appendChild(document.createTextNode(text));
244            tag.setAttribute("data-segment", segment);
245            tag.onclick = tagClicked;
246            if (i == 0)
247                tag.classList = "selected";
248
249            tagContainer.appendChild(tag);
250        });
251
252        phraseContainer.appendChild(tagContainer);
253    });
254
255})();
256
257(function() {
258    // Click to load handlers for 3D meshes.
259    document.querySelectorAll('button.loads-model').forEach((button) => {
260        button.setAttribute('data-action', 'load');
261        button.addEventListener('click', () => {
262            let model = document.getElementById(button.getAttribute("data-controls"));
263
264            if (button.getAttribute('data-action') == 'load') {
265                model.dismissPoster();
266                button.classList = "btn btn-disabled";
267                button.innerHTML = "Hide 3D model";
268                button.setAttribute('data-action', 'unload');
269            } else {
270                model.showPoster();
271                button.classList = "btn btn-primary";
272                button.innerHTML = "Load 3D model";
273                button.setAttribute('data-action', 'load');
274            }
275
276        });
277    });
278})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.