create-surf-app 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -110,7 +110,7 @@ module.exports = router;
|
|
|
110
110
|
- `backend/server.js` - uses @surf-ai/sdk/server
|
|
111
111
|
- `entry-client.tsx` - app bootstrap with SSR hydration
|
|
112
112
|
- `entry-server.tsx` - SSR render for deploy
|
|
113
|
-
- `index.html` - cold-start guard and
|
|
113
|
+
- `index.html` - cold-start guard, Surf badge, and Plaza badge script
|
|
114
114
|
- `eslint.config.*` - lint rules
|
|
115
115
|
- `index.css` - only imports, do not add styles here (use Tailwind classes)
|
|
116
116
|
|
|
@@ -42,5 +42,36 @@
|
|
|
42
42
|
<path d="M61.6788 7.72949C61.6788 8.16229 61.4457 8.39533 61.013 8.39533H59.4749V16.3588C59.4749 16.7915 59.2418 17.0246 58.809 17.0246H58.1432C57.7104 17.0246 57.4774 16.7915 57.4774 16.3588V8.39533H56.5652C56.1324 8.39533 55.8993 8.16229 55.8993 7.72949V7.46316C55.8993 7.03036 56.1324 6.79732 56.5652 6.79732H57.4774V5.61213C57.4774 3.69451 58.8956 2.74902 60.5136 2.74902C60.9131 2.74902 61.2593 2.78897 61.539 2.84224C61.9651 2.9288 62.1116 3.2484 61.9917 3.66122L61.8919 4.01412C61.7787 4.42028 61.5656 4.57342 61.2726 4.52015C61.1395 4.49352 60.993 4.4802 60.8199 4.4802C59.8477 4.4802 59.4749 4.97292 59.4749 5.87846V6.79732H61.013C61.4457 6.79732 61.6788 7.03036 61.6788 7.46316V7.72949Z"/>
|
|
43
43
|
</svg>
|
|
44
44
|
</a>
|
|
45
|
+
<!-- Plaza badge: rendered only when this deployed site is shared on Surf Plaza. -->
|
|
46
|
+
<script>
|
|
47
|
+
(function(){
|
|
48
|
+
try{
|
|
49
|
+
var m=location.hostname.match(/^([a-z0-9][a-z0-9-]{0,51})\.(?:surf\.computer|stg\.ask\.surf)$/i);
|
|
50
|
+
if(!m)return;
|
|
51
|
+
var slug=m[1].toLowerCase();
|
|
52
|
+
fetch('https://api.asksurf.ai/muninn/v1/plaza/by-subdomain?subdomain='+encodeURIComponent(slug))
|
|
53
|
+
.then(function(r){return r.ok?r.json():null;})
|
|
54
|
+
.then(function(j){
|
|
55
|
+
var d=j&&j.data;
|
|
56
|
+
if(!d||!d.shared||!d.listing_id)return;
|
|
57
|
+
var a=document.createElement('a');
|
|
58
|
+
a.id='plaza-badge';
|
|
59
|
+
a.href='https://asksurf.ai/studio/gallery?id='+encodeURIComponent(d.listing_id);
|
|
60
|
+
a.target='_blank';
|
|
61
|
+
a.rel='noopener noreferrer';
|
|
62
|
+
a.setAttribute('aria-label','Remix this on Surf Plaza');
|
|
63
|
+
a.style.cssText='position:fixed;bottom:56px;right:16px;z-index:2147483647;display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:20px;font-family:"Lato",system-ui,sans-serif;font-size:12px;font-weight:500;line-height:16px;text-decoration:none;background:#fd5587;color:#fff;box-shadow:0 1px 1px rgba(51,51,51,.08),0 6px 12px rgba(51,51,51,.16);opacity:.92;transition:opacity .2s';
|
|
64
|
+
a.onmouseenter=function(){a.style.opacity='1';};
|
|
65
|
+
a.onmouseleave=function(){a.style.opacity='.92';};
|
|
66
|
+
a.innerHTML='<span aria-hidden="true" style="font-size:13px;line-height:1">↻</span><span>Remix on Plaza</span>';
|
|
67
|
+
var s=document.createElement('style');
|
|
68
|
+
s.textContent='@media print{#plaza-badge{display:none}}';
|
|
69
|
+
document.head.appendChild(s);
|
|
70
|
+
document.body.appendChild(a);
|
|
71
|
+
})
|
|
72
|
+
.catch(function(){});
|
|
73
|
+
}catch(e){}
|
|
74
|
+
})();
|
|
75
|
+
</script>
|
|
45
76
|
</body>
|
|
46
77
|
</html>
|