Spaces:
Build error
Build error
File size: 5,633 Bytes
474f2fa ac5a11a 9d8c8c0 474f2fa 25d8034 9d8c8c0 474f2fa 9d8c8c0 0f6f418 9d8c8c0 0f6f418 25d8034 0f6f418 25d8034 0f6f418 25d8034 0f6f418 aabe7d6 9d8c8c0 aabe7d6 25d8034 aabe7d6 25d8034 912b102 c981b30 14f2365 25d8034 9d8c8c0 25d8034 13b126d 9d8c8c0 0f6f418 aabe7d6 14f2365 9d8c8c0 0f6f418 9d8c8c0 0f6f418 25d8034 9d8c8c0 25d8034 9d8c8c0 aabe7d6 9d8c8c0 14f2365 0f6f418 733c75a 14f2365 0f6f418 9d8c8c0 25d8034 9d8c8c0 25d8034 9d8c8c0 25d8034 9d8c8c0 25d8034 4e72d1b 9d8c8c0 0f6f418 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | import streamlit as st
from PIL import Image
import os
# Set page configuration
st.set_page_config(
page_title="Fighter Aircraft Information",
page_icon="✈️",
layout="wide"
)
# Aircraft Data Dictionary
aircraft_data = {
"F-16": {
"Aircraft Name": "General Dynamics F-16 Fighting Falcon",
"Image URL": "f16.jpeg",
"Origin": "United States",
"Manufacturer": "Lockheed Martin",
"First Flight": 1974,
"Introduction": 1979,
"Role": "Multirole fighter",
"Variants": "A, B, C, D, E, F",
"Crew": 1,
"Length (m)": 15.03,
"Wingspan (m)": 9.96,
"Height (m)": 5.09,
"Max Speed (km/h)": 2414,
"Range (km)": 3400,
"Service Ceiling (m)": 15240,
"Description": "The F-16 is a versatile multirole fighter known for its agility and combat effectiveness."
},
"F-35": {
"Aircraft Name": "Lockheed Martin F-35 Lightning II",
"Image URL": "f35.jpg",
"Origin": "United States",
"Manufacturer": "Lockheed Martin",
"First Flight": 2006,
"Introduction": 2015,
"Role": "Stealth multirole fighter",
"Variants": "F-35A, F-35B, F-35C",
"Crew": 1,
"Length (m)": 15.67,
"Wingspan (m)": 10.7,
"Height (m)": 4.33,
"Max Speed (km/h)": 1930,
"Range (km)": 2220,
"Service Ceiling (m)": 18288,
"Description": "A fifth-generation stealth fighter designed for air superiority and electronic warfare."
},
"F-22": {
"Aircraft Name": "Lockheed Martin F-22 Raptor",
"Image URL": "f22.jpg",
"Origin": "United States",
"Manufacturer": "Lockheed Martin",
"First Flight": 1997,
"Introduction": 2005,
"Role": "Stealth air superiority fighter",
"Variants": "F-22A",
"Crew": 1,
"Length (m)": 18.92,
"Wingspan (m)": 13.56,
"Height (m)": 5.08,
"Max Speed (km/h)": 2414,
"Range (km)": 2900,
"Service Ceiling (m)": 20000,
"Description": "The F-22 Raptor is a stealth fighter known for its maneuverability, speed, and air dominance capabilities."
},
"F-15": {
"Aircraft Name": "McDonnell Douglas F-15 Eagle",
"Image URL": "f15.jpeg",
"Origin": "United States",
"Manufacturer": "McDonnell Douglas (now Boeing)",
"First Flight": 1972,
"Introduction": 1976,
"Role": "Air superiority fighter",
"Variants": "F-15A, F-15B, F-15C, F-15D, F-15E",
"Crew": "1 (F-15C/E), 2 (F-15B/D)",
"Length (m)": 19.43,
"Wingspan (m)": 13.05,
"Height (m)": 5.63,
"Max Speed (km/h)": 3000,
"Range (km)": 4445,
"Service Ceiling (m)": 18000,
"Description": "The F-15 Eagle is an all-weather tactical fighter designed for air superiority."
},
"JF-17": {
"Aircraft Name": "PAC JF-17 Thunder",
"Image URL": "jf17.jpeg",
"Origin": "Pakistan/China",
"Manufacturer": "PAC / CAC",
"First Flight": 2003,
"Introduction": 2007,
"Role": "Multirole fighter",
"Variants": "Block 1, Block 2, Block 3",
"Crew": 1,
"Length (m)": 14.3,
"Wingspan (m)": 9.92,
"Height (m)": 4.77,
"Max Speed (km/h)": 1900,
"Range (km)": 2000,
"Service Ceiling (m)": 16764,
"Description": "The JF-17 Thunder is a lightweight, multirole fighter developed by Pakistan and China."
},
"J-20": {
"Aircraft Name": "Chengdu J-20 Mighty Dragon",
"Image URL": "j20.jpeg",
"Origin": "China",
"Manufacturer": "Chengdu Aerospace Corporation",
"First Flight": 2011,
"Introduction": 2017,
"Role": "Stealth air superiority fighter",
"Variants": "J-20A, J-20B",
"Crew": 1,
"Length (m)": 20.4,
"Wingspan (m)": 13.5,
"Height (m)": 4.45,
"Max Speed (km/h)": 2223,
"Range (km)": 5500,
"Service Ceiling (m)": 20000,
"Description": "The J-20 Mighty Dragon is China's advanced stealth fighter designed for long-range operations."
}
}
# Sidebar for Aircraft Selection
st.sidebar.header("Select an Aircraft")
selected_aircraft = st.sidebar.selectbox("Choose an aircraft:", list(aircraft_data.keys()))
# Display Aircraft Information
if selected_aircraft:
aircraft_info = aircraft_data[selected_aircraft]
st.header(aircraft_info["Aircraft Name"])
# Image Handling
image_path = aircraft_info["Image URL"]
default_image = "placeholder.jpg"
try:
img = Image.open(image_path) if os.path.exists(image_path) else Image.open(default_image)
except Exception:
img = Image.open(default_image)
col1, col2 = st.columns([1, 2])
with col1:
st.image(img, use_container_width=True, caption=aircraft_info["Aircraft Name"])
with col2:
st.subheader("General Information")
for key in ["Origin", "Manufacturer", "First Flight", "Introduction", "Role", "Variants", "Crew"]:
st.write(f"**{key}:** {aircraft_info[key]}")
st.subheader("🔹 Performance Specifications")
cols = st.columns(3)
specs = ["Length (m)", "Wingspan (m)", "Height (m)", "Max Speed (km/h)", "Range (km)", "Service Ceiling (m)"]
for idx, col in enumerate(cols):
with col:
for key in specs[idx::3]:
st.metric(label=key, value=aircraft_info[key])
with st.expander("ℹ️ More Information"):
st.write(aircraft_info["Description"]) |