返回提交历史
Modified
g4f/gui/client/static/css/style.css
+8
-74
Modified
g4f/gui/client/static/js/chat.v1.js
+3
-11
XFEstudio/gpt4free
Improve styling mobile
226c69da
代码差异
2 个文件
+11
-85
@@ -1422,11 +1422,12 @@ form .field.saved .fa-xmark {
1422
1422
line-height: 30px;
1423
1423
}
1424
1424
1425
.collapsible {
1425
.field.collapsible {
1426
1426
border: 1px solid var(--blur-border);
1427
1427
border-radius: var(--border-radius-1);
1428
1428
overflow: hidden;
1429
1429
margin-bottom: 10px;
1430
padding-right: 0;
1430
1431
}
1431
1432
1432
1433
.collapsible-header {
@@ -1443,7 +1444,11 @@ form .field.saved .fa-xmark {
1443
1444
}
1444
1445
1445
1446
.collapsible-content {
1446
padding: 10px;
1447
padding: 0 10px;
1448
}
1449
1450
.collapsible-content.api-key {
1451
width: 100%;
1447
1452
}
1448
1453
1449
1454
.collapsible-content.hidden {
@@ -1540,6 +1545,7 @@ form .field.saved .fa-xmark {
1540
1545
.conversations, .settings, .conversation {
1541
1546
flex: 1 1 300px;
1542
1547
min-width: 0;
1548
height: 100%;
1543
1549
}
1544
1550
1545
1551
/* Media queries for mobile devices */
@@ -1558,81 +1564,9 @@ form .field.saved .fa-xmark {
1558
1564
order: -1;
1559
1565
min-height: 80vh;
1560
1566
}
1561
1562
.buttons .field {
1563
flex: 1 1 auto;
1564
}
1565
1566
#model, #provider {
1567
font-size: 14px;
1568
padding: 6px;
1569
}
1570
1571
.user-input .input-area {
1572
padding: 8px;
1573
}
1574
1575
textarea#message-input {
1576
font-size: 14px;
1577
}
1578
1579
.mobile-sidebar {
1580
display: block;
1581
position: fixed;
1582
top: 10px;
1583
left: 10px;
1584
z-index: 1000;
1585
}
1586
1587
.conversations {
1588
position: fixed;
1589
left: -100%;
1590
top: 0;
1591
bottom: 0;
1592
transition: left 0.3s;
1593
z-index: 999;
1594
background: var(--bg-color);
1595
}
1596
1597
.conversations.active {
1598
left: 0;
1599
}
1600
}
1601
1602
/* Flexible form elements */
1603
.user-input .input-area {
1604
display: flex;
1605
flex-wrap: wrap;
1606
gap: 8px;
1607
}
1608
1609
textarea {
1610
max-width: 100%;
1611
min-height: 50px;
1612
resize: vertical;
1613
}
1614
1615
.file-label {
1616
flex-shrink: 0;
1617
}
1618
1619
/* Adaptive model menu */
1620
#model, #provider {
1621
max-width: 150px;
1622
overflow: hidden;
1623
text-overflow: ellipsis;
1624
1567
}
1625
1568
1626
1569
@media (max-width: 480px) {
1627
#model, #provider {
1628
max-width: 100%;
1629
}
1630
1631
.toolbar {
1632
flex-wrap: wrap;
1633
gap: 5px;
1634
}
1635
1636
1570
.info .convo-title {
1637
1571
font-size: 12px;
1638
1572
}
@@ -1651,8 +1651,10 @@ window.addEventListener('popstate', hide_sidebar, false);
1651
1651
sidebar_button.addEventListener("click", async () => {
1652
1652
if (sidebar.classList.contains("shown")) {
1653
1653
await hide_sidebar();
1654
chat.classList.remove("hidden");
1654
1655
} else {
1655
1656
await show_menu();
1657
chat.classList.add("hidden");
1656
1658
}
1657
1659
window.scrollTo(0, 0);
1658
1660
});
@@ -2096,7 +2098,7 @@ async function on_api() {
2096
2098
<span class="label">Providers API key</span>
2097
2099
<i class="fa-solid fa-chevron-down"></i>
2098
2100
</div>
2099
<div class="collapsible-content hidden"></div>
2101
<div class="collapsible-content api-key hidden"></div>
2100
2102
`;
2101
2103
settings.querySelector(".paper").appendChild(providersListContainer);
2102
2104
@@ -2739,13 +2741,3 @@ document.getElementById("showLog").addEventListener("click", ()=> {
2739
2741
settings.classList.add("hidden");
2740
2742
log_storage.scrollTop = log_storage.scrollHeight;
2741
2743
});
2742
2743
document.querySelector('.mobile-sidebar').addEventListener('click', function() {
2744
document.querySelector('.conversations').classList.toggle('active');
2745
});
2746
2747
document.addEventListener('click', function(e) {
2748
if(!e.target.closest('.conversations') && !e.target.closest('.mobile-sidebar')) {
2749
document.querySelector('.conversations').classList.remove('active');
2750
}
2751
});