Explorar el Código

add smooth scrolling

Falko Schindler hace 2 años
padre
commit
63d726d570
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      main.py

+ 4 - 1
main.py

@@ -29,6 +29,9 @@ def add_head_html() -> None:
     ''')  # https://realfavicongenerator.net/
     ''')  # https://realfavicongenerator.net/
     ui.add_head_html(f'''
     ui.add_head_html(f'''
         <style>
         <style>
+        html {{
+            scroll-behavior: smooth;
+        }}
         body {{
         body {{
             background-color: #f8f8f8;
             background-color: #f8f8f8;
         }}
         }}
@@ -158,7 +161,7 @@ ui.run()
             .classes('w-full items-center gap-28 px-32 py-16 no-wrap') \
             .classes('w-full items-center gap-28 px-32 py-16 no-wrap') \
             .style(f'background: {ACCENT_COLOR}'):
             .style(f'background: {ACCENT_COLOR}'):
         with ui.column().classes('gap-4'):
         with ui.column().classes('gap-4'):
-            ui.markdown('Go to the API reference to see a ton of live examples') \
+            ui.markdown('Go to the API reference to see a ton of live examples.') \
                 .style('font-size: 220%; color: white; line-height: 0.9; font-weight: 500')
                 .style('font-size: 220%; color: white; line-height: 0.9; font-weight: 500')
             ui.html('The whole content of <a href="https://nicegui.io/">nicegui.io</a> is implemented with NiceGUI itself.') \
             ui.html('The whole content of <a href="https://nicegui.io/">nicegui.io</a> is implemented with NiceGUI itself.') \
                 .style('font-size: 150%; color: white')
                 .style('font-size: 150%; color: white')