返回提交历史
Modified
g4f/gui/client/index.html
+10
-3
Modified
g4f/gui/client/static/js/chat.v1.js
+1
-1
XFEstudio/gpt4free
Fix animation in lightbox
54a6d91c
代码差异
2 个文件
+11
-4
@@ -39,12 +39,18 @@
39
39
<script src="https://cdn.jsdelivr.net/npm/gpt-tokenizer/dist/cl100k_base.js" async></script>
40
40
<script src="/static/js/text_to_speech/index.js" async></script>
41
41
<script type="module" async>
42
import PhotoSwipeLightbox from 'https://unpkg.com/photoswipe/dist/photoswipe-lightbox.esm.js';
42
import PhotoSwipeLightbox from 'https://cdn.jsdelivr.net/npm/photoswipe/dist/photoswipe-lightbox.esm.js';
43
43
const lightbox = new PhotoSwipeLightbox({
44
44
gallery: '#messages',
45
45
children: 'a:has(img)',
46
showHideAnimationType: 'none',
47
pswpModule: () => import('https://unpkg.com/photoswipe'),
46
secondaryZoomLevel: 2,
47
pswpModule: () => import('https://cdn.jsdelivr.net/npm/photoswipe'),
48
});
49
lightbox.addFilter('itemData', (itemData, index) => {
50
const img = itemData.element.querySelector('img');
51
itemData.width = img.naturalWidth;
52
itemData.height = img.naturalHeight;
53
return itemData;
48
54
});
49
55
lightbox.on('uiRegister', function() {
50
56
lightbox.pswp.ui.registerElement({
@@ -297,6 +303,7 @@
297
303
<i class="fa-solid fa-thumbtack"></i>
298
304
</button>
299
305
</div>
306
<div id="pin_container" class="field"></div>
300
307
</div>
301
308
</div>
302
309
<div class="log hidden"></div>
@@ -1653,7 +1653,7 @@ async function load_provider_models(providerIndex=null) {
1653
1653
};
1654
1654
providerSelect.addEventListener("change", () => load_provider_models());
1655
1655
document.getElementById("pin").addEventListener("click", async () => {
1656
const pin_container = document.getElementById("pin").parentElement;
1656
const pin_container = document.getElementById("pin_container");
1657
1657
let selected_provider = providerSelect.options[providerSelect.selectedIndex];
1658
1658
selected_provider = selected_provider.value ? selected_provider : null;
1659
1659
const selected_model = get_selected_model();