[{"data":1,"prerenderedAt":202},["ShallowReactive",2],{"blog-index-min":3,"blog:/blog/tech/grid-pulse":41},[4,8,11,14,17,20,23,26,29,32,35,38],{"path":5,"title":6,"titleZh":7},"/blog/tech/the-answer-is-free","The Answer Is Free. Learning Is Not.",null,{"path":9,"title":10,"titleZh":7},"/blog/tech/satisfaction-identifiability","Bad Judges, or Missing Information?",{"path":12,"title":13,"titleZh":7},"/blog/life/tencent-first-months","Six Months at Tencent: Big Company, Startup Heart",{"path":15,"title":16,"titleZh":7},"/blog/life/qinghai-gansu-loop","Three Thousand Kilometers Before We Scatter: A Graduation Trip on the Qinghai–Gansu Loop",{"path":18,"title":19,"titleZh":7},"/blog/life/indonesia-detour","The Indonesia Detour: Volcano Sunrises, Blue Fire, and the Dolphins That Stood Us Up",{"path":21,"title":22,"titleZh":7},"/blog/life/sandwich-communication","The Sandwich Method: How to Give Compliments Without Sounding Like a Corporate Robot",{"path":24,"title":25,"titleZh":7},"/blog/life/2026-aaai-recap","My AAAI 2026 Experience: Research, Connections, and Discoveries in Singapore",{"path":27,"title":28,"titleZh":7},"/blog/life/2025-recap","The Year of the Co-Pilot: A 2025 Retrospective",{"path":30,"title":31,"titleZh":7},"/blog/life/life-is-a-stream","Life is a Stream, not a Staircase",{"path":33,"title":34,"titleZh":7},"/blog/tech/nuxt-with-cloudflare-pages","Overengineering a Simple Blog? My Journey to the Nuxt + Cloudflare Stack",{"path":36,"title":37,"titleZh":7},"/blog/hello-world","Hello World: Unlocking the Output Bottleneck",{"path":39,"title":40,"titleZh":7},"/blog/tech/grid-pulse","Making a Grid Pulse Background Using Pure Tailwind CSS",{"id":42,"title":40,"abstract":7,"body":43,"date":188,"description":189,"descriptionZh":7,"draft":190,"extension":191,"mark":192,"meta":193,"navigation":194,"path":39,"seo":195,"stem":196,"tags":197,"titleZh":7,"__hash__":201},"blog/blog/tech/grid-pulse.md",{"type":44,"value":45,"toc":177},"minimark",[46,51,55,58,61,72,76,79,91,95,98,109,116,120,131,134,145,149,152,155,159,170],[47,48,50],"h2",{"id":49},"the-problem","The Problem",[52,53,54],"p",{},"There is a fine line between a boring website background and one that makes you dizzy. I’ve always been obsessed with that \"digital heartbeat\" aesthetic—the kind of thing you see in sci-fi UI design or cyberpunk dashboards. I wanted my personal site’s index page to feel alive, but I didn't want to spin up a heavy WebGL library or load a massive video file just to set a vibe.",[52,56,57],{},"So, I built a living, breathing grid using nothing but Tailwind CSS and a few lines of vanilla CSS animations. It’s lightweight, it supports dark mode, and it looks like data is flowing through the veins of the browser.",[52,59,60],{},"Here is a demo in action. Notice how the hardware acceleration (will-change) keeps it buttery smooth even when multiple beams cross paths.",[62,63,71],"iframe",{"height":64,"style":65,"scrolling":66,"title":67,"src":68,"frameBorder":66,"loading":69,"allowTransparency":70},500,"width: 100%;","no","Grid Pulse","https://codepen.io/Trevor-Zhang-the-sasster/embed/ogxdqxj?default-tab=html%2Cresult","lazy","true","\n    See the Pen \u003Ca href=\"https://codepen.io/Trevor-Zhang-the-sasster/pen/ogxdqxj\">\nGrid Pulse\u003C/a> by Trevor Zhang (\u003Ca href=\"https://codepen.io/Trevor-Zhang-the-sasster\">@Trevor-Zhang-the-sasster\u003C/a>)\non \u003Ca href=\"https://codepen.io\">CodePen\u003C/a>.\n    ",[47,73,75],{"id":74},"the-foundation-drawing-the-graph-paper","The Foundation: Drawing the Graph Paper",[52,77,78],{},"The first step was creating the actual grid. You might think we need an SVG pattern here, but CSS linear gradients are actually powerful enough to do the heavy lifting. I used Tailwind’s arbitrary value syntax to stack two background images. One gradient draws the vertical lines, and the other draws the horizontal lines.",[52,80,81,82,86,87,90],{},"By setting the size to ",[83,84,85],"code",{},"40px_40px",", we create a repeating pattern. I also set the line color to a very faint gray with ",[83,88,89],{},"rgba(128,128,128,0.1)",". This is crucial because you want the grid to be subconscious context, not the main character. It sits there in the background, providing structure without screaming for attention.",[47,92,94],{"id":93},"the-spark-creating-the-beams","The Spark: Creating the Beams",[52,96,97],{},"A static grid is just graph paper. To make it look like a digital system, we need energy moving through it. This is where the \"beams\" come in.",[52,99,100,101,104,105,108],{},"These aren't complex canvas drawings. They are literally just absolute-positioned ",[83,102,103],{},"divs"," with a very specific background gradient. The magic happens in the ",[83,106,107],{},"bg-gradient-to-r",". We go from transparent, to our primary color, and back to transparent. This creates a \"comet tail\" effect where the beam has a soft leading edge and a fading trail.",[52,110,111,112,115],{},"I also added a ",[83,113,114],{},"blur-[1px]"," and a drop shadow using the same primary color. This gives the beams a glowing, neon quality, like a lightsaber moving across the screen.",[47,117,119],{"id":118},"choreographing-the-chaos","Choreographing the Chaos",[52,121,122,123,126,127,130],{},"If all the beams moved at the same speed, it would look like a screensaver from 1998. To make it feel organic, I created two custom keyframe animations: ",[83,124,125],{},"beam-h"," for horizontal movement and ",[83,128,129],{},"beam-v"," for vertical.",[52,132,133],{},"The animation logic is simple but effective. The beams start off-screen (translated -100%) and invisible. As they travel across the viewport to 100vw or 100vh, I tweak the opacity. They fade in quickly to about 60% opacity and then fade out again before they hit the end. This prevents them from jarringly popping out of existence at the edge of the screen.",[52,135,136,137,140,141,144],{},"I scattered several of these beam divs across the DOM and gave them wildly different ",[83,138,139],{},"animation-duration"," and ",[83,142,143],{},"animation-delay"," values directly in the inline styles. One beam takes 16 seconds to cross the screen; another takes 10. Some wait 3 seconds before starting. This randomness makes the grid feel busy and unpredictable.",[47,146,148],{"id":147},"the-finishing-touch-the-vignette","The Finishing Touch: The Vignette",[52,150,151],{},"Finally, to tie it all together, I slapped a massive radial gradient over the whole thing. It starts transparent in the center and fades to the solid background color at the edges.",[52,153,154],{},"This is a classic photography trick, but in UI design, it serves a functional purpose. It fades the grid lines out as they approach the edge of the screen, making the content in the center the focal point. It stops the grid from looking like an infinite Excel spreadsheet and turns it into a spotlight.",[47,156,158],{"id":157},"why-i-love-this-approach","Why I Love This Approach",[52,160,161,162,165,166,169],{},"What I really dig about this setup is that it respects the user's machine. We are using CSS transforms for the animation, which the browser can offload to the GPU. It’s also completely responsive. Because we used percentages and viewport units (",[83,163,164],{},"vw",", ",[83,167,168],{},"vh","), the grid breathes and resizes whether you are on a massive 4k monitor or a smartphone.",[52,171,172,173,176],{},"If you are using Tailwind, you can drop this right into your main layout file. Just make sure to adjust your ",[83,174,175],{},"primary"," colors in your tailwind config to match your brand, and you instantly add a layer of depth to your UI that static colors just can't compete with.",{"title":178,"searchDepth":179,"depth":179,"links":180},"",3,[181,183,184,185,186,187],{"id":49,"depth":182,"text":50},2,{"id":74,"depth":182,"text":75},{"id":93,"depth":182,"text":94},{"id":118,"depth":182,"text":119},{"id":147,"depth":182,"text":148},{"id":157,"depth":182,"text":158},"2025-11-29","Using pure css to create an elegant grid pulse background, which I use for my homepage.",false,"md","#",{},true,{"title":40,"description":189},"blog/tech/grid-pulse",[198,199,200],"tech","web development","css","uO61hbMp029Rk6bHdFRKz1vOPQu_vvkqsidAPLmrhz0",1794930670478]