Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing styling on phone #1848

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions g4f/gui/client/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,11 @@ ul {
transform: rotate(360deg);
}

.settings h3 {
padding-left: 10px;
padding-top: 10px;
}
hlohaus marked this conversation as resolved.
Show resolved Hide resolved

@media screen and (max-width: 990px) {
.conversations {
display: none;
Expand Down Expand Up @@ -1107,11 +1112,6 @@ a:-webkit-any-link {
overflow: auto;
}

.settings h3 {
padding-left: 10px;
padding-top: 10px;
}

.settings .paper {
flex-direction: column;
min-width: 400px;
hlohaus marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
15 changes: 6 additions & 9 deletions g4f/gui/client/static/js/chat.v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const modelSelect = document.getElementById("model");
const modelProvider = document.getElementById("model2");
const systemPrompt = document.getElementById("systemPrompt");
const settings = document.querySelector(".settings");
const chat = document.querySelector(".conversation");
const album = document.querySelector(".images");

let prompt_lock = false;
Expand Down Expand Up @@ -132,7 +133,7 @@ const register_message_buttons = async () => {
speechText = speechText.replaceAll(/\[(.+)\]\(.+\)/gm, "($1)");
speechText = speechText.replaceAll(/```[a-z]+/gm, "");
speechText = filter_message(speechText.replaceAll("`", "").replaceAll("#", ""))
const lines = speechText.trim().split(/\n|;/).filter(v => v.trim());
const lines = speechText.trim().split(/\n|;/).filter(v => count_words(v));

window.onSpeechResponse = (url) => {
if (!el.dataset.stopped) {
Expand Down Expand Up @@ -780,6 +781,7 @@ async function hide_sidebar() {
sidebar.classList.remove("shown");
sidebar_button.classList.remove("rotated");
settings.classList.add("hidden");
chat.classList.remove("hidden");
if (window.location.pathname == "/menu/" || window.location.pathname == "/settings/") {
history.back();
}
Expand All @@ -801,11 +803,13 @@ sidebar_button.addEventListener("click", (event) => {

function open_settings() {
if (settings.classList.contains("hidden")) {
chat.classList.add("hidden");
sidebar.classList.remove("shown");
settings.classList.remove("hidden");
history.pushState({}, null, "/settings/");
} else {
settings.classList.add("hidden");
chat.classList.remove("hidden");
}
}

Expand Down Expand Up @@ -1262,20 +1266,14 @@ if (SpeechRecognition) {
recognition.maxAlternatives = 1;

let startValue;
let shouldStop;
let lastDebounceTranscript;
recognition.onstart = function() {
microLabel.classList.add("recognition");
startValue = messageInput.value;
shouldStop = false;
lastDebounceTranscript = "";
};
recognition.onend = function() {
if (shouldStop) {
messageInput.focus();
} else {
recognition.start();
}
messageInput.focus();
};
recognition.onresult = function(event) {
if (!event.results) {
Expand All @@ -1302,7 +1300,6 @@ if (SpeechRecognition) {

microLabel.addEventListener("click", () => {
if (microLabel.classList.contains("recognition")) {
shouldStop = true;
recognition.stop();
microLabel.classList.remove("recognition");
} else {
Expand Down
Loading