১. Try it
<script src="tenten.bundle.js"></script>
<script>
const tt = TenTen.create({ size: 140 });
tt.enter();
tt.say('হাই! আমি টেনটেন');
tt.point('#question', { say: 'এই প্রশ্নটা খেয়াল করো' });
tt.celebrate();
tt.exit();
</script>
Actions queue in order, and each one returns a Promise, so you can await it. Browsers only play sound after the first click or keypress on the page.
২. Where it works
| Any web page | Add tenten.bundle.js and call TenTen.create(). TenTen floats above everything. |
| HTML slides | examples/slides.html: add data-tenten="say:…" on any element and TenTen acts on that slide. Also works with Reveal.js. |
| Over a video (web) | examples/video-overlay.html: tt.sync(video, cues) fires actions at video timestamps and keeps up with seeking. |
| Video editors | Transparent clips in clips/: .mov (ProRes 4444, Premiere / Final Cut / CapCut / Keynote / PowerPoint), .webm (web), .gif (Google Slides / Canva). |
| Static designs | assets/png/ (transparent 512 px) and assets/svg/ for every mood. |
| No coding | Section ৫: a ready-to-copy prompt for ChatGPT, Claude or Gemini |
| Minimal embed | examples/minimal.html |
৩. API
| TenTen.create(opts) | Options: size (140), parent (body, or an element/selector such as a video wrapper), sound (true), volume (0.6), draggable, onClick, start ('offscreen' or {x,y}), side ('right'), clock ('auto' or 'manual' + advance(dt)) |
| enter({from,to}) / exit({to}) | Flies in from the side, or flies off-screen sideways. It never just disappears. |
| flyTo(target) | The target can be an element, a selector, {x,y} in pixels, or {x:'80%',y:'70%'}. It flies in a low arc. |
| point(target,{say}) | Flies beside the element (on whichever side has room), looks at it and draws a pulsing ring around it. |
| say(text,{dur,mood}) | Shows a speech bubble while the eyes glow. The duration defaults to the length of the text. |
| think · wow · happy · sleepy | Shows a ? / ! / squint + blush / z mood for the given duration, then goes back to idle. |
| setMood(name,dur) | idle | happy | think | wow | sleepy |
| hop · nod · shake · spin · blink · celebrate | Short gestures. celebrate adds a sparkle burst and a success sound. |
| look(dir) · lookAt(target) | Moves only the gaze. |
| followTarget(t) · unfollow() | Follows 'mouse' or an element. |
| play(steps) | [['enter'],['say','হাই'],['point','#a'],['exit']] |
| sync(video,cues) | [{ t: 2.5, do: ['say','…'] }] |
| interrupt() | Drops everything still queued, for example when the slide changes. TenTen stays where it is. |
| mute(bool) · destroy() |
৪. Files (share the whole folder)
| tenten.bundle.js | One file with every sound inlined. Use this one. |
| tenten.js | Same code, but loads sounds from assets/sfx/ next to it. |
| assets/sfx/*.mp3 · sfx-wav/*.wav | pop, whoosh, swoosh, blink, peek, chime, ding, success, tick, sting. Made in-house, so free to use. |
| assets/svg · assets/png | Character stills, one per mood |
| clips/ | Transparent animated clips (mov / webm / gif) |
৫. কোডিং ছাড়াই: ChatGPT / Claude / Gemini-এর জন্য রেডি প্রম্পট
- নিচের Copy বাটনে চাপো।
- ChatGPT, Claude বা Gemini-তে পেস্ট করো। শেষের [ ] অংশে লেখো তুমি কী চাও আর তোমার কনটেন্ট দাও।
- AI একটা কোড দেবে। সেটা কপি করে Notepad-এ (Mac-এ TextEdit → Format → Make Plain Text) পেস্ট করো, তারপর
lesson.htmlনামে সেভ করো। - ফাইলটা Chrome-এ খোলো। একবার ক্লিক করো, তাহলে সাউন্ডও চালু হবে।
AI চ্যাটের ভেতরের প্রিভিউতে টেনটেন অনেক সময় দেখা যায় না, কারণ সেখানে বাইরের ফাইল লোড হতে দেয় না। ফাইলটা সেভ করে Chrome-এ খুললে ঠিকমতো চলবে।