.
CSS @keyframes Flicker · Bronze SVG linearGradient · Radial Flame Glow · feDropShadow Filter · Bezier Flame Path · Gold Decoration · Zero JavaScript · Fully Scalable Vector
The Coodeverse Realistic Temple Lamp SVG 2025 is a free traditional Indian diya built with pure SVG and CSS — zero JavaScript. Features a metallic bronze linearGradient with 4 stops for 3D depth, radialGradient inner flame with white-yellow core to transparent red edge, radialGradient outer ambient glow, SVG feDropShadow filter for soft object shadows, CSS @keyframes flicker at 1.3s ease-in-out animating opacity 1→0.75 for realistic flame movement, quadratic bezier path flame silhouette, CSS filter:drop-shadow on the full SVG for warm orange ambient glow, gold decorative #d4af37 stripes and dots, and full SVG accessibility with role="img" and aria-labelledby. Infinitely scalable. 100% free.
Pure SVG + CSS — zero JavaScript, zero libraries, zero dependencies. Teaches: CSS @keyframes flicker animation, SVG linearGradient metallic rendering, SVG radialGradient glow effects, SVG feDropShadow filters, quadratic bezier flame path, and CSS filter:drop-shadow. The most technically rich SVG project available for free.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Realistic Temple Lamp SVG – Diwali Diya | Coodeverse</title>
<style>
* { margin:0; padding:0; box-sizing:border-box; }
body {
background:linear-gradient(135deg, #222 30%, #1a1a1a 70%);
display:flex; justify-content:center; align-items:center;
height:100vh; margin:0;
}
/* CSS filter:drop-shadow on the SVG element traces the actual alpha channel
of all SVG paths — not a rectangular bounding box like box-shadow.
This creates a warm orange ambient halo that perfectly follows the lamp shape. */
svg {
filter:drop-shadow(0 0 10px rgba(255,140,0,0.9));
}
/* ── FLICKER ANIMATION ──────────────────────────────────────
Opacity alternates between 1.0 (fully visible) and 0.75 (25% dimmed).
1.3s duration is irregular enough to feel organic — not a round number.
ease-in-out: slow at start/end, fast in middle = natural breathing rhythm.
infinite: loops forever.
The 25% opacity reduction is subtle enough not to distract but
visible enough to read as a real flame movement. */
@keyframes flicker {
0%, 100% { opacity:1; }
50% { opacity:0.75; }
}
/* Flame glow elements — fast flicker at 1.3s */
.flame-glow {
animation:flicker 1.3s infinite ease-in-out;
}
/* Metallic shine elements — slow shimmer at 2s with alternate direction.
alternate: reverses the keyframes on every other cycle (0→1, then 1→0)
creating a smooth back-and-forth breathing effect instead of a repeated reset. */
.shine {
animation:flicker 2s infinite ease-in-out alternate;
}
</style>
</head>
<body>
<!-- SVG with accessibility: role=img + aria-labelledby + <title> child element.
This makes the SVG behave like <img alt="..."> for screen readers. -->
<svg
width="220"
height="320"
viewBox="0 0 150 250"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-labelledby="lampTitle"
>
<title id="lampTitle">Realistic traditional Indian temple oil lamp (diya) with flickering flame</title>
<defs>
<!-- BRONZE METAL GRADIENT — 4 stops simulate curved 3D metallic surface.
Light bronze at top (#b85c1b) gradually darkens to near-black (#3a1f05).
The 4-stop progression (not 2) creates a smoother, more realistic metal look.
x1=0 y1=0 x2=0 y2=1 = vertical gradient (top-to-bottom in objectBoundingBox). -->
<linearGradient id="metalGradient" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#b85c1b"/> <!-- light copper top -->
<stop offset="40%" stop-color="#8c4e13"/> <!-- medium bronze -->
<stop offset="70%" stop-color="#593210"/> <!-- dark brown -->
<stop offset="100%" stop-color="#3a1f05"/> <!-- near-black base -->
</linearGradient>
<!-- INNER FLAME GRADIENT — hot white core fading to transparent red edge.
cy=60% (not 50%) places the brightest point toward the base of the flame
where the wick meets the oil — physically accurate.
stop-opacity="0" at edge creates natural fade-out without hard boundary. -->
<radialGradient id="innerFlame" cx="50%" cy="60%" r="40%">
<stop offset="0%" stop-color="#fff59e" stop-opacity="1"/> <!-- white-yellow hot core -->
<stop offset="70%" stop-color="#ff6f00" stop-opacity="0.75"/> <!-- deep orange -->
<stop offset="100%" stop-color="#ff3d00" stop-opacity="0"/> <!-- transparent red edge -->
</radialGradient>
<!-- OUTER GLOW GRADIENT — large diffuse amber halo around the flame.
r=80% makes it a wide halo. Fades fully to transparent at edge.
This layer gives the impression of light radiating from the flame
onto the surrounding air. -->
<radialGradient id="outerGlow" cx="50%" cy="50%" r="80%">
<stop offset="0%" stop-color="#ffbd45" stop-opacity="0.7"/>
<stop offset="100%" stop-color="#ff4900" stop-opacity="0"/>
</radialGradient>
<!-- SPECULAR SHINE — off-center highlight at cx=40% cy=40% simulates
ambient light from upper-left hitting a curved metal surface.
Light gold at center (#f6e27f) fades to transparent bronze at edge.
Applied at low opacity (0.3) so it subtly highlights without washing out. -->
<radialGradient id="shine" cx="40%" cy="40%" r="60%">
<stop offset="0%" stop-color="#f6e27f" stop-opacity="0.85"/>
<stop offset="100%" stop-color="#a65d06" stop-opacity="0"/>
</radialGradient>
<!-- SVG FILTER: SOFT DROP SHADOW
feDropShadow is the SVG equivalent of CSS box-shadow.
dx=0 dy=3: shadow falls straight down, no horizontal offset.
stdDeviation=3: blur radius — higher = softer/larger shadow.
flood-color + flood-opacity: shadow color and transparency.
x/y/width/height on <filter> extend the filter region to prevent clipping. -->
<filter id="softShadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="3" stdDeviation="3" flood-color="#000" flood-opacity="0.5"/>
</filter>
</defs>
<!-- ══ BASE PLATE ══════════════════════════════════════════════
Bottom ellipse = the base the lamp stands on.
Three layers: metalGradient ellipse → soft shadow,
shine ellipse (animated shimmer), dark overlay (adds depth). -->
<ellipse cx="75" cy="235" rx="55" ry="18"
fill="url(#metalGradient)" filter="url(#softShadow)"/>
<ellipse cx="75" cy="230" rx="40" ry="13"
fill="url(#shine)" class="shine"/>
<ellipse cx="75" cy="230" rx="45" ry="15"
fill="#8a4b0c" opacity="0.92"/>
<!-- ══ VERTICAL STAND ══════════════════════════════════════════
Rounded rectangle for the pole (rx/ry=7 for rounded corners).
Arch path at top (quadratic bezier) transitions stand to lamp holder.
Dark inner rect (opacity 0.6) creates concave depth illusion. -->
<rect x="65" y="85" width="20" height="135" rx="7" ry="7"
fill="url(#metalGradient)" filter="url(#softShadow)"/>
<path d="M65 85 Q75 65 85 85" fill="#a46127"/> <!-- arch -->
<rect x="67" y="88" width="16" height="130" rx="5" ry="5"
fill="#4b2607" opacity="0.6"/> <!-- inner concave shadow -->
<!-- ══ GOLD DECORATIVE STRIPES ═════════════════════════════════
Three horizontal gold lines at equal intervals along the stand.
stroke="#d4af37" is the standard hex code for metallic gold. -->
<line x1="73" y1="105" x2="77" y2="105" stroke="#d4af37" stroke-width="2"/>
<line x1="73" y1="135" x2="77" y2="135" stroke="#d4af37" stroke-width="2"/>
<line x1="73" y1="165" x2="77" y2="165" stroke="#d4af37" stroke-width="2"/>
<!-- ══ OIL LAMP HOLDER ════════════════════════════════════════
Wide flat ellipse = the oil-holding bowl at the top of the stand.
Three layers: metalGradient base, orange oil surface, animated shine. -->
<ellipse cx="75" cy="85" rx="48" ry="18" fill="url(#metalGradient)"/>
<ellipse cx="75" cy="80" rx="45" ry="14" fill="#ff8c00"/> <!-- oil surface -->
<ellipse cx="75" cy="80" rx="45" ry="14"
fill="url(#shine)" opacity="0.3" class="shine"/> <!-- animated specular -->
<!-- ══ FLAME: OUTER AMBIENT GLOW ═════════════════════════════
Large circle (r=32) filled with outerGlow radialGradient.
Animated with .flame-glow class for flickering. -->
<circle class="flame-glow" cx="75" cy="50" r="32" fill="url(#outerGlow)"/>
<!-- ══ FLAME: INNER CORE GLOW ════════════════════════════════
Smaller circle (r=20) with innerFlame gradient — the hot core. -->
<circle class="flame-glow" cx="75" cy="52" r="20" fill="url(#innerFlame)"/>
<!-- ══ FLAME: PHYSICAL SHAPE ══════════════════════════════════
Outer flame body — quadratic bezier teardrop:
M75 28: start at flame tip (top center)
Q68 65 75 80: control at 68,65 pulls left side outward, ends at base
Q82 65 75 28: control at 82,65 pulls right side outward, returns to tip
Z: close path
Asymmetric control points (68 left vs 82 right) = natural irregular flame. -->
<path d="M75 28 Q68 65 75 80 Q82 65 75 28 Z" fill="#ff6f00"/>
<!-- Inner bright core — narrower bezier path, near-white color -->
<path d="M75 42 Q70 60 74 75 Q76 60 75 42 Z" fill="#fff59e"/>
<!-- Flicker hot spot — tiny bright circle at wick base -->
<circle class="flame-glow" cx="75" cy="60" r="5" fill="#ffd54f" opacity="0.85"/>
<!-- ══ GOLD DECORATIVE DOTS ════════════════════════════════════
Three gold circles along the stand at the same positions as the stripes. -->
<circle cx="75" cy="115" r="3" fill="#ffd54f"/>
<circle cx="75" cy="145" r="3" fill="#ffd54f"/>
<circle cx="75" cy="175" r="3" fill="#ffd54f"/>
</svg>
</body>
</html>
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }. Apply: .flame-glow { animation: flicker 1.3s infinite ease-in-out; }. The ease-in-out timing feels natural — slow fade in and out. Use 1.3s (an irregular number, not a round 1s) to feel organic. For metallic shine, add alternate: animation: flicker 2s infinite ease-in-out alternate — this reverses keyframes on alternating cycles for smooth breathing shimmer. Stack multiple animated elements with different durations for layered irregularity that mimics real fire. Zero JavaScript required.
<defs>: <linearGradient id="metalGradient" x1="0" y1="0" x2="0" y2="1">. The x1=0 y1=0 x2=0 y2=1 creates a vertical top-to-bottom gradient. Add 4 stops for realistic depth: light copper at 0% (#b85c1b), medium bronze at 40% (#8c4e13), dark brown at 70% (#593210), near-black at 100% (#3a1f05). Four stops (not two) creates the non-linear progression that simulates real metal curvature. Reference: fill="url(#metalGradient)". Layer a radialGradient shine on top at opacity="0.3" for a specular highlight.
<radialGradient id="innerFlame" cx="50%" cy="60%" r="40%"> — cy=60% places the brightest point toward the base (physically accurate, flame is hottest near the wick). Stops: 0% white-yellow (#fff59e opacity 1), 70% deep orange (#ff6f00 opacity 0.75), 100% red (#ff3d00 opacity 0). Outer halo: <radialGradient id="outerGlow" cx="50%" cy="50%" r="80%"> — larger radius, amber to transparent. Apply to circles: outer r=32, inner r=20. Animate both with class="flame-glow" for CSS flicker.
<defs>: <filter id="softShadow" x="-20%" y="-20%" width="140%" height="140%"><feDropShadow dx="0" dy="3" stdDeviation="3" flood-color="#000" flood-opacity="0.5"/></filter>. Extend the filter region with x="-20%" etc. to prevent shadow clipping. dx=0 dy=3 creates a downward shadow. stdDeviation=3 controls blur softness. Apply: filter="url(#softShadow)". For whole-SVG ambient glow, use CSS instead: svg { filter: drop-shadow(0 0 10px rgba(255,140,0,0.9)); } — CSS drop-shadow traces alpha channel exactly, creating a glow that follows the lamp's organic outline.
Q cx cy x y where cx,cy is the control point and x,y is the endpoint. For a flame starting at the tip: M75 28 (move to tip), Q68 65 75 80 (left curve: control at 68,65 pulls the path outward to the left, endpoint at base center 75,80), Q82 65 75 28 (right curve: control at 82,65 pulls right, returning to tip), Z (close). The asymmetric control points (68 vs 82) make the flame lean slightly — more realistic than a perfect teardrop. Layer a narrower inner path filled with near-white for the bright core.
filter: drop-shadow() applies to the composite alpha of the entire SVG element — it traces the exact outline of all visible SVG paths combined. It's applied from CSS and cannot be reused on individual elements. SVG feDropShadow inside a <filter> element applies to individual SVG shapes via filter="url(#id)". It offers more control (separate dx, dy, stdDeviation, flood-color, flood-opacity attributes) and can be reused on multiple elements. For this diya: CSS drop-shadow is used for the whole-SVG warm orange ambient glow, while SVG feDropShadow is used for individual element shadows (base plate, stand) that need to cast downward.
CSS Flicker Animation · Bronze linearGradient · Radial Flame Glow · feDropShadow · Bezier Path · Gold Decoration · Zero JavaScript · Infinitely Scalable · Free Forever
Trusted by 50,000+ developers worldwide · Coodeverse · Free Forever · CC BY 4.0