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
9579e9d2
Commit
9579e9d2
authored
Aug 18, 2025
by
Michael Pastushkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6cffcab4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
static/www/1.html
+26
-26
static/www/scroll-working.html
+0
-0
No files found.
static/www/1.html
View file @
9579e9d2
...
...
@@ -31,7 +31,7 @@
padding-bottom
:
var
(
--bottom-pad
);
/* room for composer + fixed footer */
display
:
flex
;
flex-direction
:
column
;
scroll-behavior
:
smooth
;
/*
nudge for smooth scrolling
*/
scroll-behavior
:
smooth
;
/*
smooth scrolling nudged by CSS
*/
}
.composer
{
...
...
@@ -73,27 +73,29 @@
filter
:
drop-shadow
(
0
6px
16px
rgba
(
0
,
0
,
0
,
.15
));
opacity
:
.98
;
}
/* Composer row with textarea + always-visible scroll button */
.scroll-row
{
display
:
flex
;
align-items
:
stretch
;
gap
:
.5rem
;
}
#inputText
{
flex
:
1
1
auto
;
}
/* Floating scroll-to-bottom button (inside main) */
#scrollDownBtn
{
position
:
sticky
;
/* sticky inside scroll container */
bottom
:
calc
(
var
(
--footer-h
)
+
1rem
);
/* floats above footer/composer */
margin-left
:
auto
;
/* push to right */
align-self
:
flex-end
;
/* right align in flex column */
z-index
:
1050
;
display
:
inline-flex
;
align-items
:
center
;
justify-content
:
center
;
border
:
none
;
border-radius
:
.5rem
;
width
:
4
2
px
;
height
:
4
2
px
;
border-radius
:
50%
;
width
:
4
8
px
;
height
:
4
8
px
;
background
:
rgba
(
13
,
110
,
253
,
.95
);
color
:
#fff
;
box-shadow
:
0
2px
8px
rgba
(
0
,
0
,
0
,
.15
);
box-shadow
:
0
4px
14px
rgba
(
0
,
0
,
0
,
.22
);
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
(
-
1
px
);
}
#scrollDownBtn
svg
{
width
:
2
2px
;
height
:
22
px
;
pointer-events
:
none
;
}
#scrollDownBtn
:hover
{
opacity
:
1
;
transform
:
translateY
(
-
2
px
);
}
#scrollDownBtn
svg
{
width
:
2
4px
;
height
:
24
px
;
pointer-events
:
none
;
}
</style>
</head>
<body>
...
...
@@ -112,24 +114,22 @@
<div
id=
"welcomeLogo"
>
<img
id=
"welcomeImg"
src=
"/static/images/ask-a-cat-en.png"
alt=
"Ask a Cat"
>
</div>
<div
id=
"thread"
></div>
<!-- Floating button inside the scrollable area -->
<button
id=
"scrollDownBtn"
type=
"button"
aria-label=
"Scroll down"
title=
"Scroll down"
>
<svg
viewBox=
"0 0 24 24"
fill=
"currentColor"
aria-hidden=
"true"
>
<path
d=
"M12 16a1 1 0 0 1-.7-.29l-6-6a1 1 0 1 1 1.4-1.42L12 13.59l5.3-5.3a1 1 0 0 1 1.4 1.42l-6 6A1 1 0 0 1 12 16z"
/>
</svg>
</button>
</main>
<!-- Composer (sticks above fixed footer) -->
<div
class=
"composer py-3"
>
<div
class=
"container"
>
<form
id=
"promptForm"
class=
"d-flex flex-column gap-2"
>
<!-- Row: textarea + always-visible scroll-down button -->
<div
class=
"scroll-row"
>
<textarea
id=
"inputText"
class=
"form-control"
rows=
"1"
placeholder=
""
></textarea>
<button
id=
"scrollDownBtn"
type=
"button"
aria-label=
"Scroll down"
title=
"Scroll down"
>
<svg
viewBox=
"0 0 24 24"
fill=
"currentColor"
aria-hidden=
"true"
>
<path
d=
"M12 16a1 1 0 0 1-.7-.29l-6-6a1 1 0 1 1 1.4-1.42L12 13.59l5.3-5.3a1 1 0 0 1 1.4 1.42l-6 6A1 1 0 0 1 12 16z"
/>
</svg>
</button>
</div>
<!-- Row: Go / Stop -->
<textarea
id=
"inputText"
class=
"form-control"
rows=
"1"
placeholder=
""
></textarea>
<div
class=
"d-flex align-items-center gap-2"
>
<button
id=
"goBtn"
class=
"btn btn-primary"
type=
"submit"
></button>
<button
id=
"stopBtn"
class=
"btn btn-outline-danger"
type=
"button"
style=
"display:none"
></button>
...
...
@@ -200,13 +200,13 @@
// --- robust scrolling helpers ---
function
isOverflowing
(
el
){
return
el
&&
(
el
.
scrollHeight
-
el
.
clientHeight
)
>
1
;
}
// Decide what is actually scrolling now
function
getScrollEl
(){
// Prefer mainScroll if it's the actual scroller
if
(
isOverflowing
(
mainScroll
))
return
mainScroll
;
// Fallback to page scroller (rare with this layout)
return
document
.
scrollingElement
||
document
.
documentElement
;
}
// Scroll to bottom of the current scroller (with fallback)
function
scrollToBottom
(){
const
el
=
getScrollEl
();
const
top
=
el
.
scrollHeight
;
...
...
@@ -217,7 +217,7 @@
el
.
scrollTo
({
top
,
behavior
:
'smooth'
});
}
//
Fallback to ensure we actually
reach the bottom
//
Hard fallback to ensure we
reach the bottom
requestAnimationFrame
(()
=>
{
const
nearBottom
=
(
el
.
scrollTop
+
el
.
clientHeight
)
>=
(
el
.
scrollHeight
-
2
);
if
(
!
nearBottom
)
{
...
...
@@ -332,7 +332,7 @@
});
document
.
getElementById
(
'stopBtn'
).
addEventListener
(
'click'
,
stop
);
//
scroll
button action — robust scroll-to-bottom
//
floating
button action — robust scroll-to-bottom
scrollDownBtn
.
addEventListener
(
'click'
,
scrollToBottom
);
// init
...
...
static/www/scroll-working.html
0 → 100644
View file @
9579e9d2
This diff is collapsed.
Click to expand it.
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