arjunmahlawat's picture
Upload 2 files
c5216da verified
# -*- coding: utf-8 -*-
"""
Fancy Addition Calculator with Sidebar and Animations
Created on Sat Jul 12 10:49:24 2025
@author: somil
"""
import streamlit as st
import time
# Page Config
st.set_page_config(page_title="Addition Calculator", page_icon="βž•", layout="centered")
# Sidebar for input
st.sidebar.header("Enter Numbers Here")
number1 = st.sidebar.number_input("Enter Number 1", min_value=0, max_value=100, value=12)
number2 = st.sidebar.number_input("Enter Number 2", min_value=0, max_value=100, value=12)
# Main title and animation
st.markdown("<h1 style='text-align: center;'>✨ Basic Addition Calculator ✨</h1>", unsafe_allow_html=True)
st.markdown("<h3 style='text-align: center;'>Let’s crunch some numbers βž•βž•</h3>", unsafe_allow_html=True)
# Animation for effect
with st.spinner("Calculating... 🧠"):
time.sleep(1) # Simple delay for effect
# Result
result = number1 + number2
st.success(f"πŸŽ‰ The sum of **{number1}** and **{number2}** is: **{result}**")
# Footer message
st.markdown("---")
st.markdown("<p style='text-align: center;'>🌟 Hope you have a <b>nice</b> day! 🌈</p>", unsafe_allow_html=True)