ðš ãStudioãã§ãã€ã³ã¯ã¶ã¡ãŸãã¹ãã©ãšãã§ã¯ããçèªð¥
Xã§å€§å¥œè©ïŒãStudioãã®Embedãšã«ã¹ã¿ã ã³ãŒãã ãã§"ã€ã³ã¯ã¶ã¡ãŸã"ã¹ãã©ãã¥ãŒã³é¢šãšãã§ã¯ããå®è£ ãã¯ãªãã¯ãã¿ããã§ã€ã³ã¯ã匟ããéã³å¿ãããµã€ãæŒåºããã³ããæé ã§è§£èª¬ããŸãã
ã¯ãªãã¯ã§ãããïŒðŠãã¿ããã§ãã·ã£ãïŒð
Xã§å€§å¥œè©ã®ãã€ã³ã¯ã¶ã¡ãŸãã¹ãã©ãšãã§ã¯ããããããŒã³ãŒãWebå¶äœããŒã«ãStudioãã®ç¡æãã©ã³ã§ãã®ãŸãŸå®è£ ã§ããã³ãŒãã玹ä»ããŸãâºïž
ããŒããŒã»ã¯ã·ã§ã³ïŒãããã®ã¡ã€ã³ããžã¥ã¢ã«ïŒããã£ã³ããŒã³ããŒãžã®"æŽã¿"ã«ãŽã£ãããè§Šã£ãŠæ¥œããäœéšã¯ããµã€ãã®å°è±¡ããã£ãšåŒ·ãããŸãâšð
ð¡ 1. ã©ããªãšãã§ã¯ãïŒ
ã¯ãªãã¯ãã¿ããã«åå¿ããŠãç»é¢äžã«ã«ã©ãã«ãªã€ã³ã¯ã匟ããŸããSVGïŒãã¯ã¿ãŒç»åïŒãšãã£ã«ã¿ãŒã䜿ã£ãŠ"ãŒãªãŒã®ããã«æº¶ãã"質æãåçŸãæ¬äœã飿²«ãæ£ïŒã¹ãã€ã¯ïŒãåããªã©ãè€éã«éãªãåãããŸãã§ã¹ãã©ãã¥ãŒã³ãããŠãããããªæ²¡å ¥æãçã¿åºããŸãðš
ð§° 2. å®è£ ã«å¿ èŠãªãã®
å®è£ ã«å¿ èŠãªã®ã¯ããã£ãããã ãã§ãã
- EmbedïŒåã蟌ã¿ïŒããã¯ã¹ â ããŒãžå ã«ã«ã¹ã¿ã ã³ãŒããå ¥ããããã®ããã¯ã¹ã
- ã«ã¹ã¿ã ã³ãŒã â äžã®HTMLã»CSSã»JavaScriptããã®ãŸãŸè²Œãä»ãã
ã©ã¡ããç¡æãã©ã³ã§å©çšå¯èœã§ãðª
ð¡ãã³ãïŒãStudioãã§ã¯ãåã蟌ã¿ããã¯ã¹ãããŒãžäžã«ãã©ãã°ããå³ã¯ãªãã¯ã§ãã«ã¹ã¿ã ã³ãŒããç·šéããéžã¶ã ãã§OKïŒ
ð» 3. ã³ãŒãã®è²Œãä»ãæé ïŒã³ããOKïŒ
- ãStudioãã§ããŒããŒãèæ¯ãšãªã¢ãªã©ããšãã§ã¯ãã衚瀺ãããäœçœ®ã«EmbedïŒåã蟌ã¿ïŒããã¯ã¹ã远å ããŸãã
- ã«ã¹ã¿ã ã³ãŒããç·šéãéãã以äžã®ã³ãŒãããã®ãŸãŸè²Œãä»ããŸãã
- ä¿åã»å ¬éããã°ãã¯ãªãã¯ãã¿ããã§ã€ã³ã¯ãé£ã³æ£ãæŒåºã宿ã§ãð¥
<div id="ink-svg" style="all:initial; display:block;">
<style>
/* èæ¯ãå®å
šéé */
html, body { background: transparent !important; }
#ink-svg .wrap{
all:unset; position:relative; display:block; width:100%;
aspect-ratio:16/9; max-width:900px; margin:0 auto; overflow:hidden;
background:transparent;
box-shadow:0 8px 28px rgba(0,0,0,.2);
}
#ink-svg svg{ position:absolute; inset:0; width:100%; height:100%; display:block; }
#ink-svg .hit{ position:absolute; inset:0; cursor:pointer; }
</style>
<div class="wrap"
data-points="72"
data-size="15-60"
data-lobes="4-8"
data-lobe-amp="0.15-0.25"
data-noise="0.04"
data-soft-spike="0.02"
data-splatter="10-26"
data-spikes="2-6"
data-spike-len="30-120"
data-spike-base="10-22"
data-tip="6-14"
data-drips="0-2">
<svg viewBox="0 0 1000 562.5" preserveAspectRatio="none">
<defs>
<filter id="goo" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="4" result="blur"/>
<feColorMatrix in="blur" mode="matrix"
values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 20 -10" result="goo"/>
<feComposite in="SourceGraphic" in2="goo" operator="atop"/>
</filter>
</defs>
<g id="inkGroup" filter="url(#goo)"></g>
</svg>
<div class="hit"></div>
</div>
<script>
(() => {
const root = document.currentScript.closest('#ink-svg');
const wrap = root.querySelector('.wrap');
const svg = root.querySelector('svg');
const g = root.querySelector('#inkGroup');
const hit = root.querySelector('.hit');
// ã«ã©ãŒãã¬ããïŒ1ã¯ãªãã¯1è²ïŒ
const PALETTE = ['#FB911A','#46C8C4','#F35E82','#BDE808','#A06FE9','#F1D231','#576FC0'];
const rand=(a,b)=>Math.random()*(b-a)+a;
const randInt=(a,b)=>Math.floor(Math.random()*(b-a+1))+a;
const pick=arr=>arr[Math.floor(Math.random()*arr.length)];
function clientToSvg(x,y){
const r=svg.getBoundingClientRect();
return {x:(x-r.left)/r.width*1000, y:(y-r.top)/r.height*562.5};
}
// äžžãã¹çæé¢æ°ãªã©ïŒçç¥ãªãïŒ
function makeRadii(n, base){
const radii=new Array(n).fill(base);
const LOBES=[4,8], LAMP=[0.15,0.25], NOISE=0.04, SOFTS=0.02;
const lobeN=randInt(LOBES[0],LOBES[1]);
const ampBase=rand(LAMP[0],LAMP[1])*base;
const centers=Array.from({length:lobeN},()=>Math.random());
const widths=centers.map(()=>rand(0.05,0.12));
for(let i=0;i<n;i++){
const t=i/n; let bump=0;
for(let k=0;k<lobeN;k++){
let d=Math.abs(t-centers[k]); if(d>0.5) d=1-d;
bump+=Math.exp(-(d*d)/(2*widths[k]*widths[k]))*ampBase;
}
radii[i]+=bump+(Math.random()-0.5)*NOISE*base*2;
}
if(Math.random()<SOFTS) radii[randInt(0,n-1)]+=base*rand(0.05,0.1);
return radii;
}
function buildPath(points){
const n=points.length, p=i=>points[(i+n)%n];
const tension=0.22;
let d=`M ${p(0).x.toFixed(2)} ${p(0).y.toFixed(2)}`;
for(let i=0;i<n;i++){
const p0=p(i-1),p1=p(i),p2=p(i+1),p3=p(i+2);
const c1x=p1.x+(p2.x-p0.x)*tension/6;
const c1y=p1.y+(p2.y-p0.y)*tension/6;
const c2x=p2.x-(p3.x-p1.x)*tension/6;
const c2y=p2.y-(p3.y-p1.y)*tension/6;
d+=` C ${c1x.toFixed(2)} ${c1y.toFixed(2)}, ${c2x.toFixed(2)} ${c2y.toFixed(2)}, ${p2.x.toFixed(2)} ${p2.y.toFixed(2)}`;
}
return d+' Z';
}
// ã¯ãªãã¯ïŒã¿ããã§ã¹ãã©ãã·ã¥çæ
function spawnSplash(clientX,clientY){
const {x:cx,y:cy}=clientToSvg(clientX,clientY);
const color=pick(PALETTE);
const base=rand(15,60), PTS=72;
const radii=makeRadii(PTS,base);
const off=rand(0,Math.PI*2);
const pts=[];
for(let i=0;i<PTS;i++){
const ang=off+i/PTS*Math.PI*2;
pts.push({x:cx+Math.cos(ang)*radii[i], y:cy+Math.sin(ang)*radii[i]});
}
const body=document.createElementNS('http://www.w3.org/2000/svg','path');
body.setAttribute('d',buildPath(pts));
body.setAttribute('fill',color);
g.appendChild(body);
}
let touched = false;
hit.addEventListener('touchstart', e => {
const t = e.touches && e.touches[0];
if (t) {
touched = true;
setTimeout(() => { touched = false; }, 400);
spawnSplash(t.clientX, t.clientY);
}
e.preventDefault();
}, {passive:false});
hit.addEventListener('click', e => {
if (touched) return;
spawnSplash(e.clientX, e.clientY);
});
})();
</script>
</div>
âš 4. 掻çšã¢ã€ãã¢
- LPã®ããŒããŒã§ããæŽŸæãªæŽã¿ãã«
- ã¯ãªãã¯äœçœ®ã«ããŽãã¯ãŒãã³ãæµ®ãã³äžããããæŒåº
- ãã©ã³ãã«ã©ãŒã«åãããŠã€ã³ã¯è²ãçµ±äžïŒ
PALETTEã®é åã倿ŽïŒ - éæèæ¯ãªã®ã§ãèæ¯ç»åãšçµ¶å¯Ÿé 眮ã§çµã¿åãããŠäœ¿ã£ãŠãOKïŒ
ð 5. ãŸãšãïœXã§è©±é¡ã®"è§Šã£ãŠæ¥œãã"ãããªãã®ãµã€ãã«
ãStudioãã®Embedãšã«ã¹ã¿ã ã³ãŒãã ãã§ãã¯ãªãã¯äžçºã§ã€ã³ã¯ã匟ãã"äœéšåãµã€ã"ãäœããŸãã
ãµã€ããéããç¬éãããªã«ãã!?ããšã¯ã¯ã¯ã¯ããŠããããããããªé©ãã®ä»æããããŸãã¯ããªãã®Webãµã€ãã«è¿œå ããŠã¿ãŸãããð¥
