Day 05/21: Interactive Canvas & Logic with JavaScript 🖱️✨ Halfway through the first week of my 21-day challenge! Today, I stepped away from standard layouts to build an Interactive Mouse-Tracking Grid. Using dynamic DOM generation and event delegation, I created a "light-trail" effect that follows the cursor across the screen. Technical Highlights of Day 05: Dynamic Grid Generation: Used Math.floor and client dimensions to calculate the exact number of cells needed to fill any screen size perfectly. Proximity Logic: Implemented an index-based check to not only highlight the active cell but also apply a "fade" effect to the surrounding neighbors (Top, Bottom, Left, Right). Mathematical Constraints: Handled edge-case logic using the modulo operator (%) to ensure the light trail doesn't "wrap around" to the other side of the screen accidentally. Asynchronous Cleanup: Utilized setTimeout to manage the lifecycle of the active states, creating a smooth, trailing animation effect. Tech Stack: 🛠️ HTML5 | 🎨 CSS3 (Grid) | ⚡ JavaScript (Event Tracking) Building interactive experiences like this helps me understand how modern web animations and game-like UIs are structured! Check it out here: 🌐 Live Demo: https://lnkd.in/gMhRqxeW 💻 GitHub: https://lnkd.in/gW8a33j2 Devendra Dhote Ritik Rajput #Javascript #CreativeCoding #Frontend #WebDevelopment #21DaysOfCode #CodingChallenge #InteractiveDesign #DOM
More Relevant Posts
-
𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐔𝐩𝐝𝐚𝐭𝐞: 𝐇𝐓𝐌𝐋, 𝐂𝐒𝐒 & 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐈𝐧𝐭𝐞𝐫𝐚𝐜𝐭𝐢𝐯𝐞 𝐁𝐮𝐭𝐭𝐨𝐧 After working on my JavaScript skills, I built a simple yet engaging project -an animated download button using HTML, CSS, and JavaScript. This project focuses on creating a smooth user experience. When the button is clicked, it triggers an animation that visually represents a download process. The button expands, a progress-like effect runs using CSS animations, and after a few seconds, it changes into a “Completed” state with an updated icon. Through this project, I practiced: • DOM manipulation in JavaScript • Event handling • Using setTimeout for timed actions • CSS animations and transitions • Creating interactive UI elements It’s a small project, but it helped me understand how frontend technologies work together to create dynamic and user-friendly interfaces. Below is the link of the project: https://lnkd.in/dGkNSnqW #WebDevelopment #JavaScript #CSS #HTML #CodingJourney #LearnToCode #Programming #DeveloperLife
To view or add a comment, sign in
-
CSS conic gradients. Custom properties. Zero JavaScript. I built a login page where the border rotates continuously—on hover, the card expands smoothly and the form appears. The animation runs entirely on CSS, no frameworks, no scripts. The effect relies on a custom property '--a' animated from 0deg to 360deg, applied to two overlapping 'repeating-conic-gradient' layers. On hover, the inner container transitions inset values, giving the illusion of a seamless reveal. Every detail gradient angle, transition curve, inset shift—was tuned to feel intentional, not just decorative. Video of the interaction is attached. GitHub: https://lnkd.in/g9cZXF8F If you were to push a CSS property to its limit, which one would you choose and why? #CSS #FrontendDevelopment #WebDesign #HTMLCSS #CreativeCoding #WebDevelopment #Coding #Developer
To view or add a comment, sign in
-
Yes, JS-less accordions could not be easier. Including being initially opened or closed, opening and closing separately, allowing only one to be at a time, animating the opening/closing, even customizing and animating the “marker”. All of tgis can be done using just native HTML and CSS. Find examples of all of these variations in the NoLoJS library: https://lnkd.in/gibDtnzU
Author of You Don’t Need JavaScript | Sharing CSS and performance insights with 2,000+ devs via my newsletter
Build smooth accordions. No JavaScript required. The trick lies in the <details> and <summary> elements. They’re semantic, accessible, and work right out of the box. Keyboard support? Built in. Screen readers? Fully supported. So where does the smooth animation come from? CSS Grid. Instead of max-height hacks or JavaScript, you can animate the accordion using grid-template-rows. Here’s the idea. When the accordion is closed, the row height is 0fr. When it opens, it smoothly grows to 1fr. Grid handles that transition perfectly. No timing issues. No clipping. Just fluid motion. The result feels natural, clean, and entirely CSS-driven. If you want to build complex components using only HTML and CSS, I wrote a 126-page ebook to help you level up your CSS skills: 👉 https://lnkd.in/e9qjTXSA
To view or add a comment, sign in
-
-
I Made a Spinning Like Button and It's Simple #frontend #coding #shorts In this project, we build an interactive like button using HTML, Tailwind CSS, and JavaScript. When clicked, the button spins once and toggles between an outline and a filled heart icon. This short tutorial demonstrates how to combine custom CSS animations, event listeners, and DOM manipulation to create smooth, engaging UI interactions. Perfect for beginners learning how to add fun animations to their projects. Features - Interactive like button with toggle effect. - Custom spin animation using CSS keyframes. - Event listener to detect clicks and update the icon. - DOM manipulation to swap between outline and filled images. - Tailwind CSS utilities for layout and transitions. - Beginner‑friendly code with minimal setup. Connect with me YouTube: https://lnkd.in/gAtk9suf LinkedIn: https://lnkd.in/gu-ZN9dB Facebook: https://lnkd.in/gsV-S_sh Instagram: https://lnkd.in/gEUR34hP TikTok: https://lnkd.in/gQvUEgSq GitHub: https://lnkd.in/gTcg6vFt Subscribe for more creative coding demos, Canvas tutorials, and short projects optimized for social platforms 🚀 #javascript #html #tailwindcss #coding #shorts #webdevelopment #frontend #dom #codingforbeginners #learnjavascript #interactiveui #frontendproject #htmlcssjavascript #codingtutorial #simpleprojects #jsbasics #likebutton #creativecoding #webdesign #dynamicui #webdevproject #cssanimation
To view or add a comment, sign in
-
I recently built an **infinite Mandelbrot set zoom** using only **vanilla HTML, CSS, and JavaScript** — no libraries or frameworks, just the math behind it. The animation continuously zooms into **Seahorse Valley**, one of the most detailed regions of the Mandelbrot set. As the zoom goes deeper, the renderer automatically increases the iteration depth so the details keep revealing themselves instead of fading out. A few things that made this possible: → Smooth escape-time coloring with logarithmic normalization → Chunk-based async rendering so the browser stays responsive → Iteration depth that scales with the zoom level → A cyclic sine-wave color palette that subtly shifts as the zoom progresses What fascinates me most about the Mandelbrot set is how **infinite complexity can emerge from a single simple equation:** *z = z² + c* You can try the zoom yourself here 👇 https://lnkd.in/d6jPhfT5 #JavaScript #WebDev #Mathematics #CreativeCoding #Fractals
To view or add a comment, sign in
-
-
🚀 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 & 𝗦𝗵𝗮𝗿𝗶𝗻𝗴 — 𝗣𝗼𝘀𝘁 #𝟭𝟬 🎯 𝗙𝗼𝗰𝘂𝘀𝗲𝗱 𝗗𝗼𝗺𝗮𝗶𝗻: 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁 — 𝗣𝗼𝘀𝘁 #𝟭𝟬 Built a Browser-based 𝗜𝗺𝗮𝗴𝗲 𝗘𝗱𝗶𝘁𝗼𝗿 from scratch — no libraries, no frameworks. Pure HTML, CSS & 𝗩𝗮𝗻𝗶𝗹𝗹𝗮 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁. And honestly, this one taught me more than I expected. 🛠️ 𝗪𝗵𝗮𝘁'𝘀 𝗜𝗻𝘀𝗶𝗱𝗲: ✅ 9 Real-time Filters — brightness, contrast, blur, grayscale, sepia & more ✅ 10 One-click Presets — drama, noir, cyberpunk, vintage & more ✅ Drag & Drop image upload ✅ Live filter preview on Canvas API ✅ Download edited image as PNG ✅ Clean animated dark UI 𝗡𝗼 𝗳𝗶𝗹𝘁𝗲𝗿 𝗹𝗶𝗯𝗿𝗮𝗿𝘆. 𝗡𝗼 𝘀𝗵𝗼𝗿𝘁𝗰𝘂𝘁𝘀. 𝗝𝘂𝘀𝘁 𝘁𝗵𝗲 𝗳𝘂𝗻𝗱𝗮𝗺𝗲𝗻𝘁𝗮𝗹𝘀 — 𝗮𝗻𝗱 𝘁𝗵𝗮𝘁'𝘀 𝘁𝗵𝗲 𝗽𝗼𝗶𝗻𝘁. 💡 𝗪𝗵𝗮𝘁 𝗜 𝗟𝗲𝗮𝗿𝗻𝗲𝗱: Canvas API is something most frontend devs skip — but it's powerful. Drawing images, applying CSS filters programmatically, converting canvas to downloadable PNG — when you do it manually, it actually clicks. Also used 𝗖𝗹𝗮𝘂𝗱𝗲 as my learning partner throughout — not to write code for me, but to understand why each line works. Big difference. Still in my 6th semester, still learning, 𝗰𝗼𝗻𝘀𝗶𝘀𝘁𝗲𝗻𝗰𝘆 𝗶𝘀 𝘁𝗵𝗲 𝗴𝗼𝗮𝗹 — 𝗜𝗻𝘀𝗵𝗮𝗔𝗹𝗹𝗮𝗵. Would love feedback from seniors and fellow devs! 💬 #JavaScript #WebDevelopment #VanillaJS #HTML #CSS #CanvasAPI #ImageEditor #LearningInPublic #Frontend #BuildInPublic
To view or add a comment, sign in
-
I just built my first Image Editor using Vanilla JavaScript + HTML5 Canvas API 🎨 Instead of relying on frameworks, I went fully vanilla, which forced me to understand what’s really happening under the hood. Here are a few key things I learned along the way: 🔹 Canvas Manipulation I learned how to render images onto a <canvas> and apply real-time effects using canvasCtx.filter like Hue-Rotate, Invert, and Blur. 🔹 State Management (without React 😅) Managing 9+ filters manually taught me how state actually works. Every slider change recalculates and rebuilds the entire filter string in real time. 🔹 Dynamic UI Sync Built a preset system (Vintage, Dreamy, etc.) where selecting a preset updates both the image AND all sliders — keeping UI and data perfectly in sync. 🔹 File API & Exporting Handled image uploads and used canvas.toDataURL() to convert the canvas into a downloadable PNG — turning browser work into real output. 🛠 Tech Stack: • JavaScript (ES6+) • HTML5 Canvas API • Custom CSS Variables (Dark Mode) • Remixicon CDN This project gave me a whole new appreciation for tools like Canva and Photoshop — a lot more is happening behind the scenes than we think. 🎥 Check out the demo video below to see it in action! #WebDevelopment #JavaScript #FrontendDevelopment #CanvasAPI #BuildInPublic #LearningByDoing
To view or add a comment, sign in
-
CSS just got served a reality check... and its name is #Pretext. For 30+ years, we've been fighting the same invisible enemy in the browser: DOM text measurement and layout thrashing. Every time you needed accurate multiline text height, wrapping, or dynamic reflow results in expensive reflows, janky animations, laggy scroll, broken masonry, and painful performance hits. This tiny pure #TypeScript/#JavaScript library does multiline text measurement and layout entirely in JS, using the browser’s own font engine as ground truth. No DOM reads. No `getBoundingClientRect()`. No layout thrashing. The result? - Up to ~#500x faster text layout in hot paths - Butter-smooth #120fps animations and real-time text effects - Pixel-perfect accuracy across languages, emojis, RTL, complex scripts - Brand new possibilities: text flowing around shapes, dynamic masonry, game-like UIs, generative interfaces, and more I’ve seen the demos — accordions that actually make sense, message bubbles with zero wasted space, text parting like water around moving objects. If you build UIs, animations, or creative frontends — you need to check this out. Repo: https://lnkd.in/gJuZ2kYK Live Demos: https://lnkd.in/gFcE8pQP #WebDev #JavaScript #TypeScript #Frontend #React #UI #Performance #WebDesign
To view or add a comment, sign in
-
A pure CSS scrolling carousel could potentially remove unnecessary nodes/layers from a web app that otherwise make an application more complex to troubleshoot and more at risk for bottlenecks.
Author of You Don’t Need JavaScript | Sharing CSS and performance insights with 2,000+ devs via my newsletter
Still using JavaScript for an autoplay carousel? You really don’t need to anymore. A one-direction looping logo strip can be pure CSS. No setInterval. No libraries. No layout shifts. The trick is to treat every logo like its own little animation. You define a few custom properties. --width and --height for item size. --quantity for how many items loop. --duration for the full cycle. Then each item gets a --position. That lets you stagger the motion with animation-delay. So the strip starts full right away. No empty gap at load. This is the formula: calc((var(--duration) / var(--quantity)) * (var(--position) - 1) - var(--duration)) The animation itself stays simple. Each item moves from left: 100% to left: -width. You use position: absolute so items animate independently. And overflow: hidden turns the container into a viewport. For nicer visuals, a mask-image gradient fades items in and out. No extra DOM. No performance hit. Accessibility is not an afterthought. Give each logo tabindex="0". Pause the animation on hover or focus with :has(:focus) and animation-play-state: paused. No event listeners. Just CSS doing what used to take a lot of JavaScript. Demo in the comments. Are sliders still a JavaScript job in your stack? If you like this kind of CSS-first component, you’ll probably enjoy my ebook. You Don’t Need JavaScript is 126 pages of practical patterns to build real UI with only HTML and CSS. Get it here: https://lnkd.in/e9qjTXSA
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development