qibla-camera-finder
v1.0.0
Published
AR-powered Qibla direction finder — point your phone camera and see the Kaaba when facing the right direction
Maintainers
Readme
Qibla Camera Finder 📸🧭
AR-powered Qibla direction finder — point your phone camera and see the Kaaba when you face the right direction!
🔗 Live demo: adwatak.cloud/tools/qibla-camera
Features
- 📸 Live camera overlay — see the real world through your phone camera with AR guidance
- 🧭 Smart compass — uses your phone's magnetometer to calculate Qibla direction
- 🕋 Kaaba reveal — the Kaaba SVG appears when you're aligned within 10° of Qibla
- 🌐 3 location methods — auto GPS, city selection (30+ cities), or manual coordinates
- 🌍 4 languages — العربية، English, Türkçe, Bahasa Indonesia
- 🔄 Hysteresis — stays aligned even with slight hand movement (14° lose threshold)
How It Works
- Open adwatak.cloud/tools/qibla-camera on your phone
- Select your location (GPS / city / coordinates)
- Point your rear camera forward
- Follow the arrow until the Kaaba appears!
Embed on Your Site
<iframe src="https://adwatak.cloud/tools/qibla-camera?embed=1"
width="100%" height="600"
style="border:none;border-radius:12px;max-width:760px;margin:0 auto;display:block"
loading="lazy" title="Qibla Camera Finder"></iframe>Install via npm
npm install qibla-camera-finderconst { getEmbedCode, getUrl } = require('qibla-camera-finder');
// Get embed HTML for your website
const embed = getEmbedCode({ width: '100%', height: 600, lang: 'en' });
// Get the live tool URL
const url = getUrl({ lang: 'ar' }); // https://adwatak.cloud/tools/qibla-cameraAlgorithm
Uses the Haversine formula to calculate the bearing from your location to the Kaaba (21.4225°N, 39.8262°E). The device orientation API (DeviceOrientationEvent) provides real-time compass heading.
Tech Stack
- Next.js (React) — server-rendered app shell
- Canvas API — real-time AR overlay rendering
- DeviceOrientation API — compass heading
- getUserMedia — camera stream
- SVG — Kaaba illustration with gradients and gold details
Related Tools
- Qibla Direction Compass — classic compass-style Qibla finder
- Prayer Times — accurate prayer times by location
- Hijri Converter — Gregorian ↔ Islamic calendar
License
MIT © Adwatak
