Skip to content

Commit ba8cabd

Browse files
committed
feat(ski-dapp): swap @ika.xyz/sdk → @dika.sui/sdk, tbai.svg logo, white glow
- Replace @ika.xyz/sdk with @dika.sui/sdk (github:arbuthnot-eth/dika, v0.1.1) - Update dynamic import and type declaration to @dika.sui/sdk - Update sui.ski to 0.1.14 - Replace thunderbun-logo.png with tbai.svg everywhere (favicon, splash, sidebar, wallet widget, home loading screens, CCTP logo) - Change all logo drop-shadow glows from amber to white (single drop-shadow, GPU-composited — zero layout/paint cost) - Add tbai.svg + source assets to repo
1 parent 9828dd8 commit ba8cabd

27 files changed

Lines changed: 3052 additions & 102 deletions

assets/Tb.png

152 KB
Loading

assets/process-svg.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bun
2+
/**
3+
* Strip white background from Tb.svg and scale down by 95% (to 5% of original size).
4+
* Adds back a thick white outline via SVG filter (feMorphology dilate).
5+
* Usage: bun assets/process-svg.ts
6+
*/
7+
import { readFileSync, writeFileSync } from "fs";
8+
import { join } from "path";
9+
10+
const inPath = join(import.meta.dirname, "Tb.svg");
11+
const outPath = join(import.meta.dirname, "Tb-transparent.svg");
12+
13+
// Outline radius in viewBox units. At 200px display size over a 4000-unit square canvas:
14+
// scale = 4000/200 = 20. radius=60 → 3px white border at display size.
15+
const OUTLINE_RADIUS = 60;
16+
17+
let svg = readFileSync(inPath, "utf-8");
18+
19+
// 1. Remove the full-canvas white background rectangle (first path, fill="#FEFEFE")
20+
svg = svg.replace(
21+
/<path d="M0 0 [^"]*" fill="#FEFEFE" transform="translate\(0,0\)"\/>\n?/,
22+
""
23+
);
24+
25+
// 2. Center the logo in a 4000x4000 square canvas with padding for the white outline.
26+
// This prevents the outline from being clipped on any edge.
27+
// Logo is 2025 wide × 3687 tall. Center it: x offset = (4000-2025)/2 = 987.5, y = (4000-3687)/2 = 156.5
28+
// Add 100-unit outline buffer → final viewBox: "-1088 -257 4200 4200" (display: 210×210px at 5%)
29+
const CANVAS = 4200;
30+
const LOGO_W = 2025, LOGO_H = 3687;
31+
const PAD = 100; // extra buffer beyond centering for filter overflow
32+
const vbX = -Math.round((CANVAS - LOGO_W) / 2 + PAD);
33+
const vbY = -Math.round((CANVAS - LOGO_H) / 2 + PAD);
34+
const displaySize = (CANVAS * 0.05).toFixed(0);
35+
36+
svg = svg.replace(
37+
/<svg version="1.1" xmlns="http:\/\/www\.w3\.org\/2000\/svg" width="\d+(?:\.\d+)?" height="\d+(?:\.\d+)?"(?:[^>]*)?>/,
38+
`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="${displaySize}" height="${displaySize}" viewBox="${vbX} ${vbY} ${CANVAS} ${CANVAS}">`,
39+
);
40+
41+
// 3. Inject white-outline filter into <defs> (or create <defs> if absent)
42+
const filterDef = `<defs>
43+
<filter id="white-outline" x="-8%" y="-5%" width="116%" height="110%" color-interpolation-filters="sRGB">
44+
<feMorphology in="SourceAlpha" operator="dilate" radius="${OUTLINE_RADIUS}" result="expanded"/>
45+
<feFlood flood-color="white" result="white"/>
46+
<feComposite in="white" in2="expanded" operator="in" result="outline"/>
47+
<feMerge>
48+
<feMergeNode in="outline"/>
49+
<feMergeNode in="SourceGraphic"/>
50+
</feMerge>
51+
</filter>
52+
</defs>`;
53+
54+
if (svg.includes("</defs>")) {
55+
// Append filter inside existing defs
56+
svg = svg.replace("</defs>", ` <filter id="white-outline" x="-8%" y="-5%" width="116%" height="110%" color-interpolation-filters="sRGB">
57+
<feMorphology in="SourceAlpha" operator="dilate" radius="${OUTLINE_RADIUS}" result="expanded"/>
58+
<feFlood flood-color="white" result="white"/>
59+
<feComposite in="white" in2="expanded" operator="in" result="outline"/>
60+
<feMerge>
61+
<feMergeNode in="outline"/>
62+
<feMergeNode in="SourceGraphic"/>
63+
</feMerge>
64+
</filter>
65+
</defs>`);
66+
} else {
67+
// Insert defs right after the opening <svg> tag
68+
svg = svg.replace(/(<svg[^>]*>)/, `$1\n${filterDef}`);
69+
}
70+
71+
// 4. Wrap all logo content in a group with the white-outline filter applied
72+
svg = svg.replace(/(<svg[^>]*>[\s\S]*?<\/defs>)\n?([\s\S]*)(<\/svg>)/, (_, header, content, close) => {
73+
return `${header}\n<g filter="url(#white-outline)">\n${content}</g>\n${close}`;
74+
});
75+
76+
writeFileSync(outPath, svg, "utf-8");
77+
console.log(`Written: ${outPath}`);
78+
console.log(`Background removed, white outline (radius=${OUTLINE_RADIUS}) added, scaled to 5%.`);

assets/simplify-svg.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bun
2+
/**
3+
* Reduce SVG path data by scaling coordinate space down 4x.
4+
* At display size (101x184), coordinate resolution of 506x922 is still sub-pixel.
5+
* This eliminates nearly-coincident points without visible quality loss.
6+
*/
7+
import { readFileSync, writeFileSync } from "fs";
8+
import { join } from "path";
9+
10+
const inPath = join(import.meta.dirname, "tbai.svg");
11+
const outPath = join(import.meta.dirname, "tbai-small.svg");
12+
13+
const SCALE = 0.25; // 4x reduction in coordinate precision
14+
15+
let svg = readFileSync(inPath, "utf-8");
16+
17+
// Scale viewBox dimensions
18+
svg = svg.replace(/viewBox="0 0 (\d+(?:\.\d+)?) (\d+(?:\.\d+)?)"/, (_, w, h) => {
19+
const nw = Math.round(Number(w) * SCALE);
20+
const nh = Math.round(Number(h) * SCALE);
21+
return `viewBox="0 0 ${nw} ${nh}"`;
22+
});
23+
24+
// Scale all numeric values inside path d="..." attributes
25+
// Strategy: wrap all path-bearing elements in a <g transform="scale(SCALE)">
26+
// and also adjust the viewBox, then let the numbers stay as-is.
27+
// BUT to actually reduce file size we must scale the coordinate values themselves.
28+
//
29+
// Simpler approach: scale every number in path d attributes by SCALE, then re-round to int.
30+
svg = svg.replace(/ d="([^"]+)"/g, (_, d) => {
31+
// Scale every float/int number in the path data
32+
const scaled = d.replace(/[-+]?[0-9]*\.?[0-9]+/g, (n: string) => {
33+
const v = parseFloat(n) * SCALE;
34+
return Math.round(v).toString();
35+
});
36+
return ` d="${scaled}"`;
37+
});
38+
39+
// Also scale feMorphology radius proportionally
40+
svg = svg.replace(/radius="(\d+(?:\.\d+)?)"/, (_, r) => {
41+
return `radius="${Math.round(Number(r) * SCALE)}"`;
42+
});
43+
44+
writeFileSync(outPath, svg, "utf-8");
45+
46+
const origSize = readFileSync(inPath).byteLength;
47+
const newSize = readFileSync(outPath).byteLength;
48+
console.log(`Input: ${(origSize / 1024).toFixed(1)} KB`);
49+
console.log(`Output: ${(newSize / 1024).toFixed(1)} KB (${((1 - newSize / origSize) * 100).toFixed(1)}% smaller)`);
50+
const orig = 3581635;
51+
console.log(`Total reduction from original 3.5MB: ${((1 - newSize / orig) * 100).toFixed(1)}%`);

assets/svgo.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default {
2+
plugins: [
3+
{
4+
name: "preset-default",
5+
params: {
6+
overrides: {
7+
convertPathData: {
8+
floatPrecision: 0,
9+
transformPrecision: 0,
10+
noSpaceAfterFlags: true,
11+
negativeExtraSpace: true,
12+
},
13+
cleanupNumericValues: { floatPrecision: 0 },
14+
mergePaths: { force: true },
15+
},
16+
},
17+
},
18+
],
19+
};

assets/tb.svg

Lines changed: 2864 additions & 0 deletions
Loading

assets/tbai.svg

Lines changed: 1 addition & 0 deletions
Loading

templates/ski-dapp/bun.lock

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/ski-dapp/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta name="mobile-web-app-capable" content="yes" />
99
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
1010
<meta name="description" content="The Sui-native framework for launching dApps. Built-in SDKs, Cloudflare Agents, PWA-ready." />
11-
<link rel="icon" type="image/png" href="/icons/thunderbun-logo.png" />
11+
<link rel="icon" type="image/svg+xml" href="/icons/tbai.svg" />
1212
<link rel="apple-touch-icon" href="/icons/pwa-192x192.png" />
1313
<link rel="preconnect" href="https://fonts.googleapis.com" />
1414
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@@ -17,27 +17,27 @@
1717
<style>
1818
#splash{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;background:#09090F;transition:opacity .3s ease}
1919
#splash.fade{opacity:0;pointer-events:none}
20-
#splash img{width:64px;height:64px;border-radius:14px;animation:splash-glow 1.4s ease-in-out infinite;filter:drop-shadow(0 0 20px rgba(255,184,0,0.35)) drop-shadow(0 0 40px rgba(245,158,11,0.15))}
21-
@keyframes splash-glow{0%,100%{opacity:.6;transform:scale(.95);filter:drop-shadow(0 0 20px rgba(255,184,0,0.35)) drop-shadow(0 0 40px rgba(245,158,11,0.15))}50%{opacity:1;transform:scale(1);filter:drop-shadow(0 0 30px rgba(255,184,0,0.5)) drop-shadow(0 0 60px rgba(245,158,11,0.25))}}
20+
#splash img{width:64px;height:64px;border-radius:14px;animation:splash-glow 1.4s ease-in-out infinite;filter:drop-shadow(0 0 16px rgba(255,255,255,0.5))}
21+
@keyframes splash-glow{0%,100%{opacity:.65;transform:scale(.95);filter:drop-shadow(0 0 14px rgba(255,255,255,0.4))}50%{opacity:1;transform:scale(1);filter:drop-shadow(0 0 24px rgba(255,255,255,0.7))}}
2222
#app{opacity:0;transition:opacity .2s ease}
2323
#app.ready{opacity:1}
2424
</style>
2525
</head>
2626
<body>
2727
<div id="splash">
28-
<img src="/icons/thunderbun-logo.png" alt="" width="64" height="64" />
28+
<img src="/icons/tbai.svg" alt="" width="50" height="50" />
2929
</div>
3030
<div id="app">
3131
<button id="sidebar-dock-toggle" aria-label="Open navigation">
32-
<img src="/icons/thunderbun-logo.png" alt="" width="20" height="20" />
32+
<img src="/icons/tbai.svg" alt="" width="20" height="20" />
3333
<span>Menu</span>
3434
</button>
3535
<div id="sidebar-backdrop" aria-hidden="true"></div>
3636

3737
<!-- Sidebar -->
3838
<aside id="sidebar">
3939
<div class="sidebar-logo">
40-
<img class="sidebar-logo-icon" src="/icons/thunderbun-logo.png" alt="Thunderbun" width="32" height="32" />
40+
<img class="sidebar-logo-icon" src="/icons/tbai.svg" alt="Thunderbun" width="50" height="50" />
4141
<span class="sidebar-logo-name" id="app-title">Thunderbun</span>
4242
<button id="sidebar-close" class="sidebar-close" aria-label="Close navigation"></button>
4343
</div>
@@ -78,7 +78,7 @@
7878

7979
<div id="wallet-widget-content">
8080
<div id="wallet-widget-loading">
81-
<img class="wallet-widget-loading-logo" src="/icons/thunderbun-logo.png" alt="" width="42" height="42" />
81+
<img class="wallet-widget-loading-logo" src="/icons/tbai.svg" alt="" width="50" height="50" />
8282
<div class="wallet-widget-sub">Checking WaaP session…</div>
8383
</div>
8484

templates/ski-dapp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"validate": "bun run test:playstore && tsc -p tsconfig.json --noEmit && echo 'All validations passed'"
3131
},
3232
"dependencies": {
33+
"@dika.sui/sdk": "github:arbuthnot-eth/dika",
3334
"@human.tech/waap-sdk": "file:vendor/waap-sdk",
34-
"@ika.xyz/sdk": "github:arbuthnot-eth/ika#feat/upgrade-mysten-sui-v2",
3535
"@mysten/dapp-kit": "latest",
3636
"@mysten/dapp-kit-core": "^1.0.4",
3737
"@mysten/deepbook-v3": "^1.0.12",
@@ -50,7 +50,7 @@
5050
"hono-agents": "^3.0.6",
5151
"react": "^18.3.1",
5252
"react-dom": "^18.3.1",
53-
"sui.ski": "0.1.11"
53+
"sui.ski": "^0.1.14"
5454
},
5555
"devDependencies": {
5656
"@cloudflare/workers-types": "^4.20260228.0",
-4.82 KB
Loading

0 commit comments

Comments
 (0)