<!DOCTYPE html> <html lang="ar"> <head> <meta charset="UTF-8"> <title>AR Studio Maker Pro</title> <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> <script src="https://cdn.rawgit.com/jeromeetienne/ar.js/2.1.8/aframe/build/aframe-ar.min.js"></script> <style> body { font-family: sans-serif; max-width: 800px; margin: auto; padding: 20px; } input, button, select { display: block; margin: 10px 0; padding: 8px; width: 100%; box-sizing: border-box; } button { cursor: pointer; background: #007BFF; color: white; border: none; } iframe { border: 1px solid #ccc; margin-top: 20px; width: 100%; height: 500px; } </style> </head> <body> <h1>🎬 AR Studio Maker Pro</h1> <p>صمّم تجربة AR مخصصة (فيديو، صورة) وشوفها فورًا، أو نزّلها.</p> <label>اختر نوع الماركر:</label> <select id="markerType"> <option value="hiro">Hiro (ماركر افتراضي)</option> <option value="custom">ماركر مخصص (رفع صورة)</option> </select> <input type="file" id="markerFile" accept="image/*" style="display: none;"/> <label>اختر فيديو أو صورة:</label> <input type="file" id="mediaFile" accept="video/mp4,image/*"/> <button id="generateBtn">✔️ أنشئ تجربة AR</button> <button id="downloadBtn" style="display:none;">⬇️ حمل كملف HTML</button> <iframe id="preview"></iframe> <script> const markerType = document.getElementById('markerType'); const markerFile = document.getElementById('markerFile'); const mediaFile = document.getElementById('mediaFile'); const generateBtn = document.getElementById('generateBtn'); const downloadBtn = document.getElementById('downloadBtn'); const preview = document.getElementById('preview'); markerType.addEventListener('change', () => { markerFile.style.display = markerType.value === 'custom' ? 'block' : 'none'; }); generateBtn.addEventListener('click', () => { const media = mediaFile.files[0]; if (!media) return alert('يرجى رفع فيديو أو صورة أولًا'); let markerHTML = markerType.value === 'hiro' ? `<a-marker preset="hiro">` : `<a-marker type="pattern" url="${URL.createObjectURL(markerFile.files[0])}">`; const isVideo = media.type.startsWith('video'); const mediaTag = isVideo ? `<a-video src="${URL.createObjectURL(media)}" width="1.5" height="1" autoplay loop muted></a-video>` : `<a-image src="${URL.createObjectURL(media)}" width="1" height="1"></a-image>`; const arCode = ` <!DOCTYPE html> <html lang="ar"><head><meta charset="utf-8"> <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> <script src="https://cdn.rawgit.com/jeromeetienne/ar.js/2.1.8/aframe/build/aframe-ar.min.js"></script> </head><body style="margin:0;overflow:hidden"> <a-scene embedded arjs> ${markerHTML} ${mediaTag} </a-marker> <a-entity camera></a-entity> </a-scene> </body></html>`; const blob = new Blob([arCode], { type: 'text/html' }); const url = URL.createObjectURL(blob); preview.src = url; downloadBtn.href = url; downloadBtn.download = 'ar-experience.html'; downloadBtn.style.display = 'block'; }); </script> </body> </html> - Initial Deployment
e95ee17 verified |
Download README.md from Mkdm1/ar-2: direct link, hf CLI and curl.
- Browser
- Download file 206 Bytes
-
https://huggingface.co/spaces/Mkdm1/ar-2/resolve/main/README.md
- Command line
-
hf download hf://spaces/Mkdm1/ar-2/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Mkdm1/ar-2/resolve/main/README.md
206 Bytes
metadata
title: ar-2
emoji: 🐳
colorFrom: yellow
colorTo: blue
sdk: static
pinned: false
tags:
- deepsite
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference