File size: 4,165 Bytes
80ee55b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SpinnySnap Documentation</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-50 min-h-screen">
    <div class="container mx-auto px-4 py-12">
        <header class="text-center mb-12">
            <h1 class="text-4xl font-bold text-indigo-700 mb-2">SpinnySnap SDK Documentation</h1>
            <p class="text-lg text-gray-600">Integrate 360° photo capabilities into your app</p>
        </header>

        <div class="max-w-4xl mx-auto">
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-200">
                    <h2 class="text-2xl font-bold text-gray-800">Getting Started</h2>
                </div>
                <div class="p-6">
                    <h3 class="text-xl font-semibold text-gray-700 mb-4">Installation</h3>
                    <div class="bg-gray-800 rounded-lg p-4 mb-6">
                        <pre class="text-green-400 overflow-x-auto"><code>npm install spinnysnap-sdk</code></pre>
                    </div>
                    <p class="text-gray-600 mb-6">Or include directly via CDN:</p>
                    <div class="bg-gray-800 rounded-lg p-4 mb-6">
                        <pre class="text-green-400 overflow-x-auto"><code>&lt;script src="https://cdn.spinnysnap.com/sdk/v1.0.0/spinnysnap.min.js"&gt;&lt;/script&gt;</code></pre>
                    </div>

                    <h3 class="text-xl font-semibold text-gray-700 mb-4 mt-8">Basic Usage</h3>
                    <div class="bg-gray-800 rounded-lg p-4 mb-6">
                        <pre class="text-green-400 overflow-x-auto"><code>const spinner = new SpinnySnap({
    container: '#viewer-container',
    apiKey: 'your-api-key-here'
});

spinner.init().then(() => {
    console.log('SDK ready!');
});</code></pre>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-200">
                    <h2 class="text-2xl font-bold text-gray-800">API Reference</h2>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h3 class="text-xl font-semibold text-gray-700 mb-3"><code class="bg-gray-100 px-2 py-1 rounded">.capture()</code></h3>
                        <p class="text-gray-600 mb-4">Starts the 360° photo capture sequence.</p>
                        <div class="bg-gray-800 rounded-lg p-4">
                            <pre class="text-green-400 overflow-x-auto"><code>spinner.capture({
    frames: 36, // Number of frames to capture
    onProgress: (current) => {
        console.log(`Captured ${current} frames`);
    }
}).then((result) => {
    console.log('Capture complete!', result);
});</code></pre>
                        </div>
                    </div>

                    <div class="mb-8">
                        <h3 class="text-xl font-semibold text-gray-700 mb-3"><code class="bg-gray-100 px-2 py-1 rounded">.loadFromURL()</code></h3>
                        <p class="text-gray-600 mb-4">Loads a 360° image from a URL.</p>
                        <div class="bg-gray-800 rounded-lg p-4">
                            <pre class="text-green-400 overflow-x-auto"><code>spinner.loadFromURL('https://example.com/360-photo.jpg')
    .then(() => {
        console.log('Image loaded successfully');
    });</code></pre>
                        </div>
                    </div>
                </div>
            </div>

            <div class="text-center mt-8">
                <a href="/index.html" class="text-indigo-600 hover:text-indigo-800 font-medium inline-flex items-center">
                    <i data-feather="arrow-left" class="mr-2"></i> Back to main app
                </a>
            </div>
        </div>
    </div>

    <script>
        feather.replace();
    </script>
</body>
</html>