Skip to content

Commit

Permalink
beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Sep 21, 2023
1 parent f4cbefb commit aecf686
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions jhub_apps/launcher/panel_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,29 @@
font-size: 1.4em;
}
.bk-btn:hover {
background: #034c76 !important;
color: white !important;
}
.bk-btn-danger:hover {
background: #dc3545 !important;
color: white !important;
}
.custom-heading {
text-align: center;
}
.center-row-image {
display: flex;
justify-content: center;
}
.bk-Column {
padding-right: 12px;
padding-bottom: 12px;
}
"""
pn.extension(raw_css=[css])
Expand Down Expand Up @@ -127,11 +146,11 @@ def __init__(self, app: App, username, **params):
pn.pane.Image(
self.app.thumbnail or self.app.logo,
link_url=self.app.url,
width=150, height=150,
align='center',
width=130, height=130,
align=('center', 'center'),
# sizing_mode="stretch_width",
),
sizing_mode="stretch_width",
css_classes=["center-row-image"],
),
pn.pane.Markdown(
f"""
Expand Down Expand Up @@ -193,12 +212,13 @@ def __init__(self, service: dict, username, **params):
service["thumbnail"],
link_url=service["link"],
width=50, height=50,
align='center',
align='center'
),
css_classes=["center-row-image"],
sizing_mode="stretch_width",
),
pn.pane.Markdown(
f"### {service['name']}",
f"### [{service['name']}]({service['link']})",
sizing_mode="stretch_width",
css_classes=['custom-heading', 'custom-font']
),
Expand All @@ -214,6 +234,10 @@ def __init__(self, service: dict, username, **params):
width: 100%;
align-items: center;
}
.list-item:hover {
background: #feffff87;
cursor: pointer;
}
"""

pn.config.raw_css.append(item_style)
Expand Down Expand Up @@ -262,7 +286,7 @@ def get_services_component(username):
)
service_button_code = f"window.location.href = '/services/japps/create-service'"
create_service_button.js_on_click(code=service_button_code)
services_grid = pn.GridBox(*service_items, ncols=7)
services_grid = pn.GridBox(*service_items, ncols=7, sizing_mode="stretch_width")
return create_service_button, services_grid


Expand All @@ -271,6 +295,7 @@ def heading_markdown(heading):
f"""
<style>
.custom-background {{
padding: 0px 6px;
background-color: lightblue;
font-family: Mukta, sans-serif;
}}
Expand All @@ -282,7 +307,8 @@ def heading_markdown(heading):
</div>
""",
sizing_mode="stretch_width"
margin=0,
sizing_mode="stretch_width",
)


Expand Down

0 comments on commit aecf686

Please sign in to comment.