-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreview.html
More file actions
193 lines (178 loc) · 10.4 KB
/
Copy pathpreview.html
File metadata and controls
193 lines (178 loc) · 10.4 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Preview Trust Deed — SovereignTrust</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/main.css">
<script src="/js/auth.js"></script>
<script src="/js/trust-api.js"></script>
<script>requireAuth();</script>
</head>
<body>
<nav>
<a class="nav-logo" href="/">
<div class="nav-logo-mark">S</div>
<div class="nav-logo-text">Sovereign Trust</div>
</a>
<div class="nav-links" id="navLinks">
<a class="nav-link" href="/education.html">Education</a>
<a class="nav-link" href="/dashboard.html">Dashboard</a>
<a class="nav-link" href="/settings.html">Settings</a>
<a class="nav-link" href="/login.html">Sign in</a>
<a class="nav-cta" href="/register.html">Create Account</a>
</div>
<button class="nav-hamburger" onclick="toggleMobileMenu()" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</nav>
<!-- PREVIEW BAR -->
<div class="preview-bar">
<div class="preview-bar-label">Document Preview — <em>PREVIEW — NOT FINAL EXECUTED DOCUMENT</em></div>
<div class="preview-bar-actions">
<a class="btn-outline" id="editLink" style="color:var(--white); border-color:rgba(255,255,255,0.3); padding:8px 18px; font-size:14px;" href="/builder.html">← Edit</a>
<a class="btn-gold" id="checkoutLink" style="padding:8px 20px; font-size:14px; width:auto;" href="/checkout.html">Proceed to Payment →</a>
</div>
</div>
<div class="preview-layout">
<!-- DOCUMENT -->
<div class="preview-doc">
<div class="preview-watermark">PREVIEW ONLY</div>
<h2>EXPRESS PRIVATE TRUST DEED</h2>
<div class="doc-center">Prepared using SovereignTrust.net · Educational Document Preparation</div>
<h3>Trust Identification</h3>
<div class="doc-field"><div class="doc-field-label">Trust Name</div><div class="doc-field-val" id="docTrustName">—</div></div>
<div class="doc-field"><div class="doc-field-label">Date of Deed</div><div class="doc-field-val" id="docDate">—</div></div>
<div class="doc-field"><div class="doc-field-label">Governing Law</div><div class="doc-field-val" id="docJurisdiction">—</div></div>
<div class="doc-field"><div class="doc-field-label">Initial Trust Property</div><div class="doc-field-val" id="docInitialProperty">—</div></div>
<h3>The Settlor</h3>
<div class="doc-field"><div class="doc-field-label">Name</div><div class="doc-field-val" id="docSettlorName">—</div></div>
<div class="doc-field"><div class="doc-field-label">Address</div><div class="doc-field-val" id="docSettlorAddress">—</div></div>
<h3>The Trustee(s)</h3>
<div id="docTrustees"></div>
<h3>The Beneficiaries</h3>
<div id="docBeneficiaries"></div>
<h3>Trust Purpose</h3>
<p style="font-size:14px; color:var(--text-mid); line-height:1.8;" id="docPurpose">—</p>
<h3>Execution</h3>
<p style="font-size:14px; color:var(--text-muted); font-style:italic;">Signature blocks, witness attestation, and execution clauses will appear in the final generated document.</p>
<div style="margin-top:40px; padding:16px; background:var(--cream); border-radius:var(--radius-sm); font-size:12px; color:var(--text-muted); line-height:1.7; text-align:center;">This is a preview only and does not constitute a final executed legal document. This document has been generated using SovereignTrust.net for educational and administrative document preparation purposes only. It does not constitute legal advice.</div>
</div>
<!-- SIDEBAR -->
<div>
<div class="preview-sidebar-card">
<h3>Order Summary</h3>
<div class="price-line"><span style="color:var(--text-muted);">Express Trust Deed Package</span><span>£111.00</span></div>
<div class="price-line"><span style="color:var(--text-muted);">PDF Trust Deed</span><span style="color:var(--success);">✓ Included</span></div>
<div class="price-line"><span style="color:var(--text-muted);">Editable DOCX</span><span style="color:var(--success);">✓ Included</span></div>
<div class="price-line"><span style="color:var(--text-muted);">Dashboard Access</span><span style="color:var(--success);">✓ Included</span></div>
<div class="price-line total"><span>Total</span><span>£111.00</span></div>
<a class="btn-gold" id="payLink" style="margin-top:16px;" href="/checkout.html">Pay £111 Securely →</a>
<div style="font-size:12px; color:var(--text-muted); text-align:center; margin-top:12px;">🔒 Secured by Stripe</div>
</div>
<div class="preview-sidebar-card">
<h3 style="font-size:14px;">Included Documents</h3>
<div style="font-size:13px; color:var(--text-muted); margin-bottom:8px; font-weight:300;">After payment you will receive:</div>
<div style="font-size:14px; color:var(--text-mid); padding:8px 0; border-bottom:1px solid var(--grey-light);">📄 Express Private Trust Deed (PDF)</div>
<div style="font-size:14px; color:var(--text-mid); padding:8px 0; border-bottom:1px solid var(--grey-light);">📝 Editable Trust Deed (DOCX)</div>
<div style="font-size:14px; color:var(--text-mid); padding:8px 0;">📚 Guidance Notes (PDF)</div>
</div>
</div>
</div>
<!-- LEELA -->
<div class="lumina-float" id="leela">
<div class="lumina-panel" id="leelaPanel">
<div class="lumina-header">
<div class="lumina-avatar">✨</div>
<div>
<div class="lumina-name">Leela</div>
<div class="lumina-sub">Trust Document Assistant</div>
</div>
<a class="lumina-settings" href="/settings.html" title="AI settings">⚙</a>
<button class="lumina-close" onclick="toggleLeela()">×</button>
</div>
<div class="leela-messages" id="leelaMessages"
data-greeting="Your trust deed is looking great! Do you have any questions about the document before you proceed to payment?"
data-suggestions='["What does the execution clause mean?","Do I need witnesses when signing?","What happens after I sign the trust deed?"]'>
</div>
<div class="leela-disclaimer">I explain concepts and assist with document preparation only — not legal, tax or financial advice.</div>
<div class="leela-input-row">
<input class="leela-input" id="leelaInput" type="text" placeholder="Ask Leela anything…" />
<button class="leela-send" id="leelaSend" aria-label="Send">→</button>
</div>
</div>
<button class="lumina-btn" onclick="toggleLeela()"><span>✨</span></button>
</div>
<script src="/js/app.js"></script>
<script src="/js/leela.js"></script>
<script>
const trustId = new URLSearchParams(window.location.search).get('id');
function fmtDate(iso) {
if (!iso) return new Date().toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' });
return new Date(iso).toLocaleDateString(undefined, { day: 'numeric', month: 'long', year: 'numeric' });
}
function renderParty(container, items, formatter, emptyText) {
container.innerHTML = '';
const named = (items || []).filter((i) => i.name);
if (!named.length) {
const div = document.createElement('div');
div.className = 'doc-field';
div.innerHTML = `<div class="doc-field-label">—</div><div class="doc-field-val" style="color:var(--text-muted); font-style:italic;">${emptyText}</div>`;
container.appendChild(div);
return;
}
named.forEach((item, i) => {
const div = document.createElement('div');
div.className = 'doc-field';
const label = document.createElement('div');
label.className = 'doc-field-label';
label.textContent = `${container.id === 'docTrustees' ? 'Trustee' : 'Beneficiary'} ${i + 1}`;
const val = document.createElement('div');
val.className = 'doc-field-val';
val.textContent = formatter(item);
div.append(label, val);
container.appendChild(div);
});
}
(async function init() {
if (!trustId) {
document.getElementById('docTrustName').textContent = 'No trust selected — please start from the builder.';
return;
}
document.getElementById('editLink').href = `/builder.html?id=${encodeURIComponent(trustId)}`;
document.getElementById('checkoutLink').href = `/checkout.html?id=${encodeURIComponent(trustId)}`;
document.getElementById('payLink').href = `/checkout.html?id=${encodeURIComponent(trustId)}`;
try {
let trust = null;
const cached = sessionStorage.getItem('trustData_' + trustId);
if (cached) {
try { trust = JSON.parse(cached); } catch {}
}
if (!trust) trust = await getTrustById(trustId);
if (!trust) {
document.getElementById('docTrustName').textContent = 'Trust not found.';
return;
}
const data = trust.data || {};
const overview = data.overview || {};
const settlor = data.settlor || {};
document.getElementById('docTrustName').textContent = overview.name || trust.name || '—';
document.getElementById('docDate').textContent = fmtDate(overview.creationDate);
document.getElementById('docJurisdiction').textContent = overview.jurisdiction ? `The Laws of ${overview.jurisdiction}` : '—';
document.getElementById('docInitialProperty').textContent = overview.initialProperty || '—';
document.getElementById('docSettlorName').textContent = settlor.name || '—';
document.getElementById('docSettlorAddress').textContent = settlor.address || '—';
document.getElementById('docPurpose').textContent = overview.purpose ||
'To hold, manage and distribute the trust assets for the benefit of the named beneficiaries in accordance with the terms set out herein and any Memorandum of Wishes provided by the Settlor from time to time.';
renderParty(document.getElementById('docTrustees'), data.trustees, (t) => `${t.name}${t.address ? ', ' + t.address : ''}`, 'No trustees appointed yet.');
renderParty(document.getElementById('docBeneficiaries'), data.beneficiaries, (b) => `${b.name}${b.relationship ? ' (' + b.relationship + ')' : ''}${b.type ? ' — ' + b.type : ''}`, 'No beneficiaries added yet.');
} catch (err) {
console.error('[preview]', err);
document.getElementById('docTrustName').textContent = 'Could not load this trust.';
}
})();
</script>
</body>
</html>