update guide col
Browse files- src/app.py +10 -1
- src/components/header.py +34 -28
- src/core/styles.py +7 -9
src/app.py
CHANGED
|
@@ -88,7 +88,16 @@ async def main():
|
|
| 88 |
) = get_filter_values(df)
|
| 89 |
|
| 90 |
# Create main layout with sidebar for contribution guide
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
with main_col:
|
| 94 |
# Render filters
|
|
|
|
| 88 |
) = get_filter_values(df)
|
| 89 |
|
| 90 |
# Create main layout with sidebar for contribution guide
|
| 91 |
+
# Adjust column ratio based on guide visibility
|
| 92 |
+
if "show_guide" not in st.session_state:
|
| 93 |
+
st.session_state.show_guide = True
|
| 94 |
+
|
| 95 |
+
main_col, guide_col = st.columns(
|
| 96 |
+
[
|
| 97 |
+
0.9 if not st.session_state.show_guide else 0.8,
|
| 98 |
+
0.1 if not st.session_state.show_guide else 0.2,
|
| 99 |
+
]
|
| 100 |
+
)
|
| 101 |
|
| 102 |
with main_col:
|
| 103 |
# Render filters
|
src/components/header.py
CHANGED
|
@@ -36,34 +36,32 @@ def render_contribution_guide():
|
|
| 36 |
"""
|
| 37 |
)
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
)
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
if appstore_badge.exists():
|
| 58 |
-
st.markdown(
|
| 59 |
-
f'<a href="https://apps.apple.com/de/app/pocketpal-ai/id6502579498" target="_blank">'
|
| 60 |
-
f'<img src="data:image/svg+xml;base64,{get_image_base64(appstore_badge)}" '
|
| 61 |
-
'class="store-badge" alt="Download on the App Store">'
|
| 62 |
-
"</a>",
|
| 63 |
-
unsafe_allow_html=True,
|
| 64 |
)
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
# Quick steps
|
| 69 |
st.markdown(
|
|
@@ -89,7 +87,7 @@ def render_contribution_guide():
|
|
| 89 |
|
| 90 |
else:
|
| 91 |
# Show restore button when guide is dismissed
|
| 92 |
-
if st.button("
|
| 93 |
st.session_state.show_guide = True
|
| 94 |
st.rerun()
|
| 95 |
|
|
@@ -100,7 +98,15 @@ def render_header():
|
|
| 100 |
pocketpal_logo_path = Path("src/static/images/pocketpal-ai-logo.png")
|
| 101 |
|
| 102 |
# Create header columns with the same ratio as main content
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
with header_main:
|
| 106 |
header_html = f"""
|
|
|
|
| 36 |
"""
|
| 37 |
)
|
| 38 |
|
| 39 |
+
col1, col2 = st.columns([0.5, 0.5])
|
| 40 |
+
with col1:
|
| 41 |
+
# Google Play badge
|
| 42 |
+
playstore_badge = Path("src/static/images/GetItOnGooglePlay_Badge.png")
|
| 43 |
+
if playstore_badge.exists():
|
| 44 |
+
st.markdown(
|
| 45 |
+
f'<a href="https://play.google.com/store/apps/details?id=com.pocketpalai" target="_blank">'
|
| 46 |
+
f'<img src="data:image/png;base64,{get_image_base64(playstore_badge)}" '
|
| 47 |
+
'class="store-badge" alt="Get it on Google Play">'
|
| 48 |
+
"</a>",
|
| 49 |
+
unsafe_allow_html=True,
|
| 50 |
+
)
|
|
|
|
| 51 |
|
| 52 |
+
with col2:
|
| 53 |
+
# App Store badge
|
| 54 |
+
appstore_badge = Path(
|
| 55 |
+
"src/static/images/Download_on_the_App_Store_Badge.svg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
)
|
| 57 |
+
if appstore_badge.exists():
|
| 58 |
+
st.markdown(
|
| 59 |
+
f'<a href="https://apps.apple.com/de/app/pocketpal-ai/id6502579498" target="_blank">'
|
| 60 |
+
f'<img src="data:image/svg+xml;base64,{get_image_base64(appstore_badge)}" '
|
| 61 |
+
'class="store-badge" alt="Download on the App Store">'
|
| 62 |
+
"</a>",
|
| 63 |
+
unsafe_allow_html=True,
|
| 64 |
+
)
|
| 65 |
|
| 66 |
# Quick steps
|
| 67 |
st.markdown(
|
|
|
|
| 87 |
|
| 88 |
else:
|
| 89 |
# Show restore button when guide is dismissed
|
| 90 |
+
if st.button("Guide", help="Show contribution guide"):
|
| 91 |
st.session_state.show_guide = True
|
| 92 |
st.rerun()
|
| 93 |
|
|
|
|
| 98 |
pocketpal_logo_path = Path("src/static/images/pocketpal-ai-logo.png")
|
| 99 |
|
| 100 |
# Create header columns with the same ratio as main content
|
| 101 |
+
if "show_guide" not in st.session_state:
|
| 102 |
+
st.session_state.show_guide = True
|
| 103 |
+
|
| 104 |
+
header_main, header_side = st.columns(
|
| 105 |
+
[
|
| 106 |
+
0.9 if not st.session_state.show_guide else 0.8,
|
| 107 |
+
0.1 if not st.session_state.show_guide else 0.2,
|
| 108 |
+
]
|
| 109 |
+
)
|
| 110 |
|
| 111 |
with header_main:
|
| 112 |
header_html = f"""
|
src/core/styles.py
CHANGED
|
@@ -84,28 +84,26 @@ CUSTOM_CSS = """
|
|
| 84 |
color: #666;
|
| 85 |
margin: 0.5rem 0;
|
| 86 |
}
|
| 87 |
-
/* Dismiss button styling */
|
| 88 |
div[data-testid="column"]:last-child button {
|
| 89 |
float: right;
|
| 90 |
background: transparent;
|
| 91 |
border: none;
|
| 92 |
color: #666;
|
| 93 |
padding: 0.2rem 0.4rem;
|
| 94 |
-
font-size:
|
| 95 |
line-height: 1;
|
| 96 |
transition: all 0.2s;
|
|
|
|
|
|
|
|
|
|
| 97 |
}
|
| 98 |
div[data-testid="column"]:last-child button:hover {
|
| 99 |
color: #333;
|
|
|
|
|
|
|
| 100 |
}
|
| 101 |
/* Store badges styling */
|
| 102 |
-
.store-badges-row {
|
| 103 |
-
display: flex;
|
| 104 |
-
justify-content: center;
|
| 105 |
-
gap: 10px;
|
| 106 |
-
margin: 10px 0;
|
| 107 |
-
flex-wrap: wrap;
|
| 108 |
-
}
|
| 109 |
.store-badge {
|
| 110 |
height: 35px;
|
| 111 |
transition: transform 0.2s;
|
|
|
|
| 84 |
color: #666;
|
| 85 |
margin: 0.5rem 0;
|
| 86 |
}
|
| 87 |
+
/* Show/Dismiss button styling */
|
| 88 |
div[data-testid="column"]:last-child button {
|
| 89 |
float: right;
|
| 90 |
background: transparent;
|
| 91 |
border: none;
|
| 92 |
color: #666;
|
| 93 |
padding: 0.2rem 0.4rem;
|
| 94 |
+
font-size: 0.9rem;
|
| 95 |
line-height: 1;
|
| 96 |
transition: all 0.2s;
|
| 97 |
+
width: 100%;
|
| 98 |
+
text-align: center;
|
| 99 |
+
margin-top: 0.5rem;
|
| 100 |
}
|
| 101 |
div[data-testid="column"]:last-child button:hover {
|
| 102 |
color: #333;
|
| 103 |
+
background-color: #f0f0f0;
|
| 104 |
+
border-radius: 4px;
|
| 105 |
}
|
| 106 |
/* Store badges styling */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
.store-badge {
|
| 108 |
height: 35px;
|
| 109 |
transition: transform 0.2s;
|