Spaces:
Running
Running
Create about.py
#5
by
KhaqanNasir
- opened
- src/about.py +135 -0
src/about.py
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import os # Missing import added
|
| 3 |
+
|
| 4 |
+
# Set page configuration
|
| 5 |
+
st.set_page_config(
|
| 6 |
+
page_title="About Us | AI News Generator",
|
| 7 |
+
page_icon="π",
|
| 8 |
+
layout="wide",
|
| 9 |
+
initial_sidebar_state="collapsed"
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
# Main Function
|
| 13 |
+
def main():
|
| 14 |
+
# Apply Poppins font across the app
|
| 15 |
+
st.markdown("""
|
| 16 |
+
<style>
|
| 17 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
|
| 18 |
+
html, body, [class*="css"], * {
|
| 19 |
+
font-family: 'Poppins', sans-serif;
|
| 20 |
+
}
|
| 21 |
+
</style>
|
| 22 |
+
""", unsafe_allow_html=True)
|
| 23 |
+
|
| 24 |
+
# Add Font Awesome CDN for icons
|
| 25 |
+
st.markdown("""
|
| 26 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
| 27 |
+
""", unsafe_allow_html=True)
|
| 28 |
+
|
| 29 |
+
# Title Section
|
| 30 |
+
st.markdown("<h1 style='font-size: 60px; text-align: center;'>About Us</h1>", unsafe_allow_html=True)
|
| 31 |
+
st.markdown("<p style='font-size: 20px; text-align: center; color: gray;'>Learn more about the vision, mission, and team behind the AI News Generator. ππ°</p>", unsafe_allow_html=True)
|
| 32 |
+
|
| 33 |
+
# Section 1: Our Vision
|
| 34 |
+
st.markdown("<h2 style='font-size: 30px;'>π Our Vision</h2>", unsafe_allow_html=True)
|
| 35 |
+
st.write("""
|
| 36 |
+
At **AI News Generator**, we aim to revolutionize the way news is created and consumed.
|
| 37 |
+
By leveraging cutting-edge **Generative AI**, we aspire to provide **reliable, real-time, and personalized news content** that empowers individuals and organizations worldwide.
|
| 38 |
+
We envision a world where technology enhances the accessibility and quality of information for everyone.
|
| 39 |
+
""")
|
| 40 |
+
|
| 41 |
+
# Section 2: Our Mission
|
| 42 |
+
st.markdown("---")
|
| 43 |
+
st.markdown("<h2 style='font-size: 30px;'>π Our Mission</h2>", unsafe_allow_html=True)
|
| 44 |
+
st.write("""
|
| 45 |
+
Our mission is simple: to deliver **AI-powered solutions** that make news creation faster, smarter, and more efficient.
|
| 46 |
+
We believe in innovation, creativity, and the potential of AI to transform industries. Whether you're a journalist, an organization, or just someone seeking personalized content,
|
| 47 |
+
**AI News Generator** is here to serve your needs with **accuracy, diversity, and creativity**.
|
| 48 |
+
""")
|
| 49 |
+
|
| 50 |
+
# Team Section
|
| 51 |
+
st.header("Meet the Team")
|
| 52 |
+
team_members = [
|
| 53 |
+
{
|
| 54 |
+
"name": "Muhammad Khaqan Nasir",
|
| 55 |
+
"github": "KhaqanNasir",
|
| 56 |
+
"linkedin": "khaqan-nasir",
|
| 57 |
+
"image": os.path.join(os.path.dirname(__file__), 'assets', 'member01.jpg')
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"name": "Muhammad Adnan Tariq",
|
| 61 |
+
"github": "adnaan-tariq",
|
| 62 |
+
"linkedin": "adnaantariq",
|
| 63 |
+
"image": os.path.join(os.path.dirname(__file__), 'assets', 'member02.JPG')
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"name": "Muhammad Ibtisiam Afzal",
|
| 67 |
+
"github": "ibtisamafzal",
|
| 68 |
+
"linkedin": "ibtisamafzal",
|
| 69 |
+
"image": os.path.join(os.path.dirname(__file__), 'assets', 'member03.JPG')
|
| 70 |
+
}
|
| 71 |
+
]
|
| 72 |
+
|
| 73 |
+
cols = st.columns(len(team_members))
|
| 74 |
+
for col, member in zip(cols, team_members):
|
| 75 |
+
with col:
|
| 76 |
+
# Encode image to base64
|
| 77 |
+
encoded_image = encode_image(member['image'])
|
| 78 |
+
|
| 79 |
+
# HTML structure with background color and adjusted image height
|
| 80 |
+
st.markdown(f"""
|
| 81 |
+
<div style='background-color: #f8f9fa; border-radius: 10px; padding: 20px; margin-bottom: 20px; text-align: center;'>
|
| 82 |
+
<div style='background-color: #ffffff; border-radius: 50%; width: 200px; height: 200px; margin: 0 auto; display: flex; justify-content: center; align-items: center;'>
|
| 83 |
+
<img src="data:image/jpeg;base64,{encoded_image}" alt="{member['name']}" style='width: 100%; height: 100%; object-fit: cover; border-radius: 50%;'>
|
| 84 |
+
</div>
|
| 85 |
+
<div style='font-size: 22px; font-weight: 600; color: #5F6366; margin-top: 10px;'>{member['name']}</div>
|
| 86 |
+
<div style='font-size: 18px; color: #5F6366; margin-top: 5px;'>
|
| 87 |
+
<a href='https://github.com/{member["github"]}' target='_blank' style='font-size: 20px; color: #000000; margin-right: 10px;'>
|
| 88 |
+
<i class="fab fa-github" style="font-size: 20px; color: #000000; margin-right: 5px;"></i> GitHub
|
| 89 |
+
</a>
|
| 90 |
+
<a href='https://linkedin.com/in/{member["linkedin"]}' target='_blank' style='font-size: 20px; color: #0077B5;'>
|
| 91 |
+
<i class="fab fa-linkedin" style="font-size: 20px; color: #0077B5; margin-right: 5px;"></i> LinkedIn
|
| 92 |
+
</a>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
""", unsafe_allow_html=True)
|
| 96 |
+
|
| 97 |
+
# Section 4: Technology Stack
|
| 98 |
+
st.markdown("---")
|
| 99 |
+
st.markdown("<h2 style='font-size: 30px;'>π οΈ Technology Stack</h2>", unsafe_allow_html=True)
|
| 100 |
+
st.write("""
|
| 101 |
+
Our app uses cutting-edge **Generative AI models** combined with open-source tools to ensure high-quality performance.
|
| 102 |
+
Below are some key technologies that power **AI News Generator**:
|
| 103 |
+
- **Streamlit**: For building the user interface.
|
| 104 |
+
- **Natural Language Processing (NLP)**: For generating accurate and readable news content.
|
| 105 |
+
- **Free APIs and Open-Source Models**: To make the app cost-efficient and widely accessible.
|
| 106 |
+
- **Python Libraries**: For seamless backend integration and feature enhancement.
|
| 107 |
+
""")
|
| 108 |
+
|
| 109 |
+
# Section 5: Why Choose Us?
|
| 110 |
+
st.markdown("---")
|
| 111 |
+
st.markdown("<h2 style='font-size: 30px;'>π‘ Why Choose Us?</h2>", unsafe_allow_html=True)
|
| 112 |
+
st.write("""
|
| 113 |
+
- **Free and Accessible**: We use free resources to ensure accessibility for all users.
|
| 114 |
+
- **Real-Time News**: Generate fresh, personalized news in seconds.
|
| 115 |
+
- **Innovative AI**: Powered by state-of-the-art generative AI.
|
| 116 |
+
- **User-Centric Design**: Intuitive and simple to use for anyone.
|
| 117 |
+
""")
|
| 118 |
+
|
| 119 |
+
# Footer
|
| 120 |
+
st.markdown("---")
|
| 121 |
+
st.markdown(
|
| 122 |
+
'<p style="text-align: center; font-weight: 600; font-size: 16px;">π» Developed with β€οΈ using Streamlit | Β© 2024</p>',
|
| 123 |
+
unsafe_allow_html=True
|
| 124 |
+
)
|
| 125 |
+
st.sidebar.success("Select a page above.")
|
| 126 |
+
|
| 127 |
+
# Function to encode image to base64
|
| 128 |
+
def encode_image(image_path):
|
| 129 |
+
with open(image_path, "rb") as image_file:
|
| 130 |
+
import base64
|
| 131 |
+
return base64.b64encode(image_file.read()).decode("utf-8")
|
| 132 |
+
|
| 133 |
+
# Run the app
|
| 134 |
+
if __name__ == "__main__":
|
| 135 |
+
main()
|