Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KotGPT
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Pastushkov
KotGPT
Commits
6cffcab4
Commit
6cffcab4
authored
Aug 18, 2025
by
Michael Pastushkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e8a5c355
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
9 deletions
+42
-9
static/www/1.html
+42
-9
No files found.
static/www/1.html
View file @
6cffcab4
...
...
@@ -31,6 +31,7 @@
padding-bottom
:
var
(
--bottom-pad
);
/* room for composer + fixed footer */
display
:
flex
;
flex-direction
:
column
;
scroll-behavior
:
smooth
;
/* nudge for smooth scrolling */
}
.composer
{
...
...
@@ -72,7 +73,7 @@
filter
:
drop-shadow
(
0
6px
16px
rgba
(
0
,
0
,
0
,
.15
));
opacity
:
.98
;
}
/*
Scroll-to-bottom button (next to textarea)
*/
/*
Composer row with textarea + always-visible scroll button
*/
.scroll-row
{
display
:
flex
;
align-items
:
stretch
;
gap
:
.5rem
;
}
#inputText
{
flex
:
1
1
auto
;
}
#scrollDownBtn
{
...
...
@@ -89,6 +90,7 @@
cursor
:
pointer
;
transition
:
opacity
.18s
ease-in-out
,
transform
.12s
ease-in-out
;
opacity
:
.96
;
flex
:
0
0
auto
;
}
#scrollDownBtn
:hover
{
opacity
:
1
;
transform
:
translateY
(
-1px
);
}
#scrollDownBtn
svg
{
width
:
22px
;
height
:
22px
;
pointer-events
:
none
;
}
...
...
@@ -195,7 +197,40 @@
if
(
img
)
targetEl
.
innerHTML
=
''
;
}
// --- bottom helpers ---
// --- robust scrolling helpers ---
function
isOverflowing
(
el
){
return
el
&&
(
el
.
scrollHeight
-
el
.
clientHeight
)
>
1
;
}
// Decide what is actually scrolling now
function
getScrollEl
(){
if
(
isOverflowing
(
mainScroll
))
return
mainScroll
;
return
document
.
scrollingElement
||
document
.
documentElement
;
}
// Scroll to bottom of the current scroller (with fallback)
function
scrollToBottom
(){
const
el
=
getScrollEl
();
const
top
=
el
.
scrollHeight
;
if
(
el
===
document
.
scrollingElement
||
el
===
document
.
documentElement
||
el
===
document
.
body
)
{
window
.
scrollTo
({
top
,
behavior
:
'smooth'
});
}
else
{
el
.
scrollTo
({
top
,
behavior
:
'smooth'
});
}
// Fallback to ensure we actually reach the bottom
requestAnimationFrame
(()
=>
{
const
nearBottom
=
(
el
.
scrollTop
+
el
.
clientHeight
)
>=
(
el
.
scrollHeight
-
2
);
if
(
!
nearBottom
)
{
if
(
el
===
document
.
scrollingElement
||
el
===
document
.
documentElement
||
el
===
document
.
body
)
{
window
.
scrollTo
(
0
,
el
.
scrollHeight
);
}
else
{
el
.
scrollTop
=
el
.
scrollHeight
;
}
}
});
}
// --- bottom helpers for auto-stick while streaming ---
function
atBottom
(){
return
(
mainScroll
.
scrollTop
+
mainScroll
.
clientHeight
)
>=
(
mainScroll
.
scrollHeight
-
4
);
}
...
...
@@ -291,16 +326,14 @@
}
// events
promptForm
.
addEventListener
(
'submit'
,
e
=>
{
e
.
preventDefault
();
if
(
goBtn
.
style
.
display
!==
'none'
)
start
();
});
inputText
.
addEventListener
(
'keydown'
,
e
=>
{
document
.
getElementById
(
'promptForm'
)
.
addEventListener
(
'submit'
,
e
=>
{
e
.
preventDefault
();
if
(
goBtn
.
style
.
display
!==
'none'
)
start
();
});
document
.
getElementById
(
'inputText'
)
.
addEventListener
(
'keydown'
,
e
=>
{
if
(
e
.
key
===
'Enter'
&&
!
e
.
shiftKey
&&
goBtn
.
style
.
display
!==
'none'
){
e
.
preventDefault
();
start
();
}
});
stopBtn
.
addEventListener
(
'click'
,
stop
);
document
.
getElementById
(
'stopBtn'
)
.
addEventListener
(
'click'
,
stop
);
// scroll button action — scroll the main conversation area to bottom
scrollDownBtn
.
addEventListener
(
'click'
,
()
=>
{
mainScroll
.
scrollTo
({
top
:
mainScroll
.
scrollHeight
,
behavior
:
'smooth'
});
});
// scroll button action — robust scroll-to-bottom
scrollDownBtn
.
addEventListener
(
'click'
,
scrollToBottom
);
// init
window
.
addEventListener
(
'DOMContentLoaded'
,
async
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment