{
    "id": "bhaskar/text-reel",
    "kind": "component",
    "title": "Text Reel",
    "summary": "Endless vertical reel of words that speeds up and reverses as you scroll or swipe. Fills its container on phones and desktops.",
    "author": "Admin",
    "stars": 0,
    "url": "https://ownlyplans.com/bhaskar/text-reel/",
    "stack": [
        "CSS",
        "HTML",
        "JavaScript"
    ],
    "tools": [
        "claude-code",
        "cursor",
        "lovable"
    ],
    "difficulty": "beginner",
    "license": "mit",
    "version": "1.0",
    "overview": "Endless vertical reel of words that speeds up and reverses with your scroll. Ported to plain HTML, CSS and JavaScript from ObsidianUI (github.com/Atharvsinh-codez/ObsidianUI), which is released under the MIT License. The original copyright notice is kept in the code.",
    "steps": [],
    "files": [],
    "install": "",
    "how_to_use": "Use the component code (html, css, js, or react) directly, or run the install command.",
    "component": {
        "category": "Text effects",
        "html": "<!--\n  Ported to plain HTML/CSS/JS for OwnlyPlans from ObsidianUI (https://github.com/Atharvsinh-codez/ObsidianUI)\n  MIT License — Copyright (c) 2026 ObsidianUI\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n  documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so, subject to the following conditions:\n  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.\n-->\n\n<div class=\"op-text-stream\" data-label=\"OwnlyPlans\">\n  <p class=\"op-text-stream__prefix\">OwnlyPlans</p>\n  <div class=\"op-text-stream__viewport\" aria-label=\"Rotating words\">\n    <div class=\"op-text-stream__track\"></div>\n  </div>\n  <p class=\"op-text-stream__hint\" aria-hidden=\"true\">Scroll or swipe to speed it up</p>\n</div>",
        "css": "/* Ported from ObsidianUI (MIT License, Copyright (c) 2026 ObsidianUI) */\n.op-text-stream{--bg:#0a0a0a;--ink:#fafafa;--fs:clamp(1.6rem,9.5cqi,4.25rem);container-type:inline-size;box-sizing:border-box;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6rem;width:100%;min-width:0;height:clamp(320px,calc(100vh - 40px),720px);padding:2rem 1rem;overflow:hidden;border-radius:20px;background:var(--bg);color:var(--ink);font-family:Inter,\"Segoe UI\",system-ui,sans-serif;touch-action:pan-x;user-select:none;-webkit-user-select:none}\nhtml[data-stage=light] .op-text-stream{--bg:#ffffff;--ink:#0a0a0a;box-shadow:inset 0 0 0 1px rgba(10,10,10,.08)}\nhtml[data-stage=dark] .op-text-stream{box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}\n.op-text-stream__prefix{margin:0;font-size:clamp(.62rem,2.2cqi,.85rem);font-weight:500;letter-spacing:.28em;text-transform:uppercase;opacity:.42}\n.op-text-stream__viewport{position:relative;width:100%;flex-shrink:0;height:calc(var(--fs) * 2.6);overflow:hidden;text-align:center;-webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 30%,#000 70%,transparent 100%);mask-image:linear-gradient(to bottom,transparent 0%,#000 30%,#000 70%,transparent 100%)}\n.op-text-stream__track{position:absolute;left:0;right:0;top:0;display:flex;flex-direction:column;font-size:var(--fs);font-weight:700;letter-spacing:-.035em;line-height:1.1;will-change:transform}\n.op-text-stream__copy{display:flex;flex-direction:column}\n.op-text-stream__copy>div{padding:.12em 0;white-space:nowrap}\n.op-text-stream__hint{margin:0;font-size:clamp(.6rem,1.8cqi,.75rem);letter-spacing:.06em;opacity:.28}\n@media (prefers-reduced-motion:reduce){.op-text-stream__viewport{display:flex;align-items:center;-webkit-mask-image:none;mask-image:none}.op-text-stream__track{position:relative;transform:none!important}.op-text-stream__copy+.op-text-stream__copy{display:none}.op-text-stream__hint{display:none}}",
        "js": "(function(){\n  var ITEMS=[\"Design Systems\",\"Motion Craft\",\"Interactive UI\",\"Pixel Perfect\",\"Built to Ship\",\"Make it Yours\"];\n  document.querySelectorAll('.op-text-stream').forEach(function(root){\n    var vp=root.querySelector('.op-text-stream__viewport'),track=root.querySelector('.op-text-stream__track');\n    function copy(hidden){var c=document.createElement('div');c.className='op-text-stream__copy';if(hidden)c.setAttribute('aria-hidden','true');ITEMS.forEach(function(t){var d=document.createElement('div');d.textContent=t;c.appendChild(d)});return c}\n    track.appendChild(copy(false));track.appendChild(copy(true));\n    if(matchMedia('(prefers-reduced-motion: reduce)').matches)return;\n    var base=.6,maxBoost=12,y=0,dist=0,v=base,tv=base,lastDir=1,timer=null,last=performance.now(),touchY=null,lastScroll=scrollY;\n    function wrap(min,max,val){var r=max-min;return ((((val-min)%r)+r)%r)+min}\n    function measure(){var first=track.firstChild;dist=first.offsetHeight;if(!dist)return;var need=Math.max(2,Math.ceil(vp.offsetHeight/dist)+2);while(track.children.length<need)track.appendChild(copy(true));while(track.children.length>need)track.lastChild.remove();y=wrap(-dist,0,y)}\n    function boost(delta){if(!delta)return;var dir=delta>0?-1:1;lastDir=dir;tv=dir*Math.min(maxBoost,base+Math.pow(Math.abs(delta),1.2)*.08);clearTimeout(timer);timer=setTimeout(function(){tv=lastDir*base},120)}\n    function tick(now){var f=Math.min(3,(now-last)/(1000/60));last=now;if(dist){v+=(tv-v)*.14;y=wrap(-dist,0,y+v*f);track.style.transform='translate3d(0,'+y+'px,0)'}requestAnimationFrame(tick)}\n    measure();new ResizeObserver(measure).observe(vp);if(document.fonts&&document.fonts.ready)document.fonts.ready.then(measure);\n    addEventListener('wheel',function(e){boost(e.deltaY)},{passive:true});\n    addEventListener('scroll',function(){boost(scrollY-lastScroll);lastScroll=scrollY},{passive:true});\n    root.addEventListener('touchstart',function(e){touchY=e.touches[0].clientY},{passive:true});\n    root.addEventListener('touchmove',function(e){if(touchY==null)return;var ny=e.touches[0].clientY;boost((touchY-ny)*1.5);touchY=ny},{passive:true});\n    root.addEventListener('touchend',function(){touchY=null},{passive:true});\n    requestAnimationFrame(tick);\n  });\n})();",
        "react": "",
        "dependencies": [],
        "install": "",
        "licence_notice": ""
    }
}