Spaces:
Running
Running
File size: 5,931 Bytes
60a7d61 149bf7a 60a7d61 7a2f04c 60a7d61 7a2f04c 60a7d61 7a2f04c 60a7d61 |
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 164 165 166 |
import gradio as gr
# Avatar video files
avatars = {
"Shiva": "shiva final.mp4",
"Hanuman": "hanuman final.mp4",
"Lakshmi": "lakshmi final.mp4",
"Shri hari": "Shri hari final.mp4",
"Shri Krishna": "Shri Krishna final.mp4",
"Venkateshwara": "venkateshwara final.mp4",
"Saraswati": "saraswati final.mp4"
}
# Function → returns video file + makes it visible
def show_avatar(name):
return gr.update(value=avatars[name], visible=True)
# Custom CSS
css_code = """
.gradio-container {
background-image: url('https://i.pinimg.com/originals/d0/cd/58/d0cd58dd4fcfaa1e4cf6c6dfdb1ab0b2.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
border-radius: 0; /* no rounded edges */
padding: 40px;
width: 100%; /* full width */
max-width: none !important;/* remove limit */
margin: 0; /* no side margin */
}
body {
background: transparent !important;
margin: 0;
padding: 0;
font-family: 'Segoe UI', sans-serif;
color: white;
}
.intro-text {
color: white;
font-size: 1.2em;
max-width: 900px;
margin: 40px auto 20px auto;
line-height: 1.5em;
text-align: center;
text-shadow: 0 0 10px #ffd700, 0 0 20px #ffcc00;
}
.avatar-button {
background-color: #FFD700;
color: black;
font-weight: bold;
border-radius: 10px;
margin: 5px;
padding: 12px 24px;
box-shadow: 0 0 10px #FFD700;
transition: transform 0.3s ease;
cursor: pointer;
}
.avatar-button:hover {
transform: scale(1.05);
}
.notice-box {
background: linear-gradient(135deg, #fff5cc, #ffeb99, #fff5cc);
padding: 15px 25px;
border-radius: 12px;
color: black;
font-size: 1.1em;
font-weight: bold;
text-align: center;
margin: 30px auto;
max-width: 600px;
box-shadow: 0 0 15px rgba(255, 223, 100, 0.8);
animation: glow 2s infinite alternate;
}
@keyframes glow {
from { box-shadow: 0 0 10px rgba(255, 223, 100, 0.6); }
to { box-shadow: 0 0 25px rgba(255, 239, 180, 1); }
}
.title-box {
background: linear-gradient(135deg, #ffd700, #fff8dc, #ffec8b);
padding: 18px 25px;
border-radius: 12px;
color: #4b2e00;
font-size: 1.6em;
font-weight: bold;
text-align: center;
margin: 20px auto;
max-width: 700px;
box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
animation: goldenpulse 3s infinite alternate;
}
@keyframes goldenpulse {
from { box-shadow: 0 0 10px rgba(255, 223, 100, 0.6); }
to { box-shadow: 0 0 25px rgba(255, 239, 180, 1); }
}
"""
# Build UI
with gr.Blocks(css=css_code) as demo:
gr.HTML("""
<div class="title-box">
👑 Avatarverse 👑
<br>
🪷 Divine Wisdom Meets Immersive Technology 🌺
</div>
<p class="intro-text">
Hey everyone! I’m <strong>Sreelekha</strong>. After watching the Mahavatra Narasimha movie, I got hooked on animations and divine storytelling.<br><br>
Then I thought—why not mix mythology with tech? Imagine Krishna trying AR, Shiva exploring VR, and Saraswati checking my coding skills at 3 AM!<br><br>
Everyone dreams at 3 AM—some about cars, space, or careers. Me? I dreamt of avatars teaching AR and VR in style.<br><br>
So here’s your chance to see our divine friends step into the tech world and share their wisdom… with a twist of magic and a splash of tech!
</p>
<div class="notice-box">✨Double Click an avatar to see the avatar speaking video!✨</div>
<hr style="margin:40px 0; border:1px solid #FFD700;" />
""")
# Initially hidden video display
video_display = gr.Video(visible=False)
# Avatar buttons
with gr.Row():
for name in avatars.keys():
gr.Button(value=name, elem_classes=["avatar-button"]).click(
fn=show_avatar,
inputs=gr.Textbox(value=name, visible=False),
outputs=video_display
)
# 🔗 Links Section
gr.HTML("""
<div style="text-align:center; margin-top:50px;">
<p style="color:white; font-size:1.2em; text-shadow:0 0 10px #ffd700;">
🌟 Ready to explore more? Choose your path below 🌟
</p>
<div style="margin:20px 0;">
<a href="https://huggingface.co/spaces/sreelekhaputta2/VRAssist" target="_blank"
style="background:#FFD700; color:black; font-weight:bold; padding:12px 24px;
border-radius:10px; text-decoration:none; box-shadow:0 0 10px #FFD700; display:inline-block; margin:10px;">
🤖 Ask the VRAssist (Chatbot)
</a>
<a href="https://huggingface.co/spaces/sreelekhaputta2/quiz" target="_blank"
style="background:#FFD700; color:black; font-weight:bold; padding:12px 24px;
border-radius:10px; text-decoration:none; box-shadow:0 0 10px #FFD700; display:inline-block; margin:10px;">
📝 Take the AR/VR Quiz
</a>
<a href="https://huggingface.co/spaces/sreelekhaputta2/Learning" target="_blank"
style="background:#FFD700; color:black; font-weight:bold; padding:12px 24px;
border-radius:10px; text-decoration:none; box-shadow:0 0 10px #FFD700; display:inline-block; margin:10px;">
📚 Visit Learning Portal
</a>
</div>
</div>
""")
# 🔚 Credits Section (INSERT HERE)
gr.HTML("""
<div style="text-align:center; margin-top:60px; padding:20px;
background:rgba(0,0,0,0.6); border-radius:12px;
color:white; font-size:1em; text-shadow:0 0 8px #FFD700;">
✨ Created with ❤️ by <strong>Sreelekha</strong><br>
🎨 Design and Animations | 💻 AR/VR Tech | 📽️ Avatarverse Project
</div>
""")
demo.launch()
|