3333 < style >
3434 /* Custom scrollbar for the console output */
3535 # console-log-text ::-webkit-scrollbar {
36- width : 8 px ;
36+ width : 10 px ;
3737 }
3838 # console-log-text ::-webkit-scrollbar-track {
39- background : # 1f2937 ;
39+ background : # 111827 ;
40+ border-left : 1px solid # 374151 ;
4041 }
4142 # console-log-text ::-webkit-scrollbar-thumb {
4243 background : # 4b5563 ;
43- border-radius : 4px ;
44+ border-radius : 5px ;
45+ border : 2px solid # 111827 ;
4446 }
4547 # console-log-text ::-webkit-scrollbar-thumb : hover {
4648 background : # 6b7280 ;
4749 }
4850
49- /* Flex layout to make the console fill remaining height */
51+ /* Flex layout setup */
5052 body {
5153 display : flex;
5254 flex-direction : column;
5355 height : 100vh ;
5456 margin : 0 ;
55- overflow : hidden; /* Prevent body scrolling, let console scroll */
57+ overflow : hidden;
5658 }
5759
5860 .main-container {
5961 flex : 1 ;
6062 display : flex;
6163 flex-direction : column;
6264 padding-bottom : 2rem ;
65+ min-height : 0 ; /* Crucial for flex child to allow inner scrolling */
6366 }
6467
6568 .terminal-container {
6669 flex : 1 ;
6770 display : flex;
6871 flex-direction : column;
69- min-height : 0 ; /* Important for flex child scrolling */
72+ min-height : 0 ; /* Crucial for flex child to allow inner scrolling */
7073 }
7174
7275 # console-log-text {
7376 flex : 1 ;
74- overflow-y : auto;
77+ overflow-y : auto; /* Enables vertical scrolling */
78+ word-wrap : break-word;
79+ }
80+
81+ /* Prevent layout shift during auto-scroll */
82+ .log-entry {
83+ margin-bottom : 0.5rem ;
84+ white-space : pre-wrap;
85+ word-break : break-all;
7586 }
7687 </ style >
7788</ head >
7889< body class ="bg-gray-50 font-sans text-gray-800 ">
7990
80- <!-- I've forced the max width of the whole container to exactly 1024px and centered it -->
8191 < div class ="main-container w-[1024px] max-w-[1024px] mx-auto pt-8 px-4 ">
8292
8393 <!-- Header Section -->
84- < div class ="text-center mb-6 ">
94+ < div class ="text-center mb-6 shrink-0 ">
8595 < h1 class ="text-4xl font-extrabold text-gray-900 tracking-tight mb-2 ">
8696 < span class ="block text-brand "> Labs64</ span >
8797 < a href ="https://netlicensing.io/ " target ="_blank " class ="hover:text-brand-hover transition-colors ">
@@ -111,9 +121,9 @@ <h1 class="text-4xl font-extrabold text-gray-900 tracking-tight mb-2">
111121 </ div >
112122
113123 <!-- Terminal Output Section -->
114- < div class ="terminal-container bg-gray-900 rounded-lg shadow-xl overflow-hidden border border-gray-700 w-full ">
124+ < div class ="terminal-container bg-gray-900 rounded-lg shadow-xl overflow-hidden border border-gray-700 w-full relative ">
115125 <!-- Mac-style window header -->
116- < div class ="bg-gray-800 px-4 py-2 border-b border-gray-700 flex items-center shrink-0 ">
126+ < div class ="bg-gray-800 px-4 py-2 border-b border-gray-700 flex items-center shrink-0 z-10 ">
117127 < div class ="flex space-x-2 ">
118128 < div class ="w-3 h-3 rounded-full bg-red-500 "> </ div >
119129 < div class ="w-3 h-3 rounded-full bg-yellow-500 "> </ div >
@@ -122,7 +132,7 @@ <h1 class="text-4xl font-extrabold text-gray-900 tracking-tight mb-2">
122132 < div class ="mx-auto text-gray-400 text-xs font-mono "> demo-output.log</ div >
123133 </ div >
124134
125- <!-- Output container now takes up remaining screen height -->
135+ <!-- Output container now takes up remaining screen height AND allows scrolling -->
126136 < div class ="p-4 font-mono text-sm w-full " id ="console-log-text ">
127137 < div class ="text-gray-500 mb-2 "> Ready. Click 'Execute Demo' to start the NetLicensing API simulation...</ div >
128138 </ div >
@@ -156,7 +166,7 @@ <h1 class="text-4xl font-extrabold text-gray-900 tracking-tight mb-2">
156166 function appendLog ( args , colorClass , prefixChar = '>' ) {
157167 const msg = formatArgs ( args ) ;
158168 const div = document . createElement ( 'div' ) ;
159- div . className = `mb-2 whitespace-pre-wrap break-all ${ colorClass } ` ;
169+ div . className = `log-entry ${ colorClass } ` ;
160170
161171 const prefix = document . createElement ( 'span' ) ;
162172 prefix . className = 'text-[#E14817] mr-2 select-none font-bold' ;
@@ -166,7 +176,12 @@ <h1 class="text-4xl font-extrabold text-gray-900 tracking-tight mb-2">
166176 div . appendChild ( document . createTextNode ( msg ) ) ;
167177
168178 logger . appendChild ( div ) ;
169- logger . scrollTop = logger . scrollHeight ;
179+
180+ // Ensure the scroll goes all the way to the newly added item
181+ // Use requestAnimationFrame to ensure the DOM has updated before calculating height
182+ requestAnimationFrame ( ( ) => {
183+ logger . scrollTop = logger . scrollHeight ;
184+ } ) ;
170185 }
171186
172187 console . log = function ( ) {
0 commit comments