<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Natiphog.Ju on Medium]]></title>
        <description><![CDATA[Stories by Natiphog.Ju on Medium]]></description>
        <link>https://medium.com/@natiphong.ju?source=rss-ad1dd7469c5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cxrtvpN_S23-vSlQXFM6CQ.png</url>
            <title>Stories by Natiphog.Ju on Medium</title>
            <link>https://medium.com/@natiphong.ju?source=rss-ad1dd7469c5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 17:01:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@natiphong.ju/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ไม่เขียนโค้ดสักบรรทัด: ใช้ Google Antigravity + prompt สไตล์ MotionSites สร้างเว็บ Resume แล้ว…]]></title>
            <link>https://medium.com/@natiphong.ju/%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B9%82%E0%B8%84%E0%B9%89%E0%B8%94%E0%B8%AA%E0%B8%B1%E0%B8%81%E0%B8%9A%E0%B8%A3%E0%B8%A3%E0%B8%97%E0%B8%B1%E0%B8%94-%E0%B9%83%E0%B8%8A%E0%B9%89-google-antigravity-prompt-%E0%B8%AA%E0%B9%84%E0%B8%95%E0%B8%A5%E0%B9%8C-motionsites-%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A-resume-%E0%B9%81%E0%B8%A5%E0%B9%89%E0%B8%A7-7409f031f43f?source=rss-ad1dd7469c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7409f031f43f</guid>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Natiphog.Ju]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 14:33:09 GMT</pubDate>
            <atom:updated>2026-09-22T02:18:18.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEn99GB7hQkylQOVhTpj1A.png" /></figure><h3>ไม่เขียนโค้ดสักบรรทัด: ใช้ Google Antigravity + prompt สไตล์ MotionSites สร้างเว็บ Resume แล้ว Deploy ขึ้น Vercel</h3><blockquote>ติดตั้ง Antigravity ใช้เวลา 3 นาที (ลิงก์เดียว) ที่เหลือของบทความคือ <strong>ตัวอย่าง prompt จริงที่ยาว 400 บรรทัด</strong> ผ่าให้ดูทีละส่วนว่าทำไมมันได้ผล แล้วเอาโครงเดียวกันมาเขียน prompt สร้างเว็บ Resume ที่ deploy ขึ้น Vercel ได้จริง</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDGCIHXYGvJkNhP6CxOV1Q.png" /><figcaption><a href="https://nongbom.vercel.app/">https://nongbom.vercel.app/</a></figcaption></figure><blockquote>ผมไปทำ resume เจ๋งๆ มาเลยอยากมาแชร์ให้ไปทำด้วยกัน</blockquote><blockquote><a href="https://nongbom.vercel.app/">https://nongbom.vercel.app/</a></blockquote><h3>1. ติดตั้ง Antigravity</h3><p>Google เปิดตัว <strong>Antigravity</strong> พร้อม Gemini 3 เมื่อ 18 พ.ย. 2025 จุดต่างคือมันเป็น <strong>agent-first</strong> — agent เข้าถึง editor, terminal และ <strong>browser ในตัว</strong> ได้เอง สั่งเป็น “งาน” แล้วมันวนทำ + เปิดเว็บเช็กผลเอง จนได้ผลลัพธ์กลับมาให้รีวิว</p><p>การติดตั้งง่ายมาก <strong>เข้าลิงก์เดียวจบ</strong>:</p><p>👉 <a href="https://antigravity.google/download"><strong>https://antigravity.google/download</strong></a></p><ul><li>หน้านั้นจะ detect เครื่องให้เอง เลือก build ตามแพลตฟอร์ม — <strong>macOS</strong> (ARM64 สำหรับ Apple Silicon / x64 สำหรับ Intel), <strong>Windows</strong>, <strong>Linux</strong> (มีทั้ง .deb, .rpm, .tar.gz และคำสั่งเพิ่ม apt/yum repo ให้ก็อปอยู่ในหน้าเดียวกัน)</li><li>ติดตั้งแล้วเปิดขึ้นมา <strong>ล็อกอินด้วย Google Account ส่วนตัว</strong> (ช่วง preview ยังใช้ฟรี)</li><li>กด Next ผ่าน default ทุกหน้า (theme / keybinding / plugin) เปลี่ยนทีหลังได้</li><li>macOS ถ้าเปิดไม่ขึ้น → System Settings → Privacy &amp; Security → <strong>Open Anyway</strong></li></ul><p>ในหน้าเดียวกันนี้ยังมีให้เลือกอีก 4 แบบ ถ้าไม่อยากย้าย editor: <strong>extension</strong> สำหรับ VS Code / JetBrains / Zed / Visual Studio / Xcode, <strong>CLI</strong>, และ <strong>Python SDK</strong> — แต่บทความนี้ใช้ตัว desktop client ตัวหลัก เพราะมี Agent Manager + browser ในตัวครบ</p><pre>mkdir my-resume &amp;&amp; cd my-resume<br>git init &amp;&amp; git commit --allow-empty -m &quot;chore: init&quot;</pre><p>แล้วใน Antigravity สั่ง <strong>Open Folder</strong> ชี้มาที่โฟลเดอร์นี้ — อย่าเปิดที่โฟลเดอร์งานสำคัญ</p><p>อยากได้ Resume เท่ๆแบบนี้ก็ทำเลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4l5hNX9V3x56MexO" /></figure><blockquote>Prompt เปิด Antigravity แล้ว เพิ่มใน ai agent ได้เลย</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdJb0NuQCwJ1QZ8Uf9AHSQ.png" /></figure><pre>Build a single standalone HTML file (no build step, no frameworks, no local<br>assets) for a landing page called &quot;Nival — Cyberspace Identity&quot;. Everything —<br>CSS and JS — must be inline in one file. The signature feature is a<br>cursor-following SPOTLIGHT REVEAL that unmasks a second hero image through a<br>soft radial mask.<br><br>════════════════════════════════════════════════════════════════════<br>1. ASSET URLS (use these EXACT strings — note the TWO different hosts)<br>════════════════════════════════════════════════════════════════════<br>All are transparent-background PNGs. There is no video.<br><br>HERO_FRONT (white/silver android, 600×759, base layer):<br>https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/658f62c6-fdb2-41b9-aa0f-10837f9e72cb.png<br><br>HERO_BACK (heavy black/gunmetal armor variant, 1792×2240, reveal layer):<br>https://d8j0ntlcm91z4.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/hf_20260914_123603_5ac5732a-900b-4919-9d9c-3c454194b0a5.png<br><br>MATERIAL thumbnail:<br>https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/96ef2bcd-ed69-4b7e-ab83-8a18d2129d99.png<br><br>AVATAR_URLS array (gallery, in order 1→5):<br>1 https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/caf08036-c63c-4d0c-9b81-43c5a7a49343.png<br>2 https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/599a5a28-c9f1-44f9-b01b-adb8b22e8c12.png<br>3 https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/fc804805-b23c-40ba-97b0-9ab2ba3efb5d.png<br>4 https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/0cb0c1f0-f84a-47bb-bfa1-43b6c7f1575d.png<br>5 https://d2ol7oe51mr4n9.cloudfront.net/user_38xzZboKViGWJOttwIXH07lWA1P/64e651b1-a8ba-44e8-8fbe-e85fcd6e5cf0.png<br><br>Set every &lt;img src&gt; from JS at runtime (leave src=&quot;&quot; in the markup and use<br>data-attributes: data-hero, data-hero-front, data-hero-back, data-material,<br>data-av1…data-av5).<br><br>════════════════════════════════════════════════════════════════════<br>2. FONT + HEAD<br>════════════════════════════════════════════════════════════════════<br>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,viewport-fit=cover&quot;&gt;<br>&lt;meta name=&quot;theme-color&quot; content=&quot;#d6e6f5&quot;&gt;<br>Title: &quot;Nival — Cyberspace Identity&quot;<br>Font: Inter weights 400;500;700 from Google Fonts, with preconnect to<br>fonts.googleapis.com and fonts.gstatic.com (crossorigin).<br>Stack: &#39;Inter&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif<br>Favicon: inline SVG data-URI, rounded square rx=9 filled #06192f with a light<br>#edf6fd &quot;N&quot; glyph.<br><br>CSS variables on :root:<br>--ink:#06192f; --muted:#77899c; --ice:#d6e6f5; --white:#fff; --blue:#1169dc<br><br>════════════════════════════════════════════════════════════════════<br>3. CORE LAYOUT MODEL — fixed design canvas, scaled to fit<br>════════════════════════════════════════════════════════════════════<br>This is NOT a flow layout. It is a fixed-size &quot;stage&quot; that is absolutely<br>positioned and CSS-transform-scaled to fit the viewport.<br><br>html,body: 100% w/h, margin 0, overflow hidden, background var(--ice).<br><br>.viewport — position:fixed; inset:0; overflow:hidden; isolation:isolate;<br>  background: radial-gradient(circle at 44% 28%,#e8f3fb 0 6%,#d9e9f6 30%,<br>              #d6e6f5 68%,#d4e5f4 100%)<br>.viewport:after — full-bleed grain overlay, opacity .13,<br>  mix-blend-mode:soft-light, using an inline SVG feTurbulence data-URI<br>  (fractalNoise, baseFrequency .82, numOctaves 3, stitchTiles stitch,<br>  180×180 tile, inner rect opacity .32), pointer-events:none.<br><br>.stage — container-type:inline-size; position:absolute; left:50%; top:50%;<br>  width:1536px; height:1024px; --fx:0px; transform-origin:center;<br>  overflow:hidden;<br>  background: radial-gradient(circle at 43% 35%,rgba(246,251,255,.74),<br>              transparent 31%),<br>              linear-gradient(112deg,#d6e6f5 0%,#d9e9f6 44%,#d4e5f4 100%)<br>.stage:before — sheen overlay, z-index 1, pointer-events none,<br>  linear-gradient(90deg,rgba(255,255,255,.08),transparent 35%,rgba(255,255,255,.04))<br>.stage.is-fit — background:transparent; and .stage.is-fit:before{display:none}<br><br>All children position:absolute and use left:calc(var(--fx) + Npx) so the<br>--fx offset shifts the whole composition when the stage is widened.<br><br>JS layout() function, run on load and on resize (passive):<br>  const PHONE = matchMedia(&#39;(max-width:520px) and (orientation:portrait)&#39;);<br>  If PHONE matches → remove is-mobile/is-fit, add is-phone + nav-compact,<br>    clear inline width/height/transform and remove --hf, return.<br>  Else remove is-phone, then:<br>    w=innerWidth, h=innerHeight, mobile = w/h &lt; 1.05<br>    toggle .is-mobile = mobile<br>    bh = mobile ? 1366 : 1024<br>    ideal = Math.round(bh * w / h)<br>    lo = mobile ? 560 : 1060;  hi = mobile ? 1450 : 2600<br>    bw = Math.max(lo, Math.min(hi, ideal))<br>    s  = Math.min(w/bw, h/bh)<br>    set --hf = Math.min(79, 79*(bw-295)/965).toFixed(2)+&#39;px&#39;   ← headline size<br>    toggle .is-fit = Math.abs(ideal-bw) &gt; 1<br>    compact = mobile || s &lt; .52 ; toggle .nav-compact = compact<br>    if (!compact &amp;&amp; menu open) close the menu<br>    stage.style.width=bw+&#39;px&#39;; height=bh+&#39;px&#39;;<br>    stage.style.transform = `translate(-50%,-50%) scale(${s})`<br><br>════════════════════════════════════════════════════════════════════<br>4. DESKTOP ELEMENTS (exact values, 1536×1024 canvas)<br>════════════════════════════════════════════════════════════════════<br>.header — inset:0 0 auto 0; height:82px; z-index:20<br><br>.brand — left:calc(var(--fx)+46px); top:29px; 57×21. Inline SVG<br>  viewBox &quot;0 0 58 21&quot;, fill var(--ink), path:<br>  M0 0h7v21H0zM21 0h7v21h-7zM0 0h12l16 21H16zM30 0h8l12 21h-8zM51 0h7v21h-7z<br><br>.menu (hamburger button) — left:calc(var(--fx)+136px); top:31px; 46×19;<br>  three spans 45×2px background var(--ink), tops 2px/8px/14px, transition .25s.<br>  When .stage.menu-open: span1 translateY(6px) rotate(38deg); span2 opacity 0;<br>  span3 translateY(-6px) rotate(-38deg).<br><br>.nav (glass pill) — left:calc(50% - 277px); top:20px; 524×40; padding 3px;<br>  display:grid; grid-template-columns:148px 125px 115px 130px;<br>  border:1px solid rgba(255,255,255,.5); border-radius:22px;<br>  background:rgba(245,249,255,.23);<br>  box-shadow:0 0 12px rgba(255,255,255,.7),inset 0 0 12px rgba(255,255,255,.42);<br>  backdrop-filter:blur(17px)<br>  Links: &quot;Home page&quot; (active), &quot;Pricing&quot;, &quot;About&quot;, &quot;Contact&quot;; height 32px,<br>  font-size 16px, border-radius 18px, transition .2s.<br>  .nav a.active → background rgba(255,255,255,.78);<br>    box-shadow 0 2px 12px rgba(26,48,78,.06)<br>  hover/focus-visible → background rgba(255,255,255,.58)<br><br>.join button — right:calc(var(--fx)+43px); top:17px; 205×46; radius 25px;<br>  background rgba(246,250,255,.38);<br>  box-shadow 0 0 18px rgba(255,255,255,.46),inset 0 0 10px rgba(255,255,255,.45);<br>  backdrop-filter blur(16px).<br>  .join-icon 42×42 circle, background rgba(255,255,255,.82), holds a 23×23<br>  person SVG (circle cx12 cy7 r4 + path &quot;M4.5 21c.4-5 3.1-7.3 7.5-7.3s7.1 2.3 7.5 7.3&quot;),<br>  stroke var(--ink), stroke-width 1.8, round caps/joins, fill none.<br>  .join-label 16px, margin-left 12px, color #5e7082, text &quot;Join us&quot;.<br><br>.headline (h1, id=&quot;home&quot;) — left:calc(var(--fx)+45px); top:98px; width:960px;<br>  font-size:var(--hf,79px); line-height:.99; letter-spacing:-.019em;<br>  word-spacing:.0633em; font-weight:400; z-index:8<br>  Line 1: &lt;span class=&quot;headline-line&quot;&gt;Cyberspace — reality&lt;/span&gt;<br>    (.headline-line{display:block;white-space:nowrap};<br>     .headline-line:first-child{letter-spacing:-.02975em})<br>  Line 2: &lt;span class=&quot;headline-line headline-line2&quot;&gt; containing an inline<br>    &quot;chain&quot; SVG then &lt;span&gt;merge with the virtual&lt;/span&gt;<br>    .headline-line2{display:flex;align-items:center;gap:.2658em;margin-top:2px}<br>    .chain{width:1.9114em;height:.6076em;flex:0 0 1.9114em;overflow:visible}<br>    .chain path{fill:var(--ink)}<br>    chain SVG viewBox &quot;0 0 151 48&quot;, three interlinked ellipse-ring shapes<br>    (six arc subpaths) forming a horizontal chain of 3 links.<br><br>.features — right:calc(var(--fx)+44px); top:157px; width:190px; display:grid;<br>  gap:11px; z-index:10; font-size:20px; line-height:1.1; text-align:right<br>  Three .feature rows (display:flex;justify-content:flex-end;gap:18px;<br>  white-space:nowrap; b{font-weight:400}):<br>    &quot;Web based /01&quot;, &quot;Collaborative /02&quot;, &quot;Real-time /03&quot;<br><br>.creator — right:calc(var(--fx)+390px); top:311px; z-index:12; display:flex;<br>  align-items:flex-start; color:#77899b<br>  .verified 19×19 circle background var(--ink), margin-right 10px, margin-top<br>  1px, holding an 11×11 white checkmark (path &quot;M2.2 6.2 4.7 8.5 9.8 3&quot;,<br>  stroke-width 2.2, fill none, round caps).<br>  .creator-copy 16px/1.25: &quot;By Nival_02&quot; + .series block (margin-top 9px,<br>  color #8496a8) &quot;Identity series · 02&quot;<br><br>.glass-card — left:calc(var(--fx)+46px); top:344px; 365×211;<br>  padding:9px 25px 18px 25px; border:1px solid rgba(255,255,255,.45);<br>  border-radius:24px; z-index:14;<br>  background:linear-gradient(135deg,rgba(255,255,255,.55),rgba(239,247,253,.42));<br>  box-shadow:inset 0 0 22px rgba(255,255,255,.32),0 7px 26px rgba(65,94,123,.045);<br>  backdrop-filter:blur(20px)<br>  .card-top height 60px, flex, space-between, align-items flex-start<br>    .count margin-left:-20px; padding:8px 21px 7px; border-radius:26px;<br>      color:white; background:linear-gradient(135deg,#0b2b50,#06192f);<br>      min-width:124px; text-align:center<br>      strong: block, 20px, line-height 19px, weight 500 → &quot;+105&quot;<br>      small: block, 12px, margin-top 3px → &quot;kinds of avatars&quot;<br>    .eye button 38×38, margin-right -6px, margin-top 10px, radius 50%,<br>      hover background rgba(255,255,255,.5); SVG 33×23 viewBox &quot;0 0 32 22&quot;,<br>      eye outline path + circle cx16 cy11 r3.5, stroke var(--ink) 1.8, fill none<br>  .card-copy margin:15px 0 0; font-size:18px; line-height:1.32;<br>    letter-spacing:-.14px → &quot;Explore digital identities, crafted&lt;br&gt;for a new<br>    kind of presence.&quot;<br>  .card-bottom position:absolute; left:25px; right:18px; bottom:15px;<br>    height:60px; flex; align-items:center<br>    .start 18px/18px → &quot;Start&lt;br&gt;&lt;strong&gt;creating&lt;/strong&gt;&quot; (strong 21px)<br>    .shuffle 42×42 circle, margin-left:auto; margin-right:26px; hover<br>      background rgba(255,255,255,.58); SVG 27×27 viewBox &quot;0 0 30 30&quot;<br>      shuffle-arrows path, stroke var(--ink) 1.5, fill none, round caps<br>    .play 58×58 circle background var(--ink), box-shadow 0 5px 14px<br>      rgba(8,26,46,.12), transition .25s; hover transform scale(1.05);<br>      SVG 24×26 white triangle (path &quot;m3 2 19 12L3 26z&quot;), margin-left 4px<br>      .play.active → box-shadow 0 0 0 7px rgba(17,105,220,.12),<br>                     0 0 32px rgba(17,105,220,.38)<br><br>Ghost typography (big translucent words behind the subject):<br>  .ghost{position:absolute;z-index:2;color:rgba(255,255,255,.43);<br>    font-weight:700;letter-spacing:-9px;line-height:.8;user-select:none}<br>  .ghost-one → left:calc(var(--fx)+31px); top:594px; font-size:189px;<br>    transform:scaleX(1.23); transform-origin:left center.<br>    Markup: R&lt;i class=&quot;o-gap&quot;&gt;&lt;/i&gt;BO  (the &lt;i&gt; is a spacer where the avatar sits)<br>    .o-gap{display:inline-block;width:105px;font-style:normal}<br>  .ghost-two → left:calc(50% - 16px); top:745px; font-size:164px; text &quot;FORM&quot;<br><br>.robo-o-avatar (circular thumbnail that plays the &quot;O&quot; of ROBO) —<br>  left:calc(var(--fx)+174px); top:600px; 143×143;<br>  border:8px solid rgba(255,255,255,.56); border-radius:50%; overflow:hidden;<br>  background:rgba(146,178,209,.13); z-index:4; pointer-events:none<br>  img: absolute left:-4px; top:5px; 116×147; object-fit:contain;<br>  filter:drop-shadow(3px 5px 8px rgba(35,57,79,.12)); src = HERO_FRONT<br><br>.material — right:calc(var(--fx)+44px); top:413px; 345×140; z-index:13<br>  .material-pill absolute right:0; bottom:1px; 345×76; border-radius:41px;<br>    background var(--ink); display:flex; align-items:center; overflow:visible<br>  .material-thumb absolute left:0; bottom:1px; 141×180; overflow:hidden;<br>    border-radius:0 0 0 38px; z-index:2<br>    img absolute left:-25px; top:35px; 168×153; object-fit:contain<br>  .material-copy margin-left:146px; color:white; 17px/1.25; width:95px<br>    → &quot;Adaptive&lt;br&gt;materials&quot;<br>  .material-next margin-left:auto; margin-right:6px; 65×65 circle<br>    background #f5f9fc; SVG 30×30 viewBox &quot;0 0 32 32&quot; arrow<br>    (path &quot;M7 8 24 25M12 25h12V13&quot;), stroke var(--ink) 2.4, fill none<br><br>.gallery — right:calc(var(--fx)+43px); bottom:46px; 439×296; z-index:12<br>  .avatar buttons 138×138; border:8px solid rgba(247,251,255,.72);<br>    border-radius:50%; overflow:hidden; background:rgba(240,247,252,.56);<br>    padding 0; transition border-color .22s, box-shadow .22s<br>    hover/focus/active → border-color rgba(255,255,255,.97);<br>      box-shadow 0 0 0 2px rgba(17,105,220,.18),0 8px 20px rgba(46,74,101,.12)<br>    img width/height var(--iw,112%); object-fit:contain;<br>      transform:translate(var(--il,-6%),var(--it,-3%))<br>  Absolute positions (nth-child):<br>    1 left:160px top:1px | 2 left:312px top:0 | 3 left:0 top:158px<br>    4 left:155px top:157px | 5 left:310px top:158px<br>  Per-button inline vars + data attributes (drive hero tinting):<br>    1: --iw:112.3%;--il:-5.84%;--it:-3.65%;background:#1e3048  data-hue=&quot;2&quot;  data-sat=&quot;1.2&quot;   (starts .active)<br>    2: --iw:111.5%;--il:-8.82%;--it:-4.41%                      data-hue=&quot;0&quot;  data-sat=&quot;.42&quot;<br>    3: --iw:113.1%;--il:-4.35%;--it:-0.72%                      data-hue=&quot;6&quot;  data-sat=&quot;1.3&quot;<br>    4: --iw:108.2%;--il:-6.82%;--it:0.76%                       data-hue=&quot;0&quot;  data-sat=&quot;.2&quot;<br>    5: --iw:114.8%;--il:-10.71%;--it:-2.14%                     data-hue=&quot;0&quot;  data-sat=&quot;.68&quot;<br><br>.socials — left:calc(var(--fx)+46px); bottom:35px; display:flex; gap:17px;<br>  z-index:18. Three .social buttons 43×43 circle,<br>  background rgba(245,249,253,.55); backdrop-filter blur(8px);<br>  hover → background white; outline 2px solid rgba(17,105,220,.18)<br>  SVGs 24×24 fill var(--ink): Instagram (rounded-square + lens + dot),<br>  Facebook, Telegram. data-name = &quot;Instagram&quot; / &quot;Facebook&quot; / &quot;Telegram&quot;.<br><br>.toast — left:50%; bottom:30px; z-index:40; transform:translate(-50%,18px);<br>  padding:11px 18px; border-radius:22px; color:white;<br>  background:rgba(6,25,47,.9); font-size:14px; opacity:0; pointer-events:none;<br>  transition:.24s. .toast.show → opacity:1; transform:translate(-50%,0)<br><br>.menu-panel (shown only when .nav-compact + .menu-open) —<br>  left:calc(var(--fx)+46px); top:86px; width:304px; padding:14px;<br>  display:grid; gap:6px; z-index:30; border:1px solid rgba(255,255,255,.6);<br>  border-radius:26px;<br>  background:linear-gradient(135deg,rgba(255,255,255,.94),rgba(237,246,253,.89));<br>  box-shadow:0 0 18px rgba(255,255,255,.5),inset 0 0 22px rgba(255,255,255,.5),<br>             0 14px 34px rgba(65,94,123,.13);<br>  backdrop-filter:blur(24px); visibility:hidden; opacity:0;<br>  transform:translateY(-12px);<br>  transition:opacity .22s ease,transform .25s ease,visibility .25s<br>  .stage.nav-compact.menu-open .menu-panel → visible, opacity 1, transform none<br>  Links height 60px, padding 0 20px, radius 20px, font-size 19px;<br>    .active → background rgba(214,230,245,.85); box-shadow 0 0 0 2px rgba(17,105,220,.18)<br>    hover → background rgba(214,230,245,.5)<br>  .menu-join full-width 64px pill, margin-top 8px, radius 32px, same glass<br>    styling as .join; its .join-icon is 48×48 with a 26×26 SVG; label 19px.<br>  .stage.nav-compact .nav, .stage.nav-compact .join { display:none }<br><br>════════════════════════════════════════════════════════════════════<br>5. ★ THE SPOTLIGHT REVEAL (the signature mechanic) ★<br>════════════════════════════════════════════════════════════════════<br>Markup:<br>  &lt;div class=&quot;hero&quot; id=&quot;hero&quot;&gt;<br>    &lt;div class=&quot;hero-stack&quot;&gt;<br>      &lt;img class=&quot;hero-front&quot; data-hero-front alt=&quot;White and silver female android&quot;&gt;<br>      &lt;img class=&quot;hero-back&quot;  data-hero-back aria-hidden=&quot;true&quot;&gt;<br>      &lt;canvas class=&quot;hero-mask-canvas&quot; aria-hidden=&quot;true&quot;&gt;&lt;/canvas&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br><br>CSS:<br>  .hero{position:absolute;left:calc(50% - 373px);top:265px;width:600px;<br>        height:759px;z-index:7;pointer-events:none}<br>  .hero img{width:100%;height:100%;object-fit:contain;display:block}<br>  .hero-stack{position:relative;width:100%;height:100%;pointer-events:auto}<br>  .hero-back,.hero-front{position:absolute;inset:0;width:100%;height:100%;<br>        object-fit:contain;display:block;pointer-events:none}<br>  .hero-front{z-index:1;<br>        filter:drop-shadow(12px 17px 24px rgba(35,57,79,.12))<br>               hue-rotate(var(--hero-hue,0deg)) saturate(var(--hero-sat,1));<br>        transition:filter .4s ease}<br>  .hero-back{z-index:2;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;<br>        mask-size:100% 100%;-webkit-mask-size:100% 100%;mask-mode:alpha}<br>  .hero-mask-canvas{position:absolute;inset:0;pointer-events:none;display:none}<br><br>⚠ CRITICAL — the drop-shadow/hue-rotate/saturate filters MUST live on<br>.hero-front, NOT on the .hero parent. A filter on the parent applies<br>drop-shadow to the COMBINED alpha of both layers, so the revealed spotlight<br>blob casts a dark navy rgba(35,57,79) halo into the empty background. Keeping<br>the filter on the front image alone eliminates that artifact.<br><br>JS (IIFE):<br>  const stack=..., back=..., canvas=...;  const ctx=canvas.getContext(&#39;2d&#39;);<br>  const SPOTLIGHT_R = 185;<br>  const mouse={x:-9999,y:-9999}, smooth={x:-9999,y:-9999};<br>  resizeCanvas = () =&gt; { canvas.width=stack.offsetWidth;<br>                         canvas.height=stack.offsetHeight };<br>  call it once + on window resize.<br><br>  stack.addEventListener(&#39;pointermove&#39;, e =&gt; {<br>    const r = stack.getBoundingClientRect();<br>    const sx = stack.offsetWidth  / r.width;      // ⚠ see note below<br>    const sy = stack.offsetHeight / r.height;<br>    mouse.x = (e.clientX - r.left) * sx;<br>    mouse.y = (e.clientY - r.top ) * sy;<br>  });<br>  stack.addEventListener(&#39;pointerleave&#39;, () =&gt; { mouse.x=-9999; mouse.y=-9999 });<br><br>⚠ CRITICAL — the .stage ancestor is CSS-transform-scaled, so<br>getBoundingClientRect() returns RENDERED pixels while mask/canvas coordinates<br>are in the element&#39;s own UNSCALED 600×759 space. You must divide by the scale<br>(offsetWidth/rect.width) or the spotlight will track far away from the cursor.<br><br>  render(x,y):<br>    ctx.clearRect(0,0,canvas.width,canvas.height);<br>    const grad = ctx.createRadialGradient(x,y,0,x,y,SPOTLIGHT_R);<br>    grad.addColorStop(0,   &#39;rgba(255,255,255,1)&#39;);<br>    grad.addColorStop(0.62,&#39;rgba(255,255,255,1)&#39;);    // solid core<br>    grad.addColorStop(0.8, &#39;rgba(255,255,255,0.5)&#39;);  // soft falloff<br>    grad.addColorStop(1,   &#39;rgba(255,255,255,0)&#39;);<br>    ctx.fillStyle = grad;<br>    ctx.beginPath(); ctx.arc(x,y,SPOTLIGHT_R,0,Math.PI*2); ctx.fill();<br>    const url = canvas.toDataURL();<br>    back.style.maskImage = `url(https://medium.com/$%7Burl%7D)`;<br>    back.style.webkitMaskImage = `url(https://medium.com/$%7Burl%7D)`;<br><br>  loop():  // continuous rAF with eased following<br>    smooth.x += (mouse.x - smooth.x) * 0.1;<br>    smooth.y += (mouse.y - smooth.y) * 0.1;<br>    render(smooth.x, smooth.y);<br>    requestAnimationFrame(loop);<br>  loop();<br><br>Behaviour: mask is pure ALPHA (white pixels, varying alpha) so it introduces<br>no colour. At rest the spotlight sits off-canvas at (-9999,-9999) so the arc<br>never touches the canvas → fully transparent mask → back layer completely<br>hidden, only the white android visible. On hover the dark armored variant is<br>revealed inside a soft-edged circle that eases toward the cursor at 10%/frame.<br><br>════════════════════════════════════════════════════════════════════<br>6. INTERACTIONS<br>════════════════════════════════════════════════════════════════════<br>toast helper: say(msg) sets .toast text, adds .show, clears after 1700ms.<br>- Nav links (both .nav a and .menu-panel a): preventDefault, sync .active<br>  across BOTH menus by matching textContent, close menu if open, toast the<br>  link label.<br>- Hamburger: toggles .menu-open on .stage, sets aria-expanded + panel<br>  aria-hidden; when opening in compact mode, rAF-focus the first panel link.<br>  Toast &quot;Menu ready&quot;/&quot;Menu closed&quot;.<br>- Escape key closes the menu and returns focus to the burger.<br>- Capture-phase pointerdown outside panel+burger closes the menu.<br>- Join buttons (.join and .menu-join): toggle label between &quot;Join us&quot; and<br>  &quot;Joined&quot; on BOTH, toast &quot;Welcome to Nival&quot;/&quot;See you soon&quot;.<br>- .play: toggles .active on itself and .awake on #hero, sets aria-pressed,<br>  toasts &quot;Identity activated&quot;/&quot;Identity paused&quot;.<br>- .eye: toggles .awake on #hero, toasts &quot;Previewing live identity&quot;/&quot;Preview paused&quot;.<br>- Avatar gallery: choose(i) wraps modulo 5, sets .active, and writes<br>  hero.style --hero-hue = data-hue + &#39;deg&#39; and --hero-sat = data-sat, toasts<br>  `Identity 01`…`Identity 05` (2-digit padded). .shuffle and .material-next<br>  both call choose(current+1).<br>- Socials: toast `${data-name} selected`.<br><br>&quot;Awake&quot; breathing (must NOT put the coloured shadow on the parent):<br>  .hero.awake{animation:breathe 3.5s ease-in-out infinite}<br>  @keyframes breathe{50%{transform:translateY(-5px)}}<br>  .hero.awake .hero-front{animation:breatheGlow 3.5s ease-in-out infinite}<br>  @keyframes breatheGlow{50%{filter:drop-shadow(10px 15px 34px rgba(16,105,220,.2))<br>    hue-rotate(var(--hero-hue,0deg)) saturate(var(--hero-sat,1.08))}}<br><br>════════════════════════════════════════════════════════════════════<br>7. ENTRANCE ANIMATION (Web Animations API, runs once)<br>════════════════════════════════════════════════════════════════════<br>Blocking script in &lt;head&gt;: if prefers-reduced-motion is NOT reduce, add class<br>&quot;intro&quot; to &lt;html&gt;, plus a 5000ms safety timeout that removes it (so the page<br>can never stay hidden).<br><br>CSS pre-state:<br>  html.intro .headline-line{clip-path:inset(0 -.12em 100% -.12em)}<br>  html.intro .headline-line&gt;*{transform:translateY(.9em)}<br>  html.intro .brand,.menu,.nav,.join,.feature,.hero,.ghost,.robo-o-avatar,<br>    .glass-card,.creator,.material,.avatar,.social{opacity:0}<br>  html.intro .hero{transform:translateY(22px) scale(.99)}<br>  html.intro .robo-o-avatar{transform:scale(.88)}<br>  html.intro .glass-card{transform:translateY(18px)}<br>  html.intro .creator{transform:translateY(10px)}<br>  html.intro .material-pill{transform:translateX(16px)}<br>  html.intro .avatar{transform:scale(.9)}<br>  .hl-rv{display:block}<br>  @media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;<br>    animation:none!important;transition:none!important}}<br><br>Timeline script (bail out if no .intro or no Element.animate):<br>  First wrap line 1&#39;s bare text node in &lt;span class=&quot;hl-rv&quot;&gt; so it can ride<br>  the mask.<br>  near = innerWidth&lt;640 ? .6 : 1   (shorter travel on phones);<br>  px(v) = (v*near).toFixed(2)+&#39;px&#39;<br>  TYPE = cubic-bezier(.16,1,.3,1)   SOFT = cubic-bezier(.22,.61,.36,1)<br>  helper run(els, keyframes, durSec, atSec, staggerSec, easing) using<br>  element.animate({duration:dur*1000, delay:(at+i*stagger)*1000, fill:&#39;both&#39;})<br>  fade(from) = [{opacity:0,transform:from},{opacity:1,transform:&#39;none&#39;}]<br><br>  1. .brand fade(translateY(-10px)) .50s @ .04<br>     .menu  same .50s @ .09 | .nav .55s @ .13 | .join .55s @ .18<br>  2. each .headline-line at .22 + i*.11 :<br>       clipPath inset(0 -.12em 100% -.12em) → inset(-.34em -.12em -.34em -.12em),<br>       950ms, TYPE; and its children translateY(.9em)→none, .95s, TYPE<br>  3. .hero opacity 0 + translateY(px(22)) scale(.99) → none, 1.05s @ .48, TYPE<br>  4. .feature fade(translateX(px(12))) .55s @ .52, stagger .07<br>  5. .ghost opacity 0→1, .90s @ .62, stagger .09<br>     .robo-o-avatar fade(scale(.88)) .62s @ .80, TYPE<br>  6. .glass-card fade(translateY(px(18))) .78s @ .70, TYPE<br>     .creator fade(translateY(px(10))) .60s @ .82<br>  7. .material opacity 0→1 .72s @ .86<br>     .material-pill translateX(px(16))→none .72s @ .86, TYPE<br>     .avatar fade(scale(.9)) .55s @ .94, stagger .06, TYPE<br>     .social fade(translateY(px(9))) .50s @ 1.08, stagger .05<br>  Find the animation with the greatest delay+activeDuration; on its &#39;finish&#39;<br>  remove the .intro class, cancel every animation, and empty the array so the<br>  page becomes completely static.<br><br>════════════════════════════════════════════════════════════════════<br>8. RESPONSIVE — THREE TIERS<br>════════════════════════════════════════════════════════════════════<br>TIER A — desktop/landscape: as specified above (1536×1024 scaled).<br><br>TIER B — .stage.is-mobile (portrait-ish, w/h &lt; 1.05): canvas becomes<br>640×1366 with background radial-gradient(circle at 63% 38%,<br>rgba(249,253,255,.87),transparent 26%),linear-gradient(140deg,#d8e9f6,#d3e4f3)<br>  .header height 88px; .brand left 24 top 31 w56; .menu left 96 top 36 w42<br>    (spans 41px); .join right 16 top 23 w120, label 13px margin-left 7<br>  .headline left 24 top 112 width calc(100% - 48px) font-size 60px<br>    line-height 1.02 letter-spacing -1.8px word-spacing 1px;<br>    first line letter-spacing -2px; .headline-line2 margin-top 14 gap 14<br>    white-space normal; .chain 100×32; line2 &gt; span display block<br>    width calc(100% - 116px)<br>  .features right 24 top 299 w194 font 16 gap 8 (.feature gap 13)<br>  .creator left 24 (right auto) top 322, copy 14px<br>  .ghost-one left 13 top 621 font 142px; .o-gap width 79px;<br>    .ghost-two left 364 top 804 font 104px<br>  .robo-o-avatar left 120 top 623 112×112 border 6px; img left -3 top 4 91×116<br>  .hero left calc(50% - 284px) top 339 568×719<br>  .material right 16 top 775 transform scale(.78) origin right center<br>  .gallery right 16 bottom 278 394×132 display flex gap 12;<br>    .avatar position relative!important inset auto!important 70×70<br>    border-width 5 flex 0 0 70px<br>  .glass-card left 24 top auto bottom 90 width calc(100% - 48px) height 214<br>    padding-left 27; .card-copy 17px max-width 340px; .count margin-left -22;<br>    .card-bottom left auto right 19 bottom 72 width 230; .start margin-right auto<br>  .socials left 24 bottom 28; .toast bottom 28<br>  Container query @container (min-width:900px) on the stage relaxes the mobile<br>  card/gallery: .glass-card width clamp(360px,45%,520px) with original padding,<br>  .card-copy max-width none, .card-bottom back to left 25/right 18/bottom 15<br>  width auto, .count margin-left -20, .gallery right 24 bottom 162 height 70<br>  align-items center.<br><br>TIER C — real phones, @media (max-width:520px) and (orientation:portrait):<br>abandon the scaled canvas entirely and use a natural scrolling CSS GRID.<br>  html,body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}<br>  .viewport{position:relative;inset:auto;min-height:100svh;overflow:visible}<br>  .stage.is-phone{position:relative;left:auto;top:auto;width:100%;height:auto;<br>    min-height:100svh;transform:none;background:transparent;<br>    --gf:clamp(56px,16.5vw,84px); --gm:clamp(112px,33vw,186px);<br>    display:grid;grid-template-columns:1fr auto;<br>    grid-template-areas:&quot;head head&quot; &quot;title title&quot; &quot;creator features&quot; &quot;art art&quot;<br>                        &quot;mat mat&quot; &quot;gal gal&quot; &quot;card card&quot; &quot;soc soc&quot;;<br>    align-content:start;row-gap:clamp(14px,4vw,22px);column-gap:16px;<br>    padding:0 clamp(16px,5vw,24px) clamp(22px,6vw,32px)}<br>  .stage.is-phone&gt;*{position:static;inset:auto;margin:0}  ← unpins everything<br>  .is-phone .header{grid-area:head;position:relative;height:auto;display:flex;<br>    align-items:center;justify-content:space-between;padding:clamp(14px,4vw,20px) 0 0}<br>  .is-phone .brand{position:static;width:clamp(56px,16vw,68px);height:auto;<br>    aspect-ratio:58/21}<br>  .is-phone .menu{position:relative;width:45px;height:19px}<br>    and .menu:after{content:&quot;&quot;;position:absolute;inset:-13px -4px} (touch target)<br>  .is-phone .menu-panel{left:0;right:0;top:calc(100% + 12px);width:auto}<br>  .is-phone .headline{grid-area:title;width:auto;<br>    font-size:clamp(24px,7.3vw,38px);line-height:1.1;margin-top:clamp(4px,2vw,10px)}<br>    lines wrap normally; .headline-line2{display:block;gap:0;margin-top:.04em};<br>    .chain{display:inline-block;vertical-align:-.055em;margin-right:.2em}<br>  .is-phone .creator{grid-area:creator;align-self:start} (verified 17×17,<br>    copy 13px, series 12px margin-top 6px)<br>  .is-phone .features{grid-area:features;font-size:13px;gap:7px;<br>    justify-self:end;align-self:start} (.feature gap 12)<br>  Art layer — .hero, .ghost-one, .ghost-two, .robo-o-avatar ALL share<br>    grid-area:art and are positioned against each other with em units so they<br>    scale together off --gf:<br>      .hero{width:100%;height:auto;max-width:430px;justify-self:center}<br>        and .hero img{height:auto}<br>      .ghost{letter-spacing:-.0476em}; .o-gap{width:.5556em}<br>      .ghost-one{font-size:var(--gf);justify-self:start;align-self:start;<br>        margin-top:var(--gm)}<br>      .ghost-two{font-size:calc(var(--gf)*.87);justify-self:end;align-self:end;<br>        margin-bottom:clamp(24px,8vw,52px)}<br>      .robo-o-avatar{position:relative;font-size:var(--gf);justify-self:start;<br>        align-self:start;margin-top:calc(var(--gm) + .0317em);<br>        margin-left:.7566em;width:.7566em;height:.7566em;border-width:.0423em}<br>      .robo-o-avatar img{left:-.0212em;top:.0265em;width:.6138em;height:.7778em}<br>  .is-phone .material{grid-area:mat;width:100%;height:auto;<br>    margin-top:clamp(30px,10vw,56px)}<br>    .material-pill{position:relative;width:100%;height:clamp(64px,18vw,76px)}<br>    .material-thumb{width:clamp(96px,28vw,126px);height:clamp(122px,36vw,161px);<br>      bottom:0}  and its img{left:-17.7%;top:19.4%;width:119.1%;height:auto}<br>    .material-copy{margin-left:clamp(102px,30vw,134px);width:auto;<br>      font-size:clamp(14px,4vw,16px)}<br>    .material-next{width:clamp(48px,14vw,58px);height:same;margin-right:6px}<br>  .is-phone .gallery{grid-area:gal;width:100%;height:auto;display:flex;<br>    gap:clamp(6px,2.2vw,12px);justify-content:space-between}<br>    .avatar{position:static;width:auto;height:auto;flex:1 1 0;min-width:0;<br>      aspect-ratio:1;border-width:clamp(3px,1.2vw,5px)}<br>  .is-phone .glass-card{grid-area:card;width:auto;height:auto;<br>    padding:14px 20px 20px}<br>    .card-top{height:auto;align-items:center}; .count{margin-left:-14px;<br>    min-width:0;padding:8px 18px 7px}; .eye{width:40px;height:40px;margin:0}<br>    .card-copy{margin-top:clamp(12px,4vw,16px);font-size:clamp(14px,4.1vw,16px)}<br>    .card-bottom{position:static;height:auto;margin-top:clamp(14px,4.5vw,20px)}<br>    .start{font-size:clamp(13px,3.8vw,15px);line-height:1.2}<br>    .start strong{font-size:clamp(16px,4.6vw,19px)}<br>    .shuffle{width:40px;height:40px;margin-right:clamp(10px,4vw,18px)}<br>    .play{width:clamp(48px,14vw,56px);height:clamp(48px,14vw,56px)}<br>  .is-phone .socials{grid-area:soc;display:flex;gap:clamp(12px,4vw,17px)}<br>    .social{width:44px;height:44px}<br>  .is-phone .toast{position:absolute;left:50%;top:auto;bottom:clamp(18px,5vw,26px)}<br><br>════════════════════════════════════════════════════════════════════<br>9. ACCESSIBILITY<br>════════════════════════════════════════════════════════════════════<br>- &lt;main class=&quot;viewport&quot; aria-label=&quot;Nival cyberspace identity experience&quot;&gt;<br>- aria-labels on every icon button; aria-expanded on the burger;<br>  aria-hidden on the menu panel toggled with state; aria-pressed on .play.<br>- .toast has role=&quot;status&quot; aria-live=&quot;polite&quot;.<br>- Decorative nodes (ghost words, chain SVG, robo-o avatar, hero-back, canvas)<br>  get aria-hidden=&quot;true&quot; and/or empty alt.<br>- Visible :focus-visible styles on nav links, avatars, socials, menu items.<br>- Full prefers-reduced-motion guard that disables all animation/transition.<br><br>Deliver ONE complete .html file. Do not reference any local file.</pre><blockquote>ถ้าสนใจเพิ่มเติมแวะไปดูกันได้ มีหลายอย่างให้ใช้เลย</blockquote><blockquote><a href="https://motionsites.ai/">https://motionsites.ai/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_jT-m_7oLF3i9K8WeOTCQ.png" /><figcaption><a href="https://motionsites.ai/">https://motionsites.ai/</a></figcaption></figure><h3>3. ผ่า prompt ระดับ production ทีละส่วน</h3><p>ก่อนจะไปเขียน prompt ของเราเอง ขอเอา prompt จริงมาให้ดูก่อนหนึ่งชิ้น เป็น prompt ที่สั่งสร้างหน้า landing page ชื่อ <strong>“Nival — Cyberspace Identity”</strong> ที่มี feature เด่นคือ <strong>spotlight reveal</strong> — เอาเมาส์ชี้แล้วมันเปิดเผยหุ่นยนต์อีกตัวผ่านวงกลม mask นุ่ม ๆ ที่วิ่งตามเคอร์เซอร์</p><p>prompt นี้ยาวประมาณ <strong>400 บรรทัด</strong> และนี่คือเหตุผลที่มันได้ผล</p><h3>ส่วนที่ 1 — ประกาศ deliverable ให้ชัดในประโยคแรก</h3><pre>Build a single standalone HTML file (no build step, no frameworks, no local<br>assets) for a landing page called &quot;Nival — Cyberspace Identity&quot;. Everything —<br>CSS and JS — must be inline in one file. The signature feature is a<br>cursor-following SPOTLIGHT REVEAL that unmasks a second hero image through a<br>soft radial mask.</pre><p>สองบรรทัดแรกตัดทางเลือกที่ผิดทิ้งหมด: ไฟล์เดียว, ไม่มี build step, ไม่มี framework, ไม่มีไฟล์ local แล้วปิดท้ายด้วย <strong>“signature feature”</strong> — บอกว่าอะไรคือหัวใจของงาน agent จะได้ไม่ไปทุ่มเวลากับส่วนที่ไม่สำคัญ</p><h3>ส่วนที่ 2 — Asset: ให้ URL เป๊ะ ๆ พร้อมบอกว่ามันคืออะไร</h3><pre>════════════════════════════════════════<br>1. ASSET URLS (use these EXACT strings — note the TWO different hosts)<br>════════════════════════════════════════<br>HERO_FRONT (white/silver android, 600×759, base layer):<br>https://.../658f62c6-....png<br><br>HERO_BACK (heavy black/gunmetal armor variant, 1792×2240, reveal layer):<br>https://.../hf_20260914_....png<br><br>Set every &lt;img src&gt; from JS at runtime (leave src=&quot;&quot; in the markup and use<br>data-attributes: data-hero-front, data-hero-back, data-av1…data-av5).</pre><p>สังเกต 3 อย่าง: มี <strong>ขนาดภาพ</strong> กำกับ (agent จะได้คำนวณ layout ถูก), มี <strong>บทบาทของแต่ละภาพ</strong> (base layer / reveal layer), และมี <strong>คำสั่งเชิงเทคนิคว่าจะ set src ยังไง</strong> — ไม่ปล่อยให้เดา</p><h3>ส่วนที่ 3 — Layout model: บอก “ระบบ” ไม่ใช่แค่ “หน้าตา”</h3><pre>3. CORE LAYOUT MODEL — fixed design canvas, scaled to fit<br>This is NOT a flow layout. It is a fixed-size &quot;stage&quot; that is absolutely<br>positioned and CSS-transform-scaled to fit the viewport.<br><br>.stage — width:1536px; height:1024px; --fx:0px; transform-origin:center<br>All children position:absolute and use left:calc(var(--fx) + Npx)<br><br>JS layout() on load and resize:<br>  bh = mobile ? 1366 : 1024<br>  bw = clamp(mobile?560:1060, round(bh*w/h), mobile?1450:2600)<br>  s  = Math.min(w/bw, h/bh)<br>  stage.style.transform = `translate(-50%,-50%) scale(${s})`</pre><p>ประโยค <strong>“This is NOT a flow layout”</strong> คือทองคำ — มันปิดทางที่โมเดลจะ default ไปหา flexbox/grid ธรรมดา แล้วให้สูตรคณิตศาสตร์ตรง ๆ ไปเลย ไม่ใช่ “ทำให้ responsive ด้วย”</p><h3>ส่วนที่ 4 — ค่าที่วัดได้ ไม่ใช่คำคุณศัพท์</h3><pre>.glass-card — left:calc(var(--fx)+46px); top:344px; 365×211;<br>  padding:9px 25px 18px 25px; border:1px solid rgba(255,255,255,.45);<br>  border-radius:24px;<br>  background:linear-gradient(135deg,rgba(255,255,255,.55),rgba(239,247,253,.42));<br>  box-shadow:inset 0 0 22px rgba(255,255,255,.32),0 7px 26px rgba(65,94,123,.045);<br>  backdrop-filter:blur(20px)</pre><p>คนส่วนใหญ่จะเขียนว่า “ใส่การ์ดกระจกสวย ๆ” แล้วได้ผลลัพธ์แบบ template ทั่วไป ส่วน prompt นี้ระบุ <strong>ทุกค่าที่ตาเห็น</strong> ผลคือได้ของที่หน้าตาเหมือนที่คิดไว้ในหัว ไม่ใช่เหมือนที่โมเดลเคยเห็นมา</p><h3>ส่วนที่ 5 — ★ ส่วนที่มีค่าที่สุด: เขียน bug ที่รู้ล่วงหน้าไว้ใน prompt</h3><pre>⚠ CRITICAL — the drop-shadow/hue-rotate/saturate filters MUST live on<br>.hero-front, NOT on the .hero parent. A filter on the parent applies<br>drop-shadow to the COMBINED alpha of both layers, so the revealed spotlight<br>blob casts a dark navy halo into the empty background.<br><br>⚠ CRITICAL — the .stage ancestor is CSS-transform-scaled, so<br>getBoundingClientRect() returns RENDERED pixels while mask/canvas coordinates<br>are in the element&#39;s own UNSCALED 600×759 space. You must divide by the scale<br>(offsetWidth/rect.width) or the spotlight will track far away from the cursor.</pre><p>นี่คือความต่างระหว่างคนที่เคยทำงานนี้มาแล้วกับคนที่ไม่เคย — สอง ⚠ CRITICAL นี้คือ bug ที่ <strong>ต้องเจอแน่นอน</strong> ถ้าปล่อยให้ agent เขียนเอง การเขียนดักไว้ตั้งแต่ต้นประหยัดการ debug ไป 2-3 รอบสบาย ๆ</p><p><strong>ถ้าจะจำอะไรจากบทความนี้ข้อเดียว ให้จำข้อนี้:</strong> prompt ที่ดีไม่ได้บอกแค่ว่าอยากได้อะไร แต่บอกด้วยว่า <strong>รู้อยู่แล้วว่ามันจะพังตรงไหน</strong></p><h3>ส่วนที่ 6 — Algorithm ของ feature หลัก เขียนเป็น pseudo-code</h3><pre>5. ★ THE SPOTLIGHT REVEAL ★<br>  const SPOTLIGHT_R = 185;<br>  const mouse={x:-9999,y:-9999}, smooth={x:-9999,y:-9999};<br><br>  render(x,y):<br>    const grad = ctx.createRadialGradient(x,y,0,x,y,SPOTLIGHT_R);<br>    grad.addColorStop(0,   &#39;rgba(255,255,255,1)&#39;);<br>    grad.addColorStop(0.62,&#39;rgba(255,255,255,1)&#39;);    // solid core<br>    grad.addColorStop(0.8, &#39;rgba(255,255,255,0.5)&#39;);  // soft falloff<br>    grad.addColorStop(1,   &#39;rgba(255,255,255,0)&#39;);<br>    back.style.maskImage = `url(https://medium.com/$%7Bcanvas.toDataURL()})`;<br><br>  loop():  // continuous rAF with eased following<br>    smooth.x += (mouse.x - smooth.x) * 0.1;<br>    render(smooth.x, smooth.y);</pre><p>feature ที่เป็นหัวใจ = เขียน pseudo-code ให้เลย ส่วนที่เหลือปล่อยให้ agent คิดเองได้ <strong>จัดสรรความละเอียดตามความสำคัญ</strong> ไม่ใช่ละเอียดเท่ากันหมด</p><h3>ส่วนที่ 7 — Interaction เขียนเป็นรายการ ไม่ใช่เล่าเป็นเรื่อง</h3><pre>6. INTERACTIONS<br>- Nav links: preventDefault, sync .active across BOTH menus by matching<br>  textContent, close menu if open, toast the link label.<br>- Escape key closes the menu and returns focus to the burger.<br>- Capture-phase pointerdown outside panel+burger closes the menu.<br>- Avatar gallery: choose(i) wraps modulo 5, writes --hero-hue / --hero-sat,<br>  toasts `Identity 01`…`Identity 05` (2-digit padded).</pre><p>แต่ละ bullet = 1 behavior ที่ทดสอบได้ รายละเอียดระดับ “capture-phase” กับ “returns focus to the burger” คือสิ่งที่แยกงาน production ออกจาก demo</p><h3>ส่วนที่ 8 — Motion timeline ระบุเวลาเป็นวินาที</h3><pre>7. ENTRANCE ANIMATION (Web Animations API, runs once)<br>  TYPE = cubic-bezier(.16,1,.3,1)<br>  1. .brand fade(translateY(-10px)) .50s @ .04 | .nav .55s @ .13<br>  2. each .headline-line at .22 + i*.11 : clipPath inset(...) 950ms TYPE<br>  3. .hero opacity 0 + translateY(22px) scale(.99) → none, 1.05s @ .48<br>  4. .feature fade(translateX(12px)) .55s @ .52, stagger .07<br>  Find the animation with the greatest delay+activeDuration; on its &#39;finish&#39;<br>  remove the .intro class and cancel every animation.</pre><p>“smooth animation” ให้ผลสุ่ม ส่วน .55s @ .52 stagger .07 ให้ผลเดิมทุกครั้ง — และท่อนสุดท้าย (cleanup หลัง animation จบ) คือสิ่งที่ทำให้หน้าไม่กิน CPU ต่อไปเรื่อย ๆ</p><h3>ส่วนที่ 9 — Responsive เป็น “ชั้น” และ a11y เป็นข้อบังคับ</h3><pre>8. RESPONSIVE — THREE TIERS<br>TIER A — desktop/landscape: 1536×1024 scaled.<br>TIER B — .stage.is-mobile (w/h &lt; 1.05): canvas 640×1366, ...<br>TIER C — real phones (max-width:520px, portrait): abandon the scaled canvas<br>  entirely and use a natural scrolling CSS GRID with grid-template-areas.</pre><pre>9. ACCESSIBILITY<br>- aria-labels on every icon button; aria-expanded on the burger<br>- .toast has role=&quot;status&quot; aria-live=&quot;polite&quot;<br>- Full prefers-reduced-motion guard that disables all animation/transition</pre><pre>Deliver ONE complete .html file. Do not reference any local file.</pre><p>จบด้วยการทวน deliverable อีกรอบ — ประโยคสุดท้ายของ prompt คือสิ่งที่โมเดลให้น้ำหนักสูง ใช้มันให้คุ้ม</p><h3>4. เทมเพลตเปล่า</h3><p>สรุปโครงจากตัวอย่างข้างบน ก็อปไปเติมได้เลย ใช้ได้กับ Antigravity / Cursor / Claude / Lovable เหมือนกันหมด</p><pre>Build [deliverable ให้ชัด: ไฟล์อะไร กี่ไฟล์ ใช้อะไรได้/ไม่ได้] for [ชื่องาน].<br>The signature feature is [หัวใจของงาน 1 ประโยค].</pre><pre>1. ASSETS / DATA<br>   [URL หรือ path เป๊ะ ๆ + ขนาด + บทบาทของแต่ละชิ้น + จะโหลดยังไง]</pre><pre>2. HEAD / TOKENS<br>   [title, meta, font, CSS variables, palette พร้อมค่า hex]</pre><pre>3. LAYOUT MODEL<br>   [บอกว่า &quot;This is NOT a ___ layout&quot; แล้วอธิบายระบบ + สูตรคำนวณ]</pre><pre>4. ELEMENTS<br>   [ทีละ element: ตำแหน่ง ขนาด สี radius shadow ค่าเป๊ะ ๆ]</pre><pre>5. ★ SIGNATURE FEATURE ★<br>   [pseudo-code ของ algorithm หลัก]<br>   ⚠ CRITICAL — [bug ที่รู้ว่าจะเจอ + วิธีเลี่ยง]</pre><pre>6. INTERACTIONS<br>   [bullet ละ 1 behavior ที่ทดสอบได้]</pre><pre>7. MOTION<br>   [ระบุ duration / delay / stagger / easing เป็นตัวเลข + cleanup]</pre><pre>8. RESPONSIVE<br>   [แบ่งเป็น tier พร้อม breakpoint จริง]</pre><pre>9. ACCESSIBILITY<br>   [aria, focus-visible, prefers-reduced-motion]</pre><pre>DO NOT<br>   [สิ่งที่ไม่อยากเห็น — ข้อนี้คุมผลลัพธ์แน่นกว่าข้อสั่ง]</pre><pre>Deliver [ทวน deliverable]. When done, open the browser yourself, verify at<br>375px and 1440px, fix what breaks, then send screenshots of both.</pre><p>บรรทัดสุดท้ายคือสิ่งที่มีเฉพาะใน Antigravity — <strong>สั่งให้มันเปิดเว็บตรวจเอง</strong> อย่าลืมใส่ทุกครั้ง</p><h3>5. ลงมือ: prompt สร้างเว็บ Resume ด้วย Vite</h3><p>ทีนี้เอาเทมเพลตมาใช้จริง วางทีละชุด รีวิวก่อนไปชุดถัดไป</p><h3>Prompt 0 — วางกติกาถาวร</h3><pre>สร้างไฟล์ AGENTS.md ที่ root แล้วอ่านไฟล์นี้ก่อนทำงานทุกครั้ง:</pre><pre># Project: Personal Resume Site</pre><pre>## Stack (ห้ามเปลี่ยนโดยไม่ถามก่อน)<br>- Vite ล่าสุด + React + TypeScript strict<br>- Tailwind CSS v4 ผ่าน @tailwindcss/vite<br>- motion library ได้ตัวเดียวคือ framer-motion<br>- ห้าม UI library อื่น (MUI, shadcn, bootstrap) เขียน component เอง<br>- ไม่ใช้ router เพราะเป็นหน้าเดียว</pre><pre>## Rules<br>- ห้าม any ห้าม @ts-ignore ติด type ให้แก้ type<br>- เนื้อหาทุกตัวอักษรอยู่ใน src/data/resume.ts ที่เดียว ห้าม hardcode ใน JSX<br>- semantic HTML, heading ไล่ h1 -&gt; h2 -&gt; h3<br>- ทุก animation ต้องเคารพ prefers-reduced-motion<br>- ต้องพิมพ์เป็น PDF A4 ได้</pre><pre>## Definition of Done<br>- npm run build ผ่าน ไม่มี warning<br>- npx tsc --noEmit ผ่าน<br>- เปิด browser ตรวจ 375px และ 1440px ไม่มี horizontal scroll<br>- รายงานพร้อม screenshot ทั้งสองขนาด</pre><pre>สร้างเสร็จแล้วสรุปให้ฉันอ่านว่าเข้าใจอะไรบ้าง แล้วหยุด ยังไม่ต้อง scaffold</pre><h3>Prompt 1 — Scaffold</h3><pre>อ่าน AGENTS.md ก่อน แล้ว scaffold Vite + React + TypeScript ในโฟลเดอร์ปัจจุบัน<br>(ไม่สร้างโฟลเดอร์ย่อยใหม่) ติดตั้ง Tailwind v4 และ framer-motion<br>รัน dev server เปิด browser ยืนยันว่าหน้าขึ้นจริง<br>แล้ว git commit แบบ conventional commits พร้อมบอกเวอร์ชันที่ได้</pre><h3>Prompt 2 — ข้อมูลจริง (ส่วนที่ AI เดาแทนไม่ได้)</h3><pre>สร้าง src/data/resume.ts เป็น single source of truth<br>ประกาศ type ครบทุก field, array เป็น readonly ทั้งหมด</pre><pre>- ชื่อ: [ชื่อ-นามสกุล]<br>- ตำแหน่ง: [เช่น Infrastructure / DevOps Engineer]<br>- ที่อยู่ / อีเมล / GitHub / LinkedIn: [...]<br>- สรุปตัวเอง 2 บรรทัด: [เขียนเป็นผลลัพธ์ที่วัดได้ เช่น &quot;ลดค่า AWS 38% ใน 2 ไตรมาสโดยไม่กระทบ SLA&quot;]<br>- ประสบการณ์: [บริษัท / ตำแหน่ง / ช่วงเวลา / 3 bullet ที่เป็นตัวเลข / stack]<br>- ทักษะแบ่งหมวด: [Infrastructure / Cloud / Languages / Observability]<br>- การศึกษา: [...]</pre><pre>ยังไม่ต้องทำ UI ทำ data layer + type ให้เสร็จ แล้วรัน tsc ยืนยันว่าไม่มี error</pre><h3>Prompt 3 — UI ชุดหลัก (เขียนตามเทมเพลต 9 ส่วน)</h3><pre>Build the resume page UI from src/data/resume.ts. Follow AGENTS.md.<br>The signature feature is a cursor-following soft spotlight that subtly lifts<br>the section the reader is pointing at — quiet, not flashy.</pre><pre>## 1. DATA<br>All strings come from src/data/resume.ts. Zero hardcoded copy in JSX.<br>No images, no icon library, no illustrations.</pre><pre>## 2. TOKENS<br>--bg:#0A0A0B; --fg:#EDEDED; --muted:#8A8A8F; --line:rgba(255,255,255,.09);<br>--accent:#4F8CFF  ← the ONLY accent color in the entire page<br>Font: Inter (400/500/600) from Google Fonts, preconnect + font-display:swap.<br>Headline: weight 600, tracking -0.03em, size clamp(2.75rem, 9vw, 6rem).<br>Body 15-16px / line-height 1.65. Section labels 11px uppercase ls 0.18em.<br>Tabular numbers on every date.</pre><pre>## 3. LAYOUT MODEL<br>This is NOT a card layout. It is a single 860px column with hairline dividers.<br>- Full-viewport hero: name, role, one-line summary, contact links inline. Nothing else.<br>- A 2px fixed progress bar at the very top in --accent, width = scroll %.<br>- Below the fold: each section = sticky 140px label column on the left,<br>  content on the right. Collapses to one column below 768px.<br>- Experience entries are rows separated by 1px --line, never cards.<br>- Footer: the email repeated at clamp(2rem,6vw,4rem) as a mailto link.</pre><pre>## 4. ★ SPOTLIGHT ★<br>On pointermove over the content column, write --mx/--my (px, relative to the<br>column) to that element&#39;s style. Each row uses:<br>  background: radial-gradient(240px circle at var(--mx) var(--my),<br>              rgba(255,255,255,.045), transparent 70%)<br>⚠ CRITICAL — update --mx/--my inside a requestAnimationFrame throttle, never<br>directly in the pointermove handler, or you will force layout on every event<br>and tank INP on mobile.<br>⚠ CRITICAL — the effect must be disabled entirely (no listener attached at<br>all) when prefers-reduced-motion: reduce, and when the pointer is coarse.</pre><pre>## 5. MOTION (framer-motion)<br>- Hero name: per-word fade + 12px rise, 700ms, ease [0.16,1,0.3,1], stagger 60ms.<br>- Rest of hero: fade in 400ms at 400ms delay.<br>- Sections: fade up 16px over 500ms when 20% in view, once only.<br>- Experience row hover: company name shifts to --accent over 200ms.<br>- Links: underline wipes in from the left, 250ms.<br>⚠ CRITICAL — animate transform and opacity only. Never width/height/top/left.</pre><pre>## 6. DO NOT<br>- No emoji, no icons, no photos, no gradients on text, no glassmorphism.<br>- No box-shadow anywhere — separation comes from spacing and hairlines.<br>- No parallax, no cursor follower dot, no typing effect, no 3D, no dark/light toggle.<br>- No &quot;Hire me&quot; CTA, no availability badge, no skill percentage bars.</pre><pre>## 7. COMPONENTS<br>Hero, ProgressBar, SectionRow, ExperienceItem, SkillGrid, Footer — separate files.</pre><pre>## 8. ACCESSIBILITY<br>Semantic landmarks, visible :focus-visible rings in --accent,<br>contrast ratio &gt;= 4.5:1 for body text, full prefers-reduced-motion guard.</pre><pre>Deliver a working dev build. When done, open the browser yourself, check<br>375px and 1440px, fix what breaks, then send me screenshots of both plus a<br>short list of the design decisions you made.</pre><h3>Prompt 3-ALT — โทนสำรอง (Editorial Light)</h3><pre>Same content, same rules, different art direction.<br>## TOKENS  --bg:#FAF9F6; --fg:#14130F; --muted:#6B6862; --accent:#9A3B1B<br>Headline in a serif (Instrument Serif / Newsreader), body in a neutral sans.<br>## LAYOUT  Two columns on desktop: 3fr content / 1fr metadata rail on the right<br>holding location and links. Rule lines between every section. One column on mobile.<br>## MOTION  Minimal: 400ms fade on load, no scroll animation, no spotlight.<br>## DO NOT  No shadows, no radius above 4px, no icons, no dark mode.</pre><h3>Prompt 4 — Performance guardrail</h3><pre>ตรวจว่า motion ที่เพิ่งใส่ไม่ทำลาย performance:<br>1. หาที่ไหนที่ animate ค่าอื่นนอกจาก transform/opacity แล้วแก้ให้หมด<br>2. รายงาน bundle size ของ JS หลัง gzip ถ้าเกิน 120KB ให้เสนอทางลด<br>   โดยไม่ทิ้ง animation หลัก<br>3. font ต้อง font-display: swap และ preconnect ถูกต้อง<br>4. เปิดโหมด prefers-reduced-motion ใน browser แล้วยืนยันเองว่า<br>   spotlight กับ animation หยุดจริง แปะ screenshot มาด้วย</pre><h3>Prompt 5 — Print to PDF</h3><pre>เพิ่มปุ่ม &quot;Download PDF&quot; เรียก window.print() แล้วเขียน @media print:<br>- A4 margin 14mm พื้นขาวตัวอักษรดำ (ธีมมืดห้ามติดไปกับกระดาษ)<br>- ซ่อนปุ่ม, progress bar, spotlight layer และทุกอย่างที่ไม่มีความหมายบนกระดาษ<br>- ปิด animation ทั้งหมดในโหมดพิมพ์<br>- section ห้ามถูกตัดคร่อมหน้า<br>- ลิงก์ภายนอกแสดง URL ต่อท้ายข้อความ</pre><pre>เป้าหมายคือจบใน 1 หน้า A4 เปิด print preview ตรวจเอง ถ้าเกินให้ลด<br>font-size/spacing เฉพาะในโหมดพิมพ์ แล้วตรวจซ้ำจนจบใน 1 หน้าจริง</pre><h3>Prompt 6 — SEO + OG image</h3><pre>1. index.html: title, meta description, canonical, Open Graph, twitter:card<br>   ให้สอดคล้องกับข้อมูลใน src/data/resume.ts<br>2. JSON-LD schema.org/Person (jobTitle, sameAs ชี้ GitHub/LinkedIn, knowsAbout)<br>3. public/robots.txt + public/sitemap.xml<br>4. OG image 1200x630 ที่ public/og.png generate ด้วย Node script จาก resume.ts<br>   ดีไซน์ตามธีมเว็บ: พื้น #0A0A0B ชื่อตัวใหญ่ ตำแหน่ง skill 4 ตัว<br>   เส้น hairline สี #4F8CFF หนึ่งเส้น ไม่มีโลโก้ ไม่มีไอคอน<br>   commit ทั้ง script และไฟล์ภาพ เปิดดูว่าย่อเหลือกว้าง 400px ยังอ่านออก</pre><pre>URL ใช้ placeholder <a href="https://replace_me.vercel.app/">https://REPLACE_ME.vercel.app</a> ไปก่อน</pre><h3>6. Deploy ขึ้น Vercel</h3><h3>Prompt 7 — เตรียมไฟล์ config</h3><pre>เตรียม deploy บน Vercel:<br>1. vercel.json: framework vite, SPA rewrite ไป index.html<br>2. Cache-Control ของ /assets เป็น immutable 1 ปี (มี content hash อยู่แล้ว)<br>3. security headers: X-Content-Type-Options, Referrer-Policy,<br>   Permissions-Policy (ปิด camera/microphone/geolocation),<br>   Strict-Transport-Security และ CSP รัดกุมสำหรับ static site<br>   ใส่ comment กำกับว่า directive ไหนจะพังถ้าเพิ่ม Google Analytics ทีหลัง<br>4. GitHub Actions ไฟล์เดียว: tsc --noEmit + npm run build บน pull request<br>   เปิด npm cache, ใส่ concurrency cancel-in-progress<br>   ไม่ต้อง deploy จาก Actions เพราะจะให้ Vercel ต่อ Git เอง<br>5. .gitignore ให้ครบ</pre><pre>อย่าเพิ่งรัน deploy หยุดรอฉันตรวจก่อน</pre><h3>deploy เอง 3 บรรทัด</h3><pre>npm i -g vercel<br>vercel          # preview ก่อน ได้ URL ชั่วคราวไว้เช็กของจริง<br># บรรทัดล่างนี้เขียนทับ production URL ทันที ไม่มีถามยืนยันซ้ำ<br>vercel --prod</pre><p>หรือ push ขึ้น GitHub แล้วกด Import ที่ Vercel ครั้งเดียว — หลังจากนั้นทุก PR ได้ preview URL อัตโนมัติ และ merge เข้า main = deploy production เอง ระยะยาวควรใช้วิธีนี้</p><h3>Prompt 8 — ไล่แก้จนคะแนนเต็ม</h3><pre>URL production จริงคือ https://&lt;ใส่ URL ที่ Vercel ให้มา&gt;<br>1. แทนที่ REPLACE_ME ทุกจุดด้วย URL นี้<br>2. รัน lighthouse กับ production URL (ไม่ใช่ localhost) ทั้ง mobile และ desktop<br>3. หมวดไหนต่ำกว่า 95 ให้แก้แล้วรันซ้ำจนผ่านครบ 4 หมวด<br>   ห้ามแก้ด้วยการถอด animation ออกทั้งหมด ให้แก้ที่ต้นเหตุจริง<br>4. ยืนยัน security header ด้วย curl -I แล้วแปะผลลัพธ์<br>5. สรุปเป็นตาราง: แก้อะไร คะแนนก่อน-หลังเท่าไหร่</pre><h3>7. Checklist</h3><ul><li>Lighthouse ครบ 4 หมวด ≥ 95 วัดจาก production URL ไม่ใช่ localhost</li><li>เปิด reduced motion แล้ว spotlight และ animation หยุดจริง</li><li>กด Download PDF ได้ A4 หน้าเดียว พื้นขาว ไม่มีปุ่มติดไป</li><li>มือถือเครื่องจริง ไม่มี horizontal scroll</li><li>แปะลิงก์ใน LinkedIn / Line แล้วการ์ด OG ขึ้นถูก</li><li>git log แล้วรู้ว่า agent แก้อะไรไปบ้างทุก commit</li><li>ข้อมูลใน resume จริงทั้งหมด — ไม่มี agent ตัวไหนรับผิดชอบแทนข้อนี้</li></ul><h3>สรุป 5 บรรทัด</h3><ol><li><strong>prompt ยาวไม่ได้แปลว่าเยิ่นเย้อ</strong> — ยาวเพราะมันตัดสินใจแทนเราไว้แล้วทุกจุด</li><li><strong>ระบุตัวเลข ไม่ใช่คำคุณศัพท์</strong> — .55s @ .52 stagger .07 ให้ผลเดิมทุกครั้ง, &quot;smooth&quot; ไม่เคยให้ผลเดิม</li><li><strong>⚠ CRITICAL คือส่วนที่คุ้มที่สุด</strong> — เขียน bug ที่รู้ว่าจะเจอดักไว้ ประหยัดการ debug หลายรอบ</li><li><strong>DO NOT คุมผลลัพธ์แน่นกว่าข้อสั่ง</strong> — เพราะ default ของโมเดลคือ &quot;เว็บ AI ทั่วไป&quot;</li><li><strong>สั่งให้มันเปิด browser ตรวจเองทุกชุด</strong> — นี่คือสิ่งที่ Antigravity มีแล้วเครื่องมืออื่นยังไม่มี</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7409f031f43f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[รู้จัก Hermes Agent: AI Agent โอเพนซอร์สจาก Nous Research ที่ Self-Host เองได้…]]></title>
            <link>https://medium.com/@natiphong.ju/%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%88%E0%B8%B1%E0%B8%81-hermes-agent-ai-agent-%E0%B9%82%E0%B8%AD%E0%B9%80%E0%B8%9E%E0%B8%99%E0%B8%8B%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%AA%E0%B8%88%E0%B8%B2%E0%B8%81-nous-research-%E0%B8%97%E0%B8%B5%E0%B9%88-self-host-%E0%B9%80%E0%B8%AD%E0%B8%87%E0%B9%84%E0%B8%94%E0%B9%89-d3de7c7f473e?source=rss-ad1dd7469c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3de7c7f473e</guid>
            <category><![CDATA[hermes]]></category>
            <category><![CDATA[hermes-agent]]></category>
            <dc:creator><![CDATA[Natiphog.Ju]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 04:37:31 GMT</pubDate>
            <atom:updated>2026-09-14T04:37:31.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>รู้จัก Hermes Agent: AI Agent โอเพนซอร์สจาก Nous Research ที่ Self-Host เองได้ พร้อมวิธีติดตั้งและใช้งานเบื้องต้น</h3><p>ถ้าใครติดตามวงการ AI agent อยู่บ้าง น่าจะเคยได้ยินชื่อ <strong>Nous Research</strong> ทีมที่อยู่เบื้องหลังโมเดลตระกูล Hermes มาก่อน ล่าสุดพวกเขาปล่อย <strong>Hermes Agent</strong> ออกมา ซึ่งเป็น AI agent แบบ open-source ที่เราสามารถรันเองได้ทั้งบนเครื่องส่วนตัว, VM บนคลาวด์, serverless หรือแม้แต่ผูกเข้ากับแอปแชทอย่าง Telegram, Discord, Slack ก็ได้ ในบทความนี้จะพาไปติดตั้งและลองใช้งานเบื้องต้นแบบครบจบในบทความเดียว</p><blockquote>ข้อมูลในบทความนี้อ้างอิงจากเว็บไซต์และเอกสารทางการ ณ วันที่เขียน (กันยายน 2026) เนื่องจากเป็นโปรเจกต์ที่อัปเดตค่อนข้างเร็ว แนะนำให้เช็กเอกสารล่าสุดที่ <a href="https://hermes-agent.nousresearch.com/docs">hermes-agent.nousresearch.com/docs</a> อีกครั้งก่อนติดตั้งจริง</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DdBnvG7pCZdt81DN.png" /></figure><h3>Hermes Agent คืออะไร</h3><p>Hermes Agent คือ AI assistant ที่เน้นแนวคิด “grows with you” นั่นคือมันไม่ได้เป็นแค่แชทบอทที่ตอบคำถามแล้วจบ แต่ถูกออกแบบให้:</p><ul><li>มี <strong>persistent memory</strong> จำบริบทการสนทนา โปรเจกต์ และนิสัยการทำงานของเราข้ามเซสชันได้</li><li>มี <strong>closed learning loop</strong> — สร้าง skill ใหม่ ๆ ขึ้นมาเองแบบ procedural จากงานที่เคยทำสำเร็จ พร้อมระบบค้นหาประวัติการสนทนาแบบ full-text (FTS5)</li><li>ทำงานได้หลายช่องทางผ่าน gateway เดียว ทั้ง CLI, Telegram, Discord, Slack, WhatsApp, Signal และ Email</li><li>รองรับ model provider หลายเจ้า ทั้ง Nous Portal, OpenRouter, OpenAI หรือจะชี้ไป custom endpoint ของตัวเองก็ได้</li><li>ดีพลอยได้หลายรูปแบบ ตั้งแต่รันโลคอลตรง ๆ ไปจนถึง Docker, SSH remote, Singularity, Modal, Daytona หรือ Vercel Sandbox</li><li>เป็น <strong>MIT License</strong> ใช้งานและแก้โค้ดได้อย่างเสรี</li></ul><p>พูดง่าย ๆ คือถ้าใครอยากได้ AI agent ที่ควบคุมข้อมูลเองได้ ไม่ต้องพึ่งบริการ SaaS อย่างเดียว Hermes Agent เป็นตัวเลือกที่น่าสนใจ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsGBpBBqpRwVxga3MNsDJQ.png" /></figure><h3>ข้อกำหนดเบื้องต้น (Requirements)</h3><p>ตัวติดตั้ง (installer) ของ Hermes Agent ค่อนข้างครบในตัว รองรับแพลตฟอร์มหลากหลาย:</p><ul><li>Linux</li><li>macOS</li><li>Windows 10/11 (native ผ่าน PowerShell หรือจะใช้ WSL2 ก็ได้)</li><li>WSL2</li><li>Termux (สำหรับใช้บน Android)</li><li>Nix / NixOS</li></ul><p>จุดที่สะดวกคือ installer จะดึง dependency ที่จำเป็นมาให้ครบ ไม่ว่าจะเป็น Python 3.11, Node.js, uv, ripgrep, ffmpeg และในกรณีของ Windows จะมี portable Git Bash (MinGit ขนาดประมาณ 45MB) แถมมาด้วย โดยไม่ต้องขอสิทธิ์ admin แต่อย่างใด</p><h3>วิธีติดตั้ง Hermes Agent</h3><p>มีให้เลือก 2 แนวทางหลัก คือติดตั้งผ่าน <strong>Desktop App</strong> (ง่ายสุดสำหรับสาย GUI) หรือติดตั้งผ่าน <strong>Terminal/CLI</strong> (เหมาะกับสาย server/infra)</p><h3>แบบที่ 1: Desktop App (macOS / Windows)</h3><p>ดาวน์โหลดตัวติดตั้งจากหน้าเว็บ <a href="https://hermes-agent.nousresearch.com/">hermes-agent.nousresearch.com</a> โดยตรง:</p><ul><li>macOS: Hermes-Setup.dmg</li><li>Windows: Hermes-Setup.exe</li></ul><p>ติดตั้งแบบ double-click ตามปกติ เหมาะกับคนที่ไม่ถนัด command line</p><h3>แบบที่ 2: Command Line (แนะนำสำหรับ Linux/macOS/Server)</h3><p><strong>Linux / macOS / WSL2 / Termux:</strong></p><pre>curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash</pre><p>Windows (native, ผ่าน PowerShell):</p><pre>iex (irm https://hermes-agent.nousresearch.com/install.ps1)</pre><p>หลังติดตั้งเสร็จ ให้ reload shell ก่อน (หรือเปิด terminal ใหม่) แล้วลองเรียกคำสั่ง hermes เพื่อเช็กว่าติดตั้งสำเร็จ:</p><pre># reload shell config ให้ PATH ของ hermes มีผล<br>source ~/.bashrc      # หรือ ~/.zshrc ถ้าใช้ zsh<br><br># เช็กว่าติดตั้งสำเร็จและเรียกใช้ได้<br>hermes --help</pre><p>ถ้าเจอปัญหาระหว่างหรือหลังติดตั้ง มีคำสั่งช่วยวินิจฉัยให้ในตัวอยู่แล้ว:</p><pre>hermes doctor</pre><blockquote><strong>หมายเหตุสำหรับผู้ใช้ Windows:</strong> บาง antivirus (เช่น Windows Defender, Bitdefender) อาจ flag uv.exe เป็นไฟล์น่าสงสัย เพราะเป็น unsigned Rust binary ซึ่งเป็น false positive ที่พบได้บ่อย วิธีแก้คือ whitelist โฟลเดอร์ติดตั้งของ hermes ไว้ เช่นบน Windows Defender ให้รันคำสั่งนี้ใน PowerShell แบบ Admin:</blockquote><pre>Add-MpPreference -ExclusionPath &quot;$env:LOCALAPPDATA\hermes\bin&quot;</pre><h3>ตั้งค่าเริ่มต้น: เลือก Model Provider</h3><p>ก่อนเริ่มคุยกับ agent ได้จริง ต้องตั้งค่า model provider ก่อน วิธีที่ง่ายและครบที่สุดคือใช้ <strong>Nous Portal</strong> ซึ่งรวม OAuth เดียวครอบคลุมทั้งตัวโมเดลและ tool gateway (web search, image generation, TTS, browser) ในทีเดียว:</p><pre>hermes setup --portal</pre><p>หรือถ้าต้องการตั้งค่าแบบละเอียด เลือก provider เอง (เช่น OpenRouter, OpenAI หรือ custom endpoint ของตัวเอง) ให้รัน setup wizard เต็มรูปแบบแทน:</p><pre>hermes setup</pre><p>ระหว่าง wizard จะมีให้ใส่ API key ของ provider ที่เลือก ระบบจะเก็บไว้ใน config ของ hermes เอง (ไม่ต้องไปตั้ง environment variable เองก็ได้ ถ้าใครอยากตั้งผ่าน env var ก็รองรับเช่นกัน) ถ้าอยากเปลี่ยน provider/โมเดลทีหลัง ไม่ต้องรัน setup ใหม่ทั้งหมด ใช้คำสั่งสั้น ๆ นี้พอ:</p><pre>hermes model</pre><h3>ใช้กับ Ollama: รันโมเดลเองแบบ Local ไม่ง้อ API Cloud</h3><p>ถ้าไม่อยากพึ่ง API ของ Nous Portal/OpenRouter/OpenAI แล้วอยากรันโมเดลเองบนเครื่อง (private, ไม่มีค่าใช้จ่ายรายคำขอ) Hermes Agent รองรับ <strong>Ollama</strong> เป็น provider ได้โดยตรง เพราะ Ollama เปิด endpoint แบบ OpenAI-compatible ให้อยู่แล้ว</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RJrkdZIbjA8rabRX.png" /></figure><h3>ขั้นตอนที่ 1: ติดตั้งและรัน Ollama</h3><p>ถ้ายังไม่มี Ollama ในเครื่อง ติดตั้งตามเอกสารของ Ollama เอง (ollama.com) จากนั้นดึงโมเดลที่รองรับ tool calling มาก่อน เช่น:</p><pre>ollama pull qwen2.5-coder:32b</pre><blockquote><strong>สำคัญมาก — เรื่อง context window:</strong> ค่า default ของ Ollama มัก set context ไว้ต่ำมาก (ตั้งแต่ 4k ไปจนถึงหลักแสน token ขึ้นกับ VRAM) แต่ <strong>Hermes Agent ต้องการ context อย่างน้อย 64,000 token</strong> ถึงจะใช้งาน agent พร้อม tools ได้อย่างเสถียร ต้องตั้งค่านี้ก่อนสตาร์ท Ollama:</blockquote><pre>OLLAMA_CONTEXT_LENGTH=64000 ollama serve</pre><p>คำสั่งนี้จะรัน Ollama server ไว้ที่ http://localhost:11434 (มี endpoint OpenAI-compatible อยู่ที่ path /v1)</p><h3>ขั้นตอนที่ 2: ผูก Ollama เข้ากับ Hermes Agent</h3><p>วิธีที่ง่ายที่สุดคือรัน setup wizard แล้วเลือก custom endpoint:</p><pre>hermes model<br># เลือก: Custom endpoint<br># URL: http://localhost:11434/v1<br># API key: เว้นว่างได้ (local ไม่ต้องใช้คีย์)<br># Model: qwen2.5-coder:32b</pre><p>หรือจะตั้งค่าตรง ๆ ผ่านไฟล์ ~/.hermes/config.yaml ก็ได้เช่นกัน:</p><pre>model:<br>  default: qwen2.5-coder:32b<br>  provider: custom<br>  base_url: http://localhost:11434/v1<br>  context_length: 64000</pre><p>ถ้ามีหลาย endpoint local ที่อยากสลับไปมา (เช่นมีทั้งเครื่อง dev และเครื่อง GPU แรง ๆ ในออฟฟิศ) ให้ตั้งเป็น named provider แทน จะสลับสะดวกกว่า:</p><pre>providers:<br>  local:<br>    api: http://localhost:11434/v1<br><br>model:<br>  provider: custom:local<br>  default: qwen2.5-coder:32b</pre><p>แล้วสลับโมเดลกลางบทสนทนาได้ด้วย:</p><pre>/model custom:local:qwen2.5-coder:32b</pre><p>เช็กว่า context ตั้งค่าถูกต้องหรือยัง</p><pre>ollama ps   # ดูคอลัมน์ CONTEXT ว่าตรงกับที่ตั้งไว้ไหม</pre><h3>ปัญหาที่เจอบ่อย</h3><ul><li><strong>Tool calls โผล่มาเป็นข้อความแทนที่จะทำงานจริง</strong> — เกิดจากโมเดล/เซิร์ฟเวอร์ยังไม่รองรับ tool calling ให้เลือกโมเดลที่ tuned มาสำหรับ tool use โดยเฉพาะ (เช่นตระกูล qwen2.5-coder หรือรุ่นที่ระบุว่ารองรับ function calling)</li><li><strong>Connection refused บน WSL2</strong> (กรณีรัน Ollama บน Windows แต่รัน Hermes ใน WSL2) — เปิด mirrored networking ก่อน โดยเพิ่มใน %USERPROFILE%\.wslconfig:</li></ul><pre>  [wsl2]<br>  networkingMode=mirrored</pre><p>แล้ว restart WSL ด้วย wsl --shutdown หรือถ้าไม่อยากเปลี่ยน networking mode ให้ใช้ IP ของ Windows host แทน localhost:</p><pre>  ip route show | grep default | awk &#39;{ print $3 }&#39;<br>  # เอา IP ที่ได้ไปแทน localhost ใน base_url</pre><ul><li><strong>การตอบถูกตัดกลางคัน</strong> — คนละปัญหากับ context เต็ม ต้องไปปรับ output limit ฝั่งเซิร์ฟเวอร์โมเดลเอง (Hermes ไม่มี option ควบคุมส่วนนี้โดยตรง)</li></ul><blockquote><em>นอกจาก Ollama แล้ว Hermes Agent ยังรองรับ self-hosted inference server ตัวอื่นแบบเดียวกัน (ตั้งค่าคล้ายกันมาก) เช่น </em><strong><em>vLLM</em></strong><em>, </em><strong><em>llama.cpp/llama-server</em></strong><em>, </em><strong><em>SGLang</em></strong><em> และ </em><strong><em>LM Studio</em></strong><em> ถ้าใครมี GPU แรง ๆ อยากรีดประสิทธิภาพเต็มที่ ลองดูตัวเลือกพวกนี้เพิ่มเติมได้ที่เอกสาร </em><a href="https://hermes-agent.nousresearch.com/docs/integrations/providers"><em>AI Providers</em></a></blockquote><h3>เริ่มคุยกับ Agent ครั้งแรก</h3><p>พอตั้งค่าเสร็จ ก็เข้าสู่โหมด interactive CLI ได้เลย:</p><pre>hermes</pre><p>คำสั่งนี้จะเปิด terminal interface ให้พิมพ์คุยกับ agent ได้ทันที ลองพิมพ์อะไรง่าย ๆ เพื่อทดสอบก่อน เช่น ให้มันช่วยสรุปไฟล์ในโฟลเดอร์ปัจจุบัน หรือถามอะไรที่ต้องใช้ web search ดูว่า tool ทำงานถูกต้องไหม</p><h3>คำสั่งหลักที่ควรรู้ (นอกวงสนทนา)</h3><pre>คำสั่ง ใช้ทำอะไร<br>hermes #เปิด interactive CLI เพื่อเริ่มคุย<br>hermes setup #รัน configuration wizard แบบเต็ม<br>hermes model #เลือก/สลับ LLM provider และโมเดล<br>hermes tools #เปิด/ปิด tool ที่ agent ใช้ได้<br>hermes gateway #เริ่ม messaging bridge เชื่อมกับ Telegram/Discord/Slack ฯลฯ<br>hermes config set [key] [value] #ตั้งค่า config รายตัว<br>hermes config get [key] #ดูค่า config ปัจจุบัน<br>hermes skills #ดู procedural memory / skill ที่ agent เรียนรู้ไว้<br>hermes update #อัปเดตเป็นเวอร์ชันล่าสุด<br>hermes doctor #ตรวจสอบปัญหาการติดตั้ง</pre><h3>คำสั่งที่ใช้ระหว่างสนทนา (ทั้งบน CLI และแอปแชท)</h3><p>พิมพ์คำสั่งเหล่านี้ต่อท้ายด้วย / ระหว่างคุยกับ agent ได้เลย:</p><ul><li>/new หรือ /reset — เริ่มบทสนทนาใหม่</li><li>/model [provider:model] — สลับโมเดลกลางบทสนทนาโดยไม่ต้องตั้งค่าใหม่</li><li>/personality [name] — ปรับโทนบุคลิกของ agent</li><li>/retry — ให้ agent ตอบใหม่จากคำถามล่าสุด</li><li>/undo — ย้อนกลับข้อความล่าสุด</li><li>/compress — บีบอัด context window เมื่อบทสนทนายาวเกินไป</li><li>/usage — ดูการใช้งาน token/context</li><li>/skills — ดู skill ที่มีให้ใช้ในบทสนทนานี้</li></ul><h3>เชื่อมต่อกับแอปแชท (Telegram, Discord, Slack ฯลฯ)</h3><p>จุดเด่นอย่างหนึ่งของ Hermes Agent คือ “Lives Everywhere” — รันครั้งเดียวแล้วคุยผ่านแพลตฟอร์มไหนก็ได้ โดยใช้ gateway ตัวเดียวกัน วิธีเปิดใช้งาน:</p><pre># ตั้งค่าแพลตฟอร์มที่ต้องการ (เลือกได้จาก Telegram, Discord, Slack, WhatsApp, Signal, Email)<br>hermes gateway setup<br><br># สตาร์ท gateway process ให้ agent เริ่มรอรับข้อความ<br>hermes gateway start</pre><p>หลัง gateway รันแล้ว ให้ไปทักบอทจากแพลตฟอร์มที่ตั้งค่าไว้ (เช่นทัก bot ใน Telegram ที่ผูก token ไว้) ก็จะเริ่มคุยกับ Hermes Agent ตัวเดียวกับที่รันบนเครื่องได้ทันที เหมาะมากถ้าอยากให้ agent ทำงานเบื้องหลังบน server ตลอดเวลา แล้วเราคุยผ่านมือถือ</p><h3>Sandbox: รัน Agent ให้ปลอดภัยขึ้น</h3><p>เพราะ agent สามารถรันคำสั่งหรือเข้าถึงไฟล์แทนเราได้ Hermes Agent จึงรองรับการรันภายใน sandbox หลายรูปแบบ เพื่อจำกัดขอบเขตการเข้าถึงระบบ:</p><ul><li>Local (รันตรงบนเครื่อง ไม่มี sandbox)</li><li>Docker</li><li>SSH (รันบน remote host ผ่าน SSH)</li><li>Singularity</li><li>Modal / Daytona / Vercel Sandbox (สำหรับ deploy แบบ serverless/cloud)</li></ul><p>สำหรับใครที่ต้องการ isolate การทำงานของ agent ออกจากเครื่องหลัก (เช่นให้มันรันโค้ดทดลองในระบบที่แยกออกไป) แนะนำให้เลือก sandbox mode ที่เหมาะกับ workload ของทีมผ่าน hermes setup หรือ config ที่เกี่ยวข้อง แล้วดูรายละเอียด flag เฉพาะของแต่ละ sandbox เพิ่มเติมในเอกสารทางการอีกที เพราะ syntax ปลีกย่อยอาจเปลี่ยนไปตามเวอร์ชัน</p><h3>ย้ายมาจาก OpenClaw</h3><p>ถ้าใครเคยใช้ OpenClaw มาก่อนและอยากย้าย persona, memory, skill, API key และ config ของ messaging platform มาที่ Hermes Agent ทำได้ทั้งแบบอัตโนมัติตอนรัน hermes setup หรือจะสั่งเองก็ได้:</p><pre># ดูก่อนว่าจะ import อะไรบ้าง โดยยังไม่เปลี่ยนแปลงจริง<br>hermes claw migrate --dry-run<br><br># import แบบเต็มรูปแบบ (โต้ตอบทีละขั้นตอน)<br>hermes claw migrate</pre><h3>สรุป</h3><p>Hermes Agent เหมาะกับใครที่อยากได้ AI agent แบบ self-hosted ที่คุมข้อมูลเองได้เต็มที่ ตั้งแต่การเลือก model provider เอง ไปจนถึงการรันบน infra ของตัวเอง (Docker, SSH, Nix ฯลฯ) จุดแข็งที่ต่างจาก chatbot ทั่วไปคือ persistent memory และ learning loop ที่ทำให้ agent “ฉลาดขึ้น” ตามการใช้งาน บวกกับความสามารถเชื่อมเข้ากับแอปแชทที่ทีมใช้อยู่แล้วโดยไม่ต้องเขียน integration เอง</p><p>ขั้นตอนสรุปแบบเร็ว ๆ สำหรับใครอยากเริ่มทันที:</p><pre># 1) ติดตั้ง<br>curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash<br><br># 2) reload shell แล้วตั้งค่า provider ผ่าน Nous Portal (ทางลัดที่ง่ายที่สุด)<br>source ~/.bashrc<br>hermes setup --portal<br><br># 3) เริ่มคุยกับ agent<br>hermes</pre><p>หรือถ้าอยากรันโมเดลเองแบบ local ผ่าน Ollama แทน (ไม่ง้อ API cloud):</p><pre># 1) ติดตั้งและดึงโมเดลผ่าน Ollama พร้อมตั้ง context ให้พอสำหรับ agent<br>OLLAMA_CONTEXT_LENGTH=64000 ollama serve &amp;<br>ollama pull qwen2.5-coder:32b<br><br># 2) ผูกเข้ากับ Hermes Agent<br>hermes model<br># เลือก Custom endpoint -&gt; http://localhost:11434/v1 -&gt; ข้าม API key -&gt; qwen2.5-coder:32b<br><br># 3) เริ่มคุยกับ agent<br>hermes</pre><p>สำหรับรายละเอียดเชิงลึกเพิ่มเติม เช่น การตั้งค่า config file แบบเจาะจง, security model, MCP integration หรือ flag เฉพาะของแต่ละ sandbox แนะนำให้ตามอ่านต่อที่เอกสารทางการ: <a href="https://hermes-agent.nousresearch.com/docs">hermes-agent.nousresearch.com/docs</a> และถ้าติดปัญหาระหว่างใช้งาน ชุมชนของ Nous Research บน Discord (<a href="https://discord.gg/NousResearch">discord.gg/NousResearch</a>) ก็เป็นอีกช่องทางที่ตอบเร็วดี</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3de7c7f473e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ปลุกโจรสลัดแมวให้ตื่นอีกครั้ง: Build & ติดตั้ง OpenClaw บน Linux ในปี 2026]]></title>
            <link>https://medium.com/@natiphong.ju/%E0%B8%9B%E0%B8%A5%E0%B8%B8%E0%B8%81%E0%B9%82%E0%B8%88%E0%B8%A3%E0%B8%AA%E0%B8%A5%E0%B8%B1%E0%B8%94%E0%B9%81%E0%B8%A1%E0%B8%A7%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B8%95%E0%B8%B7%E0%B9%88%E0%B8%99%E0%B8%AD%E0%B8%B5%E0%B8%81%E0%B8%84%E0%B8%A3%E0%B8%B1%E0%B9%89%E0%B8%87-build-%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-openclaw-%E0%B8%9A%E0%B8%99-linux-%E0%B9%83%E0%B8%99%E0%B8%9B%E0%B8%B5-2026-62caca3593fe?source=rss-ad1dd7469c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/62caca3593fe</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[claw]]></category>
            <dc:creator><![CDATA[Natiphog.Ju]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 03:28:19 GMT</pubDate>
            <atom:updated>2026-09-09T03:28:19.823Z</atom:updated>
            <content:encoded><![CDATA[<p>บทความนี้เขียนจากความรู้ ณ ช่วงต้นปี 2026 — ตัว repo เป็นโปรเจกต์ community ที่ไม่ได้อัปเดตบ่อย แต่ก่อนลงมือจริงแนะนำเช็ค README ล่าสุดที่ <a href="https://github.com/pjasicek/OpenClaw">github.com/pjasicek/OpenClaw</a> อีกครั้ง เผื่อ dependency หรือ path เปลี่ยน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xDMP6rSYJs143tFM8eaOMg.png" /></figure><h3>ทำไมต้อง Claw</h3><p>ปี 1997 สตูดิโอ Monolith Productions ปล่อยเกมแพลตฟอร์ม 2D ชื่อ <strong>Captain Claw</strong> — แมวโจรสลัดถือดาบ ล่าขุมทรัพย์ “Ring of Baast” ผ่านด่านที่วาดมือสวยงามระดับ sprite art ชั้นครู เกมนี้ไม่ได้ดังระเบิดเท่า Mario หรือ Sonic แต่กลายเป็น cult classic ที่คนรุ่น 90s จำได้แม่นเพราะดนตรีติดหู และดีไซน์ด่านที่ซ่อนของลับเต็มไปหมด</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*8yn9wwwevzGo6MOK" /></figure><p>ปัญหาคือเกมนี้เขียนด้วย engine เก่าที่รันบน DOS/Win95 แท้ๆ ไม่รอดยุค Windows 64-bit หรือ Linux เลย นี่คือที่มาของ <strong>OpenClaw</strong> — โปรเจกต์ reverse-engineer แล้วเขียน engine ใหม่ทั้งหมดด้วย C++ และ SDL2 ให้รันข้ามแพลตฟอร์มได้ โดยยังคง gameplay และ asset ต้นฉบับไว้ครบ</p><p>ข้อสำคัญที่ต้องเข้าใจก่อนเริ่ม: <strong>OpenClaw คือ engine เปล่าๆ ไม่มี asset เกมมาให้</strong> ผู้เล่นต้องมีไฟล์เกม Claw ต้นฉบับ (ที่ซื้อมาถูกลิขสิทธิ์) มาวางเข้าไปเอง บทความนี้จะพาไล่ตั้งแต่ลง dependency, build จาก source, ไปจนถึงวาง asset ให้เกมรันได้จริงบน Linux</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*TGVFksr7k5u3AlK6.jpg" /></figure><h3>1. เตรียมเครื่อง — ติดตั้ง Dependency</h3><p>OpenClaw ใช้ <strong>CMake</strong> เป็น build system หลัก และพึ่งพา <strong>SDL2</strong> เป็นแกนกลางสำหรับ graphics/audio/input บน Ubuntu/Debian ติดตั้งได้ตามนี้:</p><pre>sudo apt update<br><br># toolchain + build system<br>sudo apt install -y build-essential cmake git pkg-config<br><br># SDL2 stack (graphics, image, audio, font)<br>sudo apt install -y libsdl2-dev libsdl2-image-dev \<br>    libsdl2-mixer-dev libsdl2-ttf-dev<br><br># codec/format libs ที่ engine เรียกใช้<br>sudo apt install -y libmikmod-dev libtinyxml2-dev \<br>    zlib1g-dev libbz2-dev</pre><blockquote>ถ้าใช้ distro อื่น (Fedora/Arch) ชื่อ package จะขึ้นต้นคล้ายกันแต่ syntax คนละแบบ — เช็คใน README ของ repo จะมี mapping ให้แต่ละ distro ไว้แล้ว</blockquote><h3>2. Clone Source พร้อม Submodule</h3><p>โปรเจกต์นี้พึ่งพา external library บางตัวผ่าน git submodule (เช่น tinyxml หรือ dependency เสริมบางตัวที่ vendor ไว้ในโฟลเดอร์ Libraries/) ดังนั้นต้อง clone แบบ --recursive ไม่งั้น build จะพังเพราะหา header ไม่เจอ:</p><pre>git clone --recursive https://github.com/pjasicek/OpenClaw.git<br>cd OpenClaw</pre><p>ถ้า clone แบบธรรมดาไปแล้วนึกออกทีหลัง ให้ตามด้วย:</p><pre>git submodule update --init --recursive</pre><p>3. Build</p><pre>mkdir build &amp;&amp; cd build<br>cmake .. -DCMAKE_BUILD_TYPE=Release<br>make -j$(nproc)</pre><p>-j$(nproc) ใช้ core CPU ทั้งหมด compile ขนานกันให้เร็วขึ้น ถ้าเครื่อง RAM น้อย (ต่ำกว่า 4GB) แนะนำลดจำนวน job ลง เช่น -j2 เพราะ C++ compiler กิน RAM ต่อ job ค่อนข้างเยอะ อาจโดน OOM killer ฆ่าตัว build ระหว่างทาง</p><p>Build เสร็จจะได้ binary ชื่อ OpenClaw อยู่ใน build/ (หรือใน bin/ แล้วแต่เวอร์ชัน CMakeLists)</p><h3>4. หา Asset เกมต้นฉบับ (ขั้นตอนที่คนพลาดบ่อยที่สุด)</h3><p>engine build เสร็จแต่รันไม่ได้ถ้าไม่มีไฟล์เกม สิ่งที่ต้องมีคือชุดไฟล์จากเกม Captain Claw ต้นฉบับ (ไฟล์ประเภท CLAW.exe, RESOURCE.000, RESOURCE.001 ฯลฯ) ซึ่งต้องได้มาจากแผ่นเกมหรือสำเนาที่คุณเป็นเจ้าของถูกลิขสิทธิ์เท่านั้น — โปรเจกต์นี้ไม่แจกจ่าย asset ให้เพราะติดปัญหาลิขสิทธิ์ของ Monolith/Atari</p><p>โครงสร้างโฟลเดอร์ทั่วไปที่ engine คาดหวังจะประมาณนี้:</p><pre>~/.OpenClaw/<br>└── Assets/<br>    ├── CLAW.exe<br>    ├── RESOURCE.000<br>    ├── RESOURCE.001<br>    └── ... (ไฟล์อื่นๆ จากแผ่นเกม)</pre><p>คัดลอกไฟล์เกมทั้งหมดไปวางในโฟลเดอร์นี้ (path จริงอาจต่างกันเล็กน้อยตามเวอร์ชัน ให้เช็ค log ตอนรันครั้งแรก engine มักจะบอกตรงๆ ว่ามันหาไฟล์จาก path ไหน)</p><p>5. รันเกม</p><pre>cd build<br>./OpenClaw</pre><p>ครั้งแรกที่รัน จะมีไฟล์ config (มักชื่อ OpenClaw.ini หรือคล้ายกัน) ถูกสร้างขึ้นมาให้แก้ค่าพวกนี้:</p><pre>[Video]<br>Fullscreen=false<br>ScreenWidth=1280<br>ScreenHeight=720<br><br>[Input]<br>UseGamepad=true</pre><p>ปรับความละเอียดจอ, toggle fullscreen, หรือ map gamepad ได้จากตรงนี้โดยไม่ต้อง rebuild</p><h3>Troubleshoot ที่เจอบ่อย</h3><p><strong>cmake หา SDL2 ไม่เจอ</strong> — ส่วนใหญ่เพราะลง libsdl2-dev ไม่ครบ (ลืม -image, -mixer, -ttf) เช็คด้วย pkg-config --modversion sdl2 ว่าตอบเวอร์ชันมาไหม</p><p><strong>Build error เรื่อง submodule ว่าง / header ไม่เจอ</strong> — เกิดจาก clone ไม่ได้ใช้ --recursive แก้ด้วยคำสั่ง git submodule update --init --recursive ด้านบน แล้ว build ใหม่</p><p><strong>เกมเปิดแล้วจอดำ/ค้าง</strong> — 90% ของเคสนี้คือ asset path ผิด หรือไฟล์ resource ไม่ครบ (ไฟล์เกมต้นฉบับบางเวอร์ชันมีจำนวน RESOURCE.xxx ไม่เท่ากัน) ลอง diff รายชื่อไฟล์กับ list ที่ README กำหนดไว้</p><p><strong>เสียงหาย/หลอน</strong> — บั๊กเก่าที่เคยเกี่ยวกับ libmikmod เวอร์ชันบางตัวเข้ากับ codec เพลง MOD/S3M ของเกมไม่ได้ ลองสลับเวอร์ชัน libmikmod หรือ build แบบ static ตามที่ issue tracker ของ repo แนะนำ</p><h3>ปิดท้าย</h3><p>OpenClaw เป็นตัวอย่างที่ดีของสิ่งที่ community ทำได้เมื่อไม่มีใครดูแลซอฟต์แวร์เก่าต่อ — reverse-engineer engine ให้ฟื้นคืนชีพ โดยเคารพลิขสิทธิ์ asset เดิม ถ้าใครมีแผ่นเกม Claw เก่าเก็บอยู่ในตู้ นี่คือโอกาสดีที่จะปลุกมันขึ้นมารันบน Linux/Windows/macOS สมัยใหม่ได้แบบไม่ต้องง้อ DOSBox</p><p>ใครสนใจ contribute โค้ดหรือ report bug ก็ไปโผล่ได้ที่ issue tracker ของ repo — โปรเจกต์แนวนี้อยู่รอดได้เพราะคนที่ยังคิดถึงเกมเก่าช่วยกันดูแลนั่นแหละ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62caca3593fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สร้างเกม Pixel Art ด้วย AI แล้วเขียนให้เล่นได้บนเว็บด้วย JavaScript (มีโค้ดเต็ม)]]></title>
            <link>https://medium.com/@natiphong.ju/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%81%E0%B8%A1-pixel-art-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-ai-%E0%B9%81%E0%B8%A5%E0%B9%89%E0%B8%A7%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%A5%E0%B9%88%E0%B8%99%E0%B9%84%E0%B8%94%E0%B9%89%E0%B8%9A%E0%B8%99%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-javascript-%E0%B8%A1%E0%B8%B5%E0%B9%82%E0%B8%84%E0%B9%89%E0%B8%94%E0%B9%80%E0%B8%95%E0%B9%87%E0%B8%A1-7ab5dc305f64?source=rss-ad1dd7469c5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab5dc305f64</guid>
            <category><![CDATA[pixel-art]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Natiphog.Ju]]></dc:creator>
            <pubDate>Wed, 09 Sep 2026 02:48:48 GMT</pubDate>
            <atom:updated>2026-09-09T02:50:09.724Z</atom:updated>
            <content:encoded><![CDATA[<p>“สอนสร้างเกมพิกเซลอาร์ตด้วย AI pixel art generator (Sprite Fusion) แล้วเขียนแอนิเมชันแบบเฟรมต่อเฟรมด้วย JavaScript และ Canvas ให้เล่นได้จริงบนเว็บ พร้อมโค้ดเต็มก็อปวางได้เลย”</p><h3>ทำไมต้อง “เฟรม” ไม่ใช่ “เวกเตอร์”</h3><p>เกมพิกเซลคลาสสิกอย่าง Super Mario Bros. หรือ Celeste ไม่ได้ทำให้ตัวละครขยับด้วยการหมุนหรือยืดกระดูก (skeletal animation) แบบเกม 3D สมัยใหม่ แต่ใช้เทคนิคที่เรียบง่ายกว่านั้นมาก คือวาดท่าทางแต่ละท่าเป็นภาพนิ่งทีละภาพ เรียกว่า “เฟรม” (frame) แล้วเก็บรวมไว้ในไฟล์ภาพเดียวที่เรียกว่า <strong>sprite sheet</strong> จากนั้นตอนรันเกมโปรแกรมจะสลับโชว์ทีละเฟรมด้วยความเร็วคงที่ เช่น ท่าวิ่งอาจมี 4 เฟรมสลับกันไปมา ตาเห็นเป็นภาพเคลื่อนไหวเหมือนหนังการ์ตูนสมัยก่อน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tL6HQITdRKMX9v6zXYxUAw.png" /></figure><p>ข้อดีของวิธีนี้คือมันเบามาก ไฟล์ภาพเดียวก็เพียงพอสำหรับทุกท่าทางของตัวละคร และเขียนโค้ดควบคุมได้ง่ายด้วยฟังก์ชันเดียวคือ drawImage ของ Canvas API ที่ตัดภาพบางส่วนจากสไปรต์ชีตมาวาดตามตำแหน่งที่กำหนด ปัญหาเดียวที่เหลืออยู่คือ &quot;แล้วจะเอาเฟรมสวย ๆ มาจากไหนถ้าวาดรูปไม่เป็น&quot; — ตรงนี้แหละที่ AI pixel art generator เข้ามาช่วย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*KfUYouWS86qb90z8wCvSGA.png" /></figure><h3>รู้จัก Sprite Fusion: เครื่องมือสร้างพิกเซลอาร์ตด้วย AI</h3><p><a href="https://www.spritefusion.com/pixel-art-generator">Sprite Fusion</a> เป็นเว็บแอปที่ใช้โมเดล AI ที่เทรนมาเฉพาะสำหรับพิกเซลอาร์ตโดยเฉพาะ (ไม่ใช่เอาโมเดลสร้างภาพทั่วไปมาลดขนาดพิกเซลทีหลัง) จุดเด่นที่ตรงกับงานทำเกมมากคือมันควบคุมขนาดเอาต์พุตแบบพิกเซลจริงได้ตรง ๆ เลือกได้ระหว่าง 16×16, 32×32 หรือ 64×64 พิกเซล, รองรับพื้นหลังโปร่งใส, และสร้างแอนิเมชันจากพรอมต์เดียวได้เลย เช่น พิมพ์ว่า “idle animation” หรือ “walking animation” ต่อท้ายคำอธิบายตัวละคร ระบบก็จะสร้างชุดเฟรมของท่านั้นให้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NkB0ZZEtFZJK-WLyCdu5yA.jpeg" /></figure><p>ขั้นตอนการทำงานคร่าว ๆ ถ้าจะเอาไปใช้กับเกมของตัวเอง:</p><ol><li>เข้าไปที่หน้า AI Pixel Art Generator แล้วอธิบายตัวละครที่ต้องการเป็นข้อความ เช่น “a small robot explorer, blue jacket, transparent background” ไม่ต้องมีพื้นฐานวาดรูปหรือทฤษฎีสีเลย</li><li>เลือกขนาดเอาต์พุต (16/32/64 พิกเซล) ให้ตรงกับสเกลที่จะใช้ในเกม ยิ่งขนาดเล็กยิ่งได้ฟีลลิ่งเกมยุค 8-bit/16-bit ชัดเจน</li><li>กด Generate แล้วดูผลลัพธ์ ถ้าอยากได้ท่าเดินหรือท่ายืนเฉย ให้ใช้ตัวสร้างสไปรต์ชีต (sprite sheet maker) หรือฟีเจอร์ animate เพื่อขอชุดเฟรมของท่านั้นโดยตรง แทนที่จะสร้างทีละภาพนิ่ง</li><li>ใช้ตัวแก้ไขพิกเซลอาร์ตในตัว (built-in pixel editor) แต้มสีแก้รายละเอียดที่ AI วาดไม่ตรงใจได้ทันทีโดยไม่ต้องออกไปเปิดโปรแกรมอื่น</li><li>Export ออกมาเป็นไฟล์ภาพ — ระบบรองรับ one-click export เข้า Unity, Godot, GameMaker อยู่แล้ว แต่สำหรับงานเว็บล้วน ๆ แบบบทความนี้ แค่ export เป็น PNG ธรรมดาก็ใช้ได้เลย เพราะสุดท้ายมันก็คือไฟล์ภาพที่ Canvas API อ่านได้เหมือนกันหมด</li></ol><p>เรื่องราคา ตอนที่เขียนบทความนี้ Sprite Fusion เป็นระบบเครดิตรายเดือน เริ่มต้นที่แพลน Starter ราวเดือนละ 9 ดอลลาร์ (ราคาและจำนวนเครดิตอาจเปลี่ยนแปลง ควรเช็กหน้า Pricing ก่อนสมัครจริง) ถ้าอยากได้แบบไม่ใช้ AI ก็มีเครื่องมือ Pixel Snapper กับ Tilemap Editor ในเครือเดียวกันสำหรับแก้ไฟล์พิกเซลอาร์ตที่มีอยู่แล้วหรือต่อไทล์แมพด้วย</p><blockquote>เกร็ดเล็ก ๆ สำหรับคนที่คุยกับ Claude หรือ AI coding agent อื่นอยู่แล้ว: Sprite Fusion เปิด API ให้ตัวเอเจนต์เรียกสร้างพิกเซลอาร์ตแทนเราได้เลยระหว่างเขียนโค้ด โดยไม่ต้องสลับไปเปิดเว็บเอง — เหมาะกับเวิร์กโฟลว์ที่อยากให้ทั้งโค้ดและอาร์ตออกมาในที่เดียว</blockquote><h3>เตรียมเฟรมให้พร้อมใช้กับเว็บ</h3><p>ไม่ว่าจะได้ไฟล์มาจาก Sprite Fusion หรือแหล่งไหนก็ตาม สิ่งที่ต้องรู้ก่อนเขียนโค้ดมีแค่ 3 อย่าง:</p><ul><li><strong>ขนาดต่อเฟรม (frame width/height)</strong> เป็นพิกเซล เช่น 16×16</li><li><strong>จำนวนเฟรมในแต่ละท่า</strong> เช่น ยืนเฉย 2 เฟรม, วิ่ง 4 เฟรม, กระโดด 1 เฟรม</li><li><strong>ลำดับเฟรมในไฟล์ภาพ</strong> ว่าเรียงแนวนอนจากซ้ายไปขวาหรือเรียงเป็นตาราง</li></ul><p>ถ้าสไปรต์ชีตเรียงเฟรมแนวนอนเป็นแถวเดียว (แบบที่บทความนี้ใช้) การตัดภาพแต่ละเฟรมออกมาแค่คูณลำดับเฟรมด้วยความกว้างต่อเฟรมก็พอ ไม่ต้องใช้ไลบรารีตัดภาพให้ซับซ้อน</p><h3>เขียนเอนจินเกมด้วย Canvas + Vanilla JS</h3><p>หัวใจของเทคนิคทั้งหมดอยู่ที่ drawImage เวอร์ชัน 9 อาร์กิวเมนต์ของ Canvas API ซึ่งให้เราระบุได้ทั้ง &quot;จะตัดภาพจากตรงไหนของสไปรต์ชีต&quot; และ &quot;จะวาดลงตรงไหนของแคนวาส&quot; ในคำสั่งเดียว:</p><pre>ctx.drawImage(<br>  spriteSheet,      // ไฟล์ภาพต้นทาง<br>  frameIndex * FRAME_W, 0, FRAME_W, FRAME_H,  // ตัดเฟรมที่ต้องการจากไฟล์ (sx, sy, sw, sh)<br>  x, y, DRAW_W, DRAW_H                        // วาดลงแคนวาสตรงนี้ ขนาดนี้ (dx, dy, dw, dh)<br>);</pre><p>จากนั้นมีอีกสามส่วนที่ต้องประกอบเข้าด้วยกัน:</p><ol><li><strong>ตัวจับเวลาสลับเฟรม (frame timer)</strong> — เพราะเกมวาดใหม่ทุกเฟรมของหน้าจอ (มักจะ 60 ครั้งต่อวินาที) แต่เราไม่อยากเปลี่ยนท่าเดินเร็วขนาดนั้น จึงนับจังหวะแล้วค่อยขยับไปเฟรมถัดไปทุก ๆ N รอบ:</li></ol><pre>frameTimer++;<br>if (frameTimer &gt;= frameSpeed) {   // frameSpeed ยิ่งน้อยยิ่งขยับไว<br>  frameTimer = 0;<br>  frameIndex = (frameIndex + 1) % sequence.length;<br>}</pre><p><strong>2) state machine ง่าย ๆ</strong> — เลือกชุดเฟรมตามสถานะตัวละคร เช่น ถ้าลอยอยู่กลางอากาศให้ใช้เฟรมกระโดด ถ้าไม่ได้กดอะไรเลยให้ใช้เฟรมยืนเฉย นอกนั้นใช้เฟรมวิ่ง:</p><pre>let sequence = FRAMES.run;<br>if (!player.onGround) sequence = FRAMES.jump;<br>else if (state !== &#39;playing&#39;) sequence = FRAMES.idle;</pre><p><strong>3) ลูปเกม (game loop)</strong> ที่ผูกกับ requestAnimationFrame แทน setInterval เพราะเบราว์เซอร์จะซิงก์กับรอบการวาดจอเองและหยุดทำงานอัตโนมัติเมื่อแท็บไม่ได้โฟกัส ประหยัดแบตบนมือถือด้วย:</p><pre>function loop() {<br>  update();   // คำนวณฟิสิกส์ ตำแหน่ง ชนกัน เลือกเฟรม<br>  render();   // วาดฉากทั้งหมดลง canvas<br>  requestAnimationFrame(loop);<br>}</pre><p>เอาสามส่วนนี้มาต่อกับฟิสิกส์ง่าย ๆ (แรงโน้มถ่วงบวกความเร็วแนวดิ่งทุกเฟรม), การเช็กชนกันแบบกล่องสี่เหลี่ยม (AABB collision), กับการรับอินพุตทั้งคีย์บอร์ดและการแตะจอ ก็ได้เกมที่เล่นได้จริงบนทั้งเดสก์ท็อปและมือถือ</p><h3>ลองเล่นเดโมจริงได้เลย</h3><p>เพื่อไม่ให้บทความนี้เป็นแค่ทฤษฎี ผมเขียนเกมตัวอย่างชื่อ <strong>Pixel Runner</strong> ไว้ให้ลองเล่นจริง ๆ — ตัวละครวิ่งอัตโนมัติ กด Space หรือแตะจอเพื่อกระโดดหลบสิ่งกีดขวางสีแดงและเก็บเหรียญสีทอง ใช้สไปรต์แค่ 7 เฟรม (ยืน 2 / วิ่ง 4 / กระโดด 1) ขนาด 16×16 พิกเซลต่อเฟรมเท่านั้น เพื่อให้เห็นชัดว่าไม่ต้องมีอาร์ตเยอะก็ทำเกมที่ดูมีชีวิตชีวาได้:</p><p><strong>เล่นเดโมได้ที่: </strong><a href="https://regional-green-knxsvbij.edgeone.dev/">https://regional-green-knxsvbij.edgeone.dev/</a></p><p>(สไปรต์ในเดโมนี้เป็นภาพที่ผมวาดโค้ดขึ้นมาเองแบบง่าย ๆ เพื่อสาธิตเทคนิค — ถ้าจะใช้งานจริงแนะนำให้เอาไปแทนที่ด้วยเฟรมที่สร้างจาก Sprite Fusion ตามขั้นตอนด้านบน โครงสร้างโค้ดใช้ต่อได้เลยโดยไม่ต้องแก้อะไรมาก แค่เปลี่ยนค่าคงที่ขนาดเฟรมกับลำดับเฟรมในอาร์เรย์ FRAMES ให้ตรงกับไฟล์ใหม่)</p><h3>โค้ดเต็ม (ก็อปไปวางแล้วรันได้ทันที)</h3><p>โค้ดชุดนี้คือซอร์สที่รันอยู่ในเดโมด้านบนเป๊ะ ๆ เป็นไฟล์ HTML ไฟล์เดียว ไม่ต้องติดตั้งอะไรเพิ่ม เปิดด้วยเบราว์เซอร์ก็เล่นได้ทันที (สไปรต์ฝังเป็น base64 อยู่ในโค้ดแล้ว):</p><blockquote><a href="https://gitlab.com/natiphong.ju/sprites/-/blob/c0651715b2a1e4ccdc786f2697bb63446f5b9ca4/demo.html">https://gitlab.com/natiphong.ju/sprites/-/blob/c0651715b2a1e4ccdc786f2697bb63446f5b9ca4/demo.html</a></blockquote><p>เดโมในบทความนี้ตั้งใจให้เรียบง่ายที่สุดเพื่อโฟกัสที่เทคนิคการสลับเฟรม แต่ยังมีจุดที่ขยายต่อได้อีกเยอะถ้าอยากทำเป็นเกมจริงจังขึ้น: เพิ่มเลเยอร์พื้นหลังเคลื่อนที่คนละความเร็ว (parallax) ให้ฉากมีมิติ, ใส่เสียงเอฟเฟกต์ด้วย Web Audio API ตอนกระโดดหรือเก็บเหรียญ, ทำ physics ให้อิงเวลาจริง (delta time) แทนการนับเฟรมตรง ๆ เพื่อให้ความเร็วเกมเท่ากันไม่ว่าจอจะรีเฟรช 60Hz หรือ 144Hz, หรือใช้ Sprite Fusion สร้างท่าเพิ่ม เช่น ท่าล้ม ท่าโจมตี แล้วขยาย state machine ให้รองรับ</p><p>จุดที่อยากเน้นย้ำคือ ทั้งหมดนี้ไม่ต้องพึ่งเกมเอนจินหรือเฟรมเวิร์กใหญ่ ๆ เลย — แค่ไฟล์ภาพเฟรมสไปรต์กับ JavaScript ล้วน ๆ ก็พาไปได้ไกลกว่าที่คิด และตอนนี้ส่วนที่เคยเป็นคอขวดที่สุดของการทำเกมอินดี้คือ “อาร์ต” ก็มีเครื่องมือ AI มาช่วยลดงานตรงนั้นลงได้มากแล้วด้วย</p><blockquote>ลองเล่นเดโม Pixel Runner ได้ที่ลิงก์ด้านบน แล้วบอกในคอมเมนต์ได้เลยว่าเอาไปต่อเป็นเกมอะไร</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab5dc305f64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>