Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.

Join

front-end

resources

back-end

ui-ux

os-and-tools

help

not -solved: ClipPath

Problem One: Why doesnt my clip-path on the pseudo element in the top right corner look the same as the hotpink svg with the same path ? the circle cutout isnt in the middle and its squished. https://codepen.io/Miss-Fox/pen/abrwMjq?editors=1100 Problem One Solution...

grid

How can we target the main-grid container grid lines for the grid item placed inside another grid container.(scale upwards)
No description

Inconsistent gap on my phone, not in laptop.

I am using Vite for my projects, and adding "dev": "vite --host" to my package.json file so I can see the application on my phone as well. Whenever I try to use grid or flex for a container and add a gap to its children, it looks good on my laptop but not on my phone. I set a 1px gap (also tried other gap values) and the best way to describe my problem is as if some child elements have 2px gap, some others 1px gap, and it looks inconsistent. Tried many things and suggestions from ChatGPT but nothing worked....

scroll-X issues

Hi guys, I followed this guide: https://css-tricks.com/pure-css-horizontal-scrolling/ and managed to get it to work, but the problem is that when I try to swipe left or right on my phone it doesn't work ... I can't scroll when I have a touch screen... I've thought of several workarounds with javascript or buttons to activate the slider, but it wouldn't be ideal if there was another solution....

NextJS Api Calls

Hi guys, so I am building a simple website with questions and answers and it is in its initial versions. First, I made the backend API using nodejs, express and postgres, watched a tutorial and understood the flow and then added connection pool and so on. My apis are working just fine. I decided to use nextjs for frontend, but I am confused on what is the correct way to make an api call. I watched some tutorials but it still got over my head. Traditional way is to just call the fetch inside the page.tsx where i want to display my data. However, I wanted to use the app/api/route.js method in next js. I assume its called the Internal API. Right now, inside my project folder, I have two folders, client with the nextjs setup and server with nodejs and express api. Now in this scenario, what is the correct way to make the API call from next js while my backend is running on localhost as well. I did read the docs and some stackoverflow questions but I was unable to understand the flow and how I could implement it in my scenario. ...

Issue with overflowing text

I'm developing my portfolio website and I'm trying to achieve a very minimalistic and typographic design. On initial page load the text has ultra large font-size and as I scroll down the page the font-size scales down. Here's how I do it: `window.addEventListener('scroll', () => { let fontSize = Math.max(32, 300 - 0.05 * window.scrollY); main.style.fontSize = fontSize + 'px';...

Setting radial bg but the radial parts are stretching with the page height. Don't want that

I used this website to generate a background with little growing blobs on the edges but as I add content to the website the blobs get stretched. I want the glowing blobs to mainain their shape. Image 1 is how it was generated and image 2 is after I add content to the page. ```css .radial-bg { background-size: 100% 100%; background-position:...
No description

Align Images right in a subgrid

I have a subgrid with a collection of images, I'm trying to right align them in the grid. I've tried grid-column-start: -1, align, justify, nothing seems to work, what am i doing wrong? any help would be great! Thanks <div class="project-content"> <div class="project-copy">...
No description

css

I am trying to create this banner. The image has this weird shape. I tried to play with border-radius property but not working properly. What should I try ? Any suggestion would be helpful. I am trying to achieve with CSS only. Thank you !...
No description

Configuring Tailwind File

I want to know what's the approach to add custom properties for the "font sizes" and "line height" of h1 , h2, p that changes different breakpoints of small and desktop screen sizes I found this but I don't know if is the most convenient form to do it: ``` tailwind.config.js: theme: {...
No description

Mix of elements in block level elements

This is from the section of the course “Inline formatting context & anonymous boxes” from the module “Unknown Fundamentals: formatting context”. “When we have a block level element, it can either contain other block level elements, or inline elements. It cannot contain a mix of them”. But from what I have been learning, it appears a block level element, (such as a div), can contain both other block level elements & inline elements simultaneously. Is anyone here familiar with this?...

Is it good practice to combine MUI and Tailwind css?

So I'm making a React app. And I like tailwind better than bootstrap, but I need the ready made components and icons. Is it considered good practice to use them both on the same project?...

Lagging scroll on mobile devices

Okay mates, been a while since I've been active here, but this issue had me trying for so long I need a set of fresh eyes. Issue is this website I am working on https://treungen.netlify.app/ has a good experience on desktop. the animations are smooth and so is the scrolling behaviour. On mobile it's not the same. probably cause of it's lack of perfomance from a computer. so I had attempts where I have no animations at all to check the result. but still the performance was just as poor. More over I checked all assets used if their file size may be to large and that caused it. maybe they do but all images are less than 200kb, so I do not think it is the reason either....
No description

React useEffect problem

~ useEffect(() => { const fetchPins = async () => { setLoading(true); setError(null);...

Theme-Toggle: Filter? BG Blend? Mix-Blend?

Hi everyone. I'm trying to use this theme toggle so that i have the little circle that shows which option is toggled on. Im wondering if there is a way to use blend modes or filters (or masks maybe?) so that only the item that the circle is over has saturation. Doesnt have to be a pseudo element, and the internal icons (the logos) dont have to be bg images. https://codepen.io/Ceecee-Hart/pen/VwObNQe?editors=1100...

Custom Font doesn't work

Hi, I have a problem with a custom font, Bad Signal. I changed its extention from .otf to .woff and woff2 using this website https://transfonter.org/ . I imported the new fonts in all html pages and in the css file and I uploaded the font files along with everything else in the File Manager folder from CPanel. I can't see the custom font when I visit the website from my phone. I only see it when I visit the site from my laptop. Here is my code and thank you very much for your help: HTML links <link rel="stylesheet" href="styles.css"> <link rel="preload" href="BadSignal.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="BadSignal.woff" as="font" type="font/woff" crossorigin>...

Networking

Hi guys, idk if this is the right place to drop this but here we go. I've been learning to code for last 8 months and been slow with my progess. i havn't given up yet but one of the main reason i started coding was because i wanted to make couple of app that i have in mind. i was hoping to make some connection with some great coder and maybe if they like the idea we'll be able to work on the app together. I've obviously have no idea where to start or how to make connection. if had the money I wo...

Keep absolute positioned item in the same place regardless of the screen size

Hello, I am working on waldo style app. When user finds a character i want to display a checkmark in that position. Currently, i am using offsetX and offsetY of the image to display checkmark. However the problem i am encoutering is that when you resize the screen checkmar's position gets all messed up because i am using fixed units. Is there a way to make sure that checkmark element always stays in the same position regardless of the screen size?...
No description

How to put video in text background, if background nor white nor black?

Hey guys! I know how to put images in text background using background-clip: text and color: transparent. I know how to put video in text background, using mix-blend-mode, but it only works if body color is black or white. Are there any ways to achieve that in colour background or even gradient background? I though about using text as svg and do clip-path, but i don't know how to convert text to svg on demand inside react app. So any suggestions are welcome! https://codepen.io/RobyDoby/pen/pomPZrR...