Skip to content

Commit 11fcf59

Browse files
authored
Update index.html
1 parent ee231e2 commit 11fcf59

1 file changed

Lines changed: 40 additions & 33 deletions

File tree

index.html

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,7 +3592,7 @@ <h2 id="about-title"></h2>
35923592
}
35933593

35943594
const randomSeed = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
3595-
const url = "https://image.pollinations.ai/prompt/" + encodeURIComponent(promptText) + `?seed=${randomSeed}&token=fxj5LLKJi8hIjZbK&safe=true&nologo=true&enhance=true&model=flux` + urlSuffix;
3595+
const url = "https://image.pollinations.ai/prompt/" + encodeURIComponent(promptText) + `?seed=${randomSeed}&safe=true&nologo=true&enhance=true&model=flux` + urlSuffix;
35963596

35973597
const tempImg = new Image();
35983598
tempImg.onload = () => {
@@ -3945,37 +3945,44 @@ <h2 id="about-title"></h2>
39453945
});
39463946
App.modals.show('style-editor-modal');
39473947
},
3948-
handleUpdate(event) {
3949-
const target = event.target;
3950-
const id = target.id.replace('style-', '');
3951-
let value = target.value;
3952-
3953-
const hexToRgba = (h, o) => {
3954-
const r = parseInt(h.slice(1, 3), 16), g = parseInt(h.slice(3, 5), 16), b = parseInt(h.slice(5, 7), 16);
3955-
return `rgba(${r}, ${g}, ${b}, ${o})`;
3956-
};
3957-
3958-
if (target.id === 'style-container-bg-color' || target.id === 'style-container-bg-opacity') {
3959-
const hex = document.getElementById('style-container-bg-color').value;
3960-
const opacity = document.getElementById('style-container-bg-opacity').value;
3961-
App.state.storyData.meta.styles['--container-bg-color'] = hexToRgba(hex, opacity);
3962-
} else if (['btn-color', 'btn-hover-color', 'btn-opacity'].includes(id)) {
3963-
const hex = document.getElementById('style-btn-color').value;
3964-
const hoverHex = document.getElementById('style-btn-hover-color').value;
3965-
const opacity = document.getElementById('style-btn-opacity').value;
3966-
App.state.storyData.meta.styles['--btn-color'] = hexToRgba(hex, opacity);
3967-
App.state.storyData.meta.styles['--btn-hover-color'] = hexToRgba(hoverHex, opacity);
3968-
}
3969-
else if (id === 'layout') { App.state.storyData.meta.layout = value; }
3970-
else {
3971-
if (target.type === 'number') value += 'px';
3972-
App.state.storyData.meta.styles[`--${id}`] = value;
3973-
}
3974-
3975-
App.setDirty(true);
3976-
if (App.elements['player-container'].style.display === 'flex') App.player.renderScene(App.state.currentSceneId);
3977-
if (App.elements['editor-fieldset'].disabled === false) App.editor.renderPreview();
3978-
},
3948+
handleUpdate(event) {
3949+
const target = event.target;
3950+
const id = target.id.replace('style-', '');
3951+
let value = target.value;
3952+
3953+
const hexToRgba = (h, o) => {
3954+
const r = parseInt(h.slice(1, 3), 16), g = parseInt(h.slice(3, 5), 16), b = parseInt(h.slice(5, 7), 16);
3955+
return `rgba(${r}, ${g}, ${b}, ${o})`;
3956+
};
3957+
3958+
if (target.id === 'style-container-bg-color' || target.id === 'style-container-bg-opacity') {
3959+
const hex = document.getElementById('style-container-bg-color').value;
3960+
const opacity = document.getElementById('style-container-bg-opacity').value;
3961+
App.state.storyData.meta.styles['--container-bg-color'] = hexToRgba(hex, opacity);
3962+
} else if (['btn-color', 'btn-hover-color', 'btn-opacity'].includes(id)) {
3963+
const hex = document.getElementById('style-btn-color').value;
3964+
const hoverHex = document.getElementById('style-btn-hover-color').value;
3965+
const opacity = document.getElementById('style-btn-opacity').value;
3966+
App.state.storyData.meta.styles['--btn-color'] = hexToRgba(hex, opacity);
3967+
App.state.storyData.meta.styles['--btn-hover-color'] = hexToRgba(hoverHex, opacity);
3968+
}
3969+
else if (id === 'layout') { App.state.storyData.meta.layout = value; }
3970+
else {
3971+
if (target.type === 'number') value += 'px';
3972+
App.state.storyData.meta.styles[`--${id}`] = value;
3973+
}
3974+
3975+
// Live-update the editor's audio players' volume
3976+
if (id === 'music-volume') {
3977+
App.elements['music-player'].volume = parseFloat(target.value);
3978+
} else if (id === 'ambience-volume') {
3979+
App.elements['ambience-player'].volume = parseFloat(target.value);
3980+
}
3981+
3982+
App.setDirty(true);
3983+
if (App.elements['player-container'].style.display === 'flex') App.player.renderScene(App.state.currentSceneId);
3984+
if (App.elements['editor-fieldset'].disabled === false) App.editor.renderPreview();
3985+
},
39793986
applyToContainer(container) {
39803987
const meta = App.state.storyData.meta;
39813988
const styles = meta.styles;
@@ -4294,7 +4301,7 @@ <h2 id="about-title"></h2>
42944301
urlSuffix = '&width=1280&height=720';
42954302
}
42964303
const randomSeed = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
4297-
const url = "https://image.pollinations.ai/prompt/" + encodeURIComponent(fullPrompt) + `?seed=${randomSeed}&token=fxj5LLKJi8hIjZbK&safe=true&nologo=true&enhance=true&model=flux` + urlSuffix;
4304+
const url = "https://image.pollinations.ai/prompt/" + encodeURIComponent(fullPrompt) + `?seed=${randomSeed}&safe=true&nologo=true&enhance=true&model=flux` + urlSuffix;
42984305

42994306
try {
43004307
const response = await fetch(url);

0 commit comments

Comments
 (0)