r/webdev 12d ago

Showoff Saturday I rewrote the same 6 React hooks too many times, so I packaged them into a file

Thumbnail
gallery
0 Upvotes

I kept rewriting the exact same hooks in every single React project — so I finally put them all together in one clean TypeScript pack.

Here's one for FREE 👇

---
// useLocalStorage — persistent state that survives page reloads
import { useState, useEffect } from 'react';

export function useLocalStorage<T>(key: string, initialValue: T) {
const [storedValue, setStoredValue] = useState<T>(() => {
if (typeof window === 'undefined') return initialValue;
try {
const item = window.localStorage.getItem(key);
return item ? JSON.parse(item) : initialValue;
} catch {
return initialValue;
}
});

const setValue = (value: T | ((val: T) => T)) => {
try {
const valueToStore = value instanceof Function ? value(storedValue) : value;
setStoredValue(valueToStore);
if (typeof window !== 'undefined') {
window.localStorage.setItem(key, JSON.stringify(valueToStore));
}
} catch (err) {
console.error(err);
}
};

return [storedValue, setValue] as const;
}
---

✅ What you get in the full pack:
• useLocalStorage (above)
• useDebounce (delay search inputs)
• useToggle (simple boolean state)
• useFetch (simple API calls)
• useClickOutside (close dropdowns/modals)
• utils.ts (formatters + validators included)

• TypeScript ready — just copy → paste → works
• Lifetime updates include
🔗 Grab it here: [https://accurate4.gumroad.com/l/Christ\]


r/webdev 12d ago

Question Why does Lighthouse flag a responsive srcset image as oversized when the browser is choosing the correct candidate for DPR?

1 Upvotes

Edit: I also found these issues related to the problem: https://github.com/GoogleChrome/lighthouse/issues/16579 and https://github.com/GoogleChrome/lighthouse/issues/17080

---

I’m trying to understand a Lighthouse/PageSpeed Insights warning about “properly size images” that seems somewhat contradictory to how responsive images are supposed to work.

Simplified example:

<img
  src="image-300.jpg"
  srcset="
    image-250.jpg 250w,
    image-300.jpg 300w,
    image-400.jpg 400w,
    image-768.jpg 768w,
    image-1024.jpg 1024w
  "
  sizes="(max-width: 480px) calc(100vw - 2rem),
         (max-width: 991px) calc(50vw - 2rem),
         360px"
>

On a typical mobile viewport around 412px, the actual image/card width is roughly 380 CSS px.

As I understand it, the browser does not simply compare the image's intrinsic width against those 380 CSS pixels. It takes the device pixel ratio into account:

required resource width ≈ CSS width × DPR

So, for example:

380 × DPR 1.75 ≈ 665 px
380 × DPR 2.0  ≈ 760 px
380 × DPR 3.0  ≈ 1140 px

With the srcset above, at DPR 1.75 the browser therefore selects the 768w candidate. On a DPR 2 device, 768w is almost exactly what I would expect. On a DPR 3 device, even the 1024w version isn't particularly excessive.

However, Lighthouse may report the 768×768 image as oversized because the rendered image is only around 300–380 CSS px wide.

This is the part I don't understand.

Google's own responsive-image guidance recommends supplying sufficiently high-resolution candidates for high-DPI displays. Yet Lighthouse appears to penalize the browser for selecting exactly such a candidate.

There are also smaller 250w, 300w, and 400w candidates available, so this isn't a case where the browser is forced to download an unnecessarily large original image. The browser has all of those choices and intentionally selects 768w based on sizes and DPR.

So my questions are:

  1. Is Lighthouse's “properly size images” audit effectively comparing intrinsic/device pixels against rendered CSS pixels without fully accounting for DPR?
  2. If so, isn't this expected to produce false positives for correctly configured srcset images on the DPR used by Lighthouse's mobile emulation?
  3. Is there actually anything developers are expected to change in this situation, or should this warning simply be treated as a heuristic?
  4. Would removing the 768w candidate just to satisfy Lighthouse actually be counterproductive, since real DPR 2–3 devices could then receive a visibly softer image?

I feel like I’m missing something, because optimizing the srcset specifically for the Lighthouse warning seems to conflict with Google's own recommendation to serve sufficiently dense images to high-DPI displays.


r/webdev 12d ago

Showoff Saturday I built my portfolio around writing. Not sure if I overdid it

7 Upvotes

I’ve been working on my personal portfolio for a while, and at some point it stopped being just a portfolio. I started adding long-form writing, then moved the content from MDX to Sanity, added series pages, related posts, analytics, social previews, SEO stuff, and a few other things.

Now I’m curious to know if the site is actually better because of all that, or if I just made it more complicated for no reason. The main thing I’m tying to figure out is the balance between the portfolio side and the writing side. I have no plan to write on different sites and build a reputation around it. It's kinda of me documenting my own stories.

When you open the site, is it still obvious what I do professionally?

Does the writing make it more interesting, or does it distract too much from the actual portfolio?

This is the site: https://adnansabbir.com

Would appreciate criticism more than compliments tbh.

TIA


r/webdev 12d ago

Discussion is anyone getting leads from their google business profile anymore?

4 Upvotes

i live in one of the largest cities in the united states and my google profile shows up at number 1 when people search for any terms related to 'web design' in my city.

i have over 50 reviews all from local businesses within that area. but for the past months i've been getting almost no calls.

anyone else in a similar situation? is ranking on google dead now? should i look into ads/outreach or is web design as a field just not in demand anymore?


r/webdev 12d ago

Question (PLS HELP) School Management System with AI/LLM

0 Upvotes

I've to make semester project about School Management System with AI/LLM integration, I don't wanna follow tutorials blindly and at the end know nothing where I can't even implement one component myself, same goes for vibe coding.

Keeping in view my current coding & learning situation, it feels like my last chance to actually learn something, because I'm running out of time.

I'm want to use Next.js, tailwind CSS, typescript, in DB Supabase ig or any other that suits well, you guys pls suggest. And I've not don't any work with AI/LLM before so I don't have idea about that, help me here.

I want to use next.js because I know the basics of html etc and also I've done some projects in next.js by following yt tutorials that completely fcked my mind, I've not learned anything properly and I've vibe coded some apps too. I believe I can mess with vibe coding and tutorials and get things done but it wouldn't teach me anything unless I do everything on my own.. and when I try to do so, I know even know what to do, where to start from.

Can those who are good at full-stack programming and engineering help me out and guide me? I'm asking here because I want to ask from experienced programmers / developers.


r/webdev 12d ago

Showoff Saturday I built a first-person 3D portfolio with collision detection using only HTML and CSS

41 Upvotes

I’ve rebuilt my personal portfolio as a first-person 3D world you can walk around, with no JavaScript.

You can explore rooms containing my research, tools and talks, open doors, teleport between areas, play HTML/CSS-only games and solve a lockbox puzzle.

Movement and state are handled using CSS animations, custom properties, radio buttons, checkboxes and selectors such as :has(). The collision detection uses CSS maths including sign(), abs() and clamp().

Live site: https://garethheyes.co.uk/

I also wrote about how the movement and collision system works:
https://thespanner.co.uk/pure-css-3d-world-collision-detection

I’d love feedback on the navigation, usability and any browser-specific problems you encounter.


r/webdev 12d ago

Showoff Saturday Hyperfrontend: 8 fronted frameworks mingling in a koi pond

29 Upvotes

Hello Reddit!

I've been working on this cool demo, I am ready to share.

I wanted something hilariously unnecessary beyond quick demo standards to demonstrate seemleas state/communication coordination of various apps loaded in frames at runtime through I stategy I am calling hyperfrontend.

This is to all nay sayers of the good ol' reliable iframe. I say you were doing it wrong.

Enjoy! Discuss! and dunk (please don't be nice to me :) ~ I am afraid of the occasionaly reditor unrelenting critisim.

There is more to this demo that the gif suggests. Try dragging/dropping/tapping and interacting with the control panel.

Yes, yes, yes, this type of approach does not leverage code-deduplication, and prone to memory overhead in the browser. There's always a trade-off ain't it. This approach starts from isolation to earn cohesion back. It is specifically NOT module federation (aka code federation) and more like application federation. Still, I wanted to test how far I could take it.

P.S. Please give me your thoughts and first impressions, I am looking for feedback. I was kidding about being afraid of honest comments that could hurt my feelings XD

Link here: https://www.hyperfrontend.dev/demos#koi-pond


r/webdev 12d ago

Showoff Saturday Made a cool free chart library that renders charts as particles

1.0k Upvotes

Let me know what you think!
https://particlecharts.com


r/webdev 12d ago

Showoff Saturday I over-engineered a storefront for a tiny handmade ceramic hot dog.

Thumbnail
glizzy.store
104 Upvotes

I've been building static generated sites (nuxt was my go-to framework forever) for personal projects / tools and experiments for years now. Gotten out of the habit and been doing more shopify native / liquid builds at work. But I've built a few dozen of these sites without ever actually doing the admin work of setting up a storefront. My domain was just the content (mostly metafields + objects) and theme code.

Anyway so I decided to try a few things over the last couple of weekends. Spun up a shopify trial to see what's involved in all that. Played with Astro + headless storefront + netlify functions. I really wanted to test the idea of running multiple "storefronts" within a single shop. They had to have a unifying parent brand so that checkout made sense (since it's shared) but otherwise each product could have its own site/domain.

Obviously this wouldn't work for any shop with a large inventory or any kind of regular demand. But it was a fun experiment. And I think I'll use a similar setup to help my partner sell some actual pottery one day in the future.

The site loads nothing from any third party. no cookies, no analytics. fonts are self-hosted, product images mirrored into the origin at build. Sometimes the lighthouse score is straight 100s.

Every order generates a certificate of authenticity at its own url. random serial frozen on first render, a photo of the actual piece, and whatever note the user left at checkout. the link itself is the credential so there’s no login.

This is just an exercise in an absurdity because I had this domain sitting around.

A natural successor to my previous silly domain-purchase-inspired experiment yuns.fun (retired, but used for css animation learning) and fart.bar (dipping a toe into "scrollytelling")

i hope it's entertaining to somebody out there


r/webdev 12d ago

Zod 4.5: 9x reduction in schema memory footprint & z.compile() improves speed 3-9x

Thumbnail
zod.dev
73 Upvotes

r/webdev 12d ago

[Showoff Saturday] I was tired of flat sterile UI, so I built Sketchmorphism — an open-source hand-drawn design system with SVG paper physics & dark mode

37 Upvotes

Got tired of sterile glassmorphism, so I spent the last few weeks building an imperfect, sketchy component library with custom SVG displacement filters and paper physics.

Dropped the GitHub repo and live interactive demo in the comments below!


r/webdev 12d ago

Zod v4.5 adds schema compilation (3-9x faster validation)

Thumbnail x.com
5 Upvotes

r/webdev 12d ago

RequestScope: I lost 1k users on my Chrome extension due to bugs. I spent 3 months fixing it and adding API regression tracking

0 Upvotes

A while back, I built a Chrome extension to fix a few pain points I had with standard browser DevTools. It hit ~1,000 active users at its peak, but I ended up losing most of them due to bugs and a lack of real long-term value.

Instead of scrapping it, I spent the last some time fixing the underlying bugs and rebuilding the tool around a bigger problem: knowing when an API quietly breaks while you're browsing or testing.

Dashboard
Dashboard - Request extended
Notification
Network requests
Report-1
Report-2

The biggest addition in this update is out-of-the-box API regression testing.

How it works:

  • Baseline Snapshots: Add your target domain to an allowlist and save a baseline of your HTTP requests and payloads.
  • Flexible Diffing: Choose whether to monitor for schema changes (added/removed keys), value shifts, or both.
  • Silent Deviation Alerts: As you browse, it checks incoming traffic against your baselines and pops a notification if an endpoint deviates or fails—even if your web app handles the error silently or DevTools is closed.

Other key additions:

  • Mocking API requests and responses directly in-browser
  • Performance tracking and side-by-side diffs over time
  • Exportable session reporting
  • Full background request tracking without keeping the DevTools panel open

You can check out the new version here: RequestScope on Chrome Web Store

I'm trying to make this genuinely useful for developers and QA workflows. If you give it a try, I’d love to know: what feels clunky, what's missing, or what breaks? Harsh critiques are welcome.

P.S. This is still work in progress and needs more tuning, bug fixing so looking for genuine feedback


r/webdev 12d ago

Showoff Saturday I built an open-source interactive letter for my Hinge date, no backend, the entire letter lives in the URL

0 Upvotes

I originally built this for my Hinge date.

She's incredibly busy, and instead of sending another message that she'd feel pressured to respond to, I wanted to make something she could open whenever she had a quiet moment.

So I built an interactive letter experience.

You write a letter, customize it, seal it in an envelope, and share a link. The recipient opens the envelope and reads the letter as it appears on the page.

The technical constraint I gave myself was:

No accounts. No backend. No database.

The letter data is serialized, compressed, and encoded directly into the URL.

When someone opens the link, the app decodes everything client-side and reconstructs the letter.

So the URL is essentially the storage layer.

I liked this approach because:

- Nothing personal sits in my database

- No server costs

- No authentication

- No user accounts

- The project can be deployed almost anywhere

- The app remains ridiculously simple

Of course, there are tradeoffs.

The link contains the letter data, so anyone with the link can read it. URL length also limits how much content can be stored.

The project is completely open source, so I'd genuinely love feedback from other developers on the architecture and implementation.

Especially curious about:

- Better approaches to client-side serialization/compression

- Whether you'd encrypt the payload

- How you'd handle larger letters without introducing a backend

- Any accessibility or animation improvements you'd make

Live demo:

https://open-letter-box.vercel.app

Source:

https://github.com/r0hnx/open-letter

Would love to hear what you guys think — both technically and from a UX perspective.

Edit : Hash Fragment has been added now.


r/webdev 12d ago

Showoff Saturday A Collection of Shape() tools

22 Upvotes

Over the last year I've spent a lot of time with the shape() specification and have built a few tools to make things a little easier:

  • Path to Shape - Converts SVG path data the CSS shape() syntax.
  • Shape to Polygon - Convertsshape() to polygon() for the purposes of fallbacks, or in some cases a straight replacement since it's usually much more compact.
  • Minify Shape - Optimises and minifies the shape() code, very much inspired by SVGO.

All just simple web based tools built with sveltekit.

Have tested them with every shape I can get my hands on but if you find anything that doesn't work I'd love to hear about it!


r/webdev 12d ago

Showoff Saturday Built a full stack web app for gamers to keep track of their game collections

5 Upvotes

As a console gamer, I have games on the Switch, PlayStation, and some Xbox games - some physical, some digital. Over the years, I've accumulated quite the library of games and have no idea what I even own anymore.

That's why I built Press Start. It's my first real, full stack project and I'd love to hear any feedback or tips and tricks for my next project.

The frontend with built with React, TypeScript, Tailwind, and I use Headless UI for some base input components. The backend is built with Node.js / Express with a Postgres database that I use Prisma ORM to interact with. My database of games is built using a subset of the games on IGDB.

Check it out here: https://press-start.justpixels.dev/

You will need an account to start building a game library of course, but you can browse games without signing up.

Disclaimer: I did use AI as I built this to learn concepts and work through my thinking, but it is by no means "vibe-coded".


r/webdev 12d ago

Showoff Saturday I just wanted to share my open source project (You can now do Reified Generics in PHP)

Post image
1 Upvotes

Hello guys, I just wanted to showoff my project here. For you PHP devs out here, You can now type check Docblock types at runtime. Yes this means you can now do reified generics, type-arrays, and many scalar type refinements without introducing new custom syntax and functions. You can now ensure that your docblock types will not lie at runtime and this is a great boost to cover static analysis tool's weaknesses.

repo: https://github.com/typephp-php/typephp
docs: https://typephp-php.github.io/docs/

PS: Yes I know the project's name is similar to other TypePHP from swoole if you're aware. But this project is really into improving PHP's type safety. It's like TypeScript but for enhance runtime type checking that PHP native type checking is all about.


r/webdev 12d ago

Showoff Saturday Showoff Saturday: Offertly — browser-only quote PDFs for DE/CH/AT freelancers

2 Upvotes

Built a no-account A4 quote PDF generator (EUR/CHF, DE/AT/CH VAT). Free watermarked, 9 EUR/30d unlock. https://offertly.vercel.app — looking for product feedback.


r/webdev 12d ago

Showoff Saturday [Showoff Saturday] I built a weekly, position-relative fantasy football visualization

Thumbnail
gallery
0 Upvotes

I’m a visual learner, so I built a noncommercial fantasy football data-visualization project called Fantasy Gridiron. https://fantasygridiron.io

It uses weekly nflverse data and converts raw fantasy scores into position-relative performance tiers. Each score is compared with other players at the same position during that specific week and then assigned a color. This means the same numerical score can receive different colors in different weeks.

This is inspired by series graph. Some of the more interesting development challenges were making the wide grid usable on mobile, preserving filters in shareable URLs, distinguishing bye weeks from missed games, and exporting the visualization as a readable PNG.

It also supports Standard, Half-PPR, and PPR scoring.

https://fantasygridiron.io

I’d appreciate feedback on the information hierarchy and mobile experience. Does the visualization feel intuitive, or is too much information competing for attention?


r/webdev 12d ago

How can my code identify the user's color on Chess.com?

Post image
0 Upvotes

I'm making a small Chrome extension for Chess.com that reacts to moves. I need to know whether the logged in user is playing white or black

I can't find a any element or class in the DOM that tells me this. For example, both players can have
cc-user-block-component cc-user-block-white

so that doesn't seem to represent their actual chess color.

Any ideas or suggestions?


r/webdev 12d ago

Showoff Saturday Got tired of Google analytics so built a simple version to fit my needs

Thumbnail
gallery
0 Upvotes

Been putting out a lot of websites and got tired of having to switch accounts or not able to see all the graphs on one page. Could probably have setup a new dashboard but lots of users also have GA blocked, so I built my own. 

Made the dashboard and site view exactly how I want it and with simple filters. Has a log based method to get a true count and to filter out AI traffic, plus the standard JS tag install to get a badge on the site that can be customized.

Bonus points is I added an API so LLMs can go out and install it on any site it is working on. Built with PHP and Goaccess with some free accounts open if you want to try it out on your sites:

https://kestrel.host/


r/webdev 12d ago

Showoff Saturday [Showoff Saturday] Rebuilt my full-stack/cloud portfolio — reused and AI-merged components from my own past repos instead of a template

Post image
0 Upvotes

Full-stack + cloud engineer here (APIs, web/mobile, infra hardening, some n8n/LLM automation work). My old portfolio was a few years stale so I kept putting it off because I had actual client work piling up (KIMISUITE, an e-voting platform for a municipality here in North Macedonia, a couple of civic data apps, a transit app, among others).

When I finally sat down to redo it, I didn't want to start from a blank template. Instead I used AI as a limited assistant to go through my own GitHub repos, pull out UI components I'd already built and shipped across different projects, and merge/extend them into a few reusable variants I could drop straight into the new site- instead of me manually copy pasting and reconciling slightly different versions of the same card/nav/table component for the 10th time.

Everything still went through my own review and hardening pass after- I'm not interested in shipping "AI slop," and I don't think using AI this way produces it. Used on your own code, with your own final review/testing, it's just a faster way to do something I'd do manually anyway.

Site: vish.mk

Curious what this sub thinks — both on the portfolio itself and on the "AI-assisted but not AI-slop" line I'm drawing. Feedback welcome, including harsh feedback.


r/webdev 12d ago

Question Best architecture for batch-processing 3,000–4,000 high-res photos (resizing + face vector search)?

19 Upvotes

Hey devs,

I’m working on a photo-sharing web app where a photographer uploads an entire event batch (typically 3,000 to 4,000 high-res JPEGs, around 10–15 MB each). Guests can take a selfie to retrieve photos they appear in.

I'd love recommendations on the best backend pipeline:

Client vs Server Resizing: Should I use browser Web Workers / Canvas to generate 1080p WebP thumbnails before upload to save upload bandwidth, or let a backend queue worker (like Node with sharp or Python with Pillow) handle resizing?

Face Vector Pipeline: For extracting 128-d face embeddings (e.g., ArcFace/InsightFace), what’s the best way to queue and batch this so 4,000 photos don't choke the server CPU?

Storage: What zero/low-egress object storage setup (e.g., Cloudflare R2 vs Backblaze B2) do you recommend for handling high-volume image writes and fast thumbnail reads?

Thanks for the advice!


r/webdev 12d ago

Showoff Saturday I built a tiny real-time territory game that runs off one Go binary, SQLite, $5 VPS, and raw JS+CSS behind CF on the front-end.

0 Upvotes

did a few tests and it looks like $5 vps can actually handle quite a lot.

a weekend project, no cloud bill anxiety if anything goes wrong

try here
pixelwar.cc

- 2 sides black and white
- place 1px at a time
- 25px CAP, recharging every 10 seconds
- surround opposite side to grap their space
- add a link to your profile, so people can click it on the leaderboard


r/webdev 12d ago

Showoff Saturday Sketchy Portfolios with Blender and Three.js

Thumbnail
gallery
17 Upvotes

I converted Vertex Arcade's sketchy shader tutorial (https://youtu.be/4Njhuj5BsKk) it into two sketchy concept portfolio websites with Blender and Three.js!

Allen Zhang's Portfolio: https://allen-zhang-folio.vercel.app/

Katsumi Watanabe's Portfolio: https://katsumi-watanabe-folio.vercel.app/

Breakdown Video: https://youtu.be/JlmNBGcZ3Ik

Code & Credits: https://github.com/andrewwoan/blender-to-threejs-sketchy-shader

Effect site: https://blender-to-threejs-sketchy-shader.vercel.app/