-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (70 loc) · 2.55 KB
/
index.html
File metadata and controls
77 lines (70 loc) · 2.55 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CADit Embed Example</title>
<link rel="stylesheet" href="styles.css">
<!-- Three.js for STL preview -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/loaders/STLLoader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
</head>
<body>
<header>
<h1>CADit Embed Example — Partner Auth Demo</h1>
<p>This page demonstrates how to embed CADit in your website with partner authentication.</p>
</header>
<main>
<div class="controls">
<h2>Controls</h2>
<div class="button-group">
<button id="getStlBtn" class="btn btn-primary" disabled>Request STL Export</button>
<button id="downloadBtn" class="btn btn-secondary" disabled>Download STL</button>
</div>
<div class="status">
<span class="status-label">Status:</span>
<span id="statusText" class="status-value">Waiting for CADit to load...</span>
</div>
</div>
<div class="controls">
<h2>Auth Controls</h2>
<p class="auth-info">
This demo simulates the partner's side of the auth handshake.
When CADit sends a <code>cadit-auth-request</code>, this page automatically signs
a test JWT and responds with <code>partner-auth-token</code>.
</p>
<div class="auth-status">
<span class="status-label">Test User:</span>
<span class="status-value">user@myapp.com (user-123)</span>
</div>
</div>
<div class="panels">
<div class="embed-container">
<iframe
id="caditFrame"
src="https://app.cadit.app/new?embed=true&partnerName=MyApp"
allow="clipboard-read; clipboard-write; accelerometer; autoplay"
loading="lazy"
></iframe>
</div>
<div class="preview-container" id="previewContainer" style="display: none;">
<h3>3D Preview</h3>
<div id="stlViewer"></div>
</div>
</div>
<div class="output">
<h2>Event Log</h2>
<div id="eventLog" class="event-log"></div>
</div>
</main>
<footer>
<p>
<a href="https://github.com/cookiecad/cadit-embed-example" target="_blank">View on GitHub</a>
·
<a href="https://cadit.app" target="_blank">Learn more about CADit</a>
</p>
</footer>
<script src="script.js"></script>
</body>
</html>