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

Keep element in viewport up until a certain point

I'm currently facing a challenge i'm not so sure about how to approach and curious with what kind of solution some of you smart people over here come up with. Basically I have a page with multiple sections and one of those sections has an image with some text next to it. When I scroll down further, I want the image to follow the viewport, until the text from the next section arrives next to the image. Then, when I scroll down even further, the image should leave the viewport together with the te...
No description

Section html css

Hi guys, I would like to know how I can make this type of division between sections in HTML and CSS
No description

Toggle menu

Hi guys how can i get the menu icon all to the right https://codepen.io/Boeroe/pen/xxMgrxz...

Code review - Stats preview card component

Guys, I would like you to give your opinion on the best way I should have used to build this component. I struggled for two days to make something that worked, even if it was full of 'hacks'. Github repository: https://github.com/sircarloschaves/stats-preview-card-component Live site: https://sircarloschaves.github.io/stats-preview-card-component/...
No description

Slide-in animation snapping when opening the navigation drawer in mobile view

I am trying to clone the sidebar navigation from this website https://m3.material.io/ , How it is supposed to : In the mobile view , when clicking on a menu item the menu slides off and the navigation drawer is revealed ...

i18n while keeping path /en /fr

So I want to use i18n for a portfolio website I have because I currently just have all my files duplicated for every language. Is there any way that I can keep my /en and /fr without having duplicated files and using i18n ? I'm using html/css/js/jquery here is my current website https://antonycd.com/en

Triggering an animation based on scroll position

Hi there, I'm working on a website, and I've been wanting to recreate the following image. Not the design but the animation. It slightly moves left or right depending on whether you scroll up or down as you can see in both images. I do know how to trigger things when they appear in your viewport but that's only once, this seems to be something entirely different. ...
No description

What are the best practices for the number of srcset items for a dynamically sized image?

I have the ability using server side rendering to render as many different source images as necessary, given that the library (in this case, sharp) can render any size requested. When is the overhead of having too many possible permutations of sizes a performance hinderance? It seems like no matter what if you are selecting only a handful of sizes, your images are not being optimally sized for every possible screen size. I've Google searched for any kind of best practice information on this topic and have come up dry in finding any official recommendation from Google, Apple, Mozilla, or other browser makers, or any of the HTML W3C Draft docs and discussions....
No description

Styling inputs, and lining up multiple list items

Hi all, Last bit of my first svelte app and I'm a happy chap! I'm hoping the sandbox works and lets you edit, perhaps...?...

Trying to add a checkbox that also line-throughs my list item when completed:true

Not sure how much code you need, I've console.log("test"); which worked, and console.log({todos}); also worked, however even when clicking the checkbox, it would show as completed:false every time... I'm not really sure where the bug is. I've also noticed this .completed css selector isn't working, but it's clearly shown below in the todoCard div, so I'm also not entirely sure why vsc is saying it's an unused css selector. ```js...

Grid as a child of a flex doesn't work properly

Code: https://play.tailwindcss.com/XSMPnICSXN As you can see the green squares are overlapping each other and the red container is overlapping them as well. What I want to achieve is something like that. I tried using width: 100% as well but it still doesnt work...
No description

can clamp() be used for anything other than font-size

well I know what clamp() function is or what it does I've only seen people using it for font-size but i wanna know if it is possible to use it anything else for example, margin, padding or gaps I also know about min() max() functions that we can use but i once used clamp() for gaps and it worked quite amazing...

Mobile nav bar

Hi guys i have a space between my header and navbar on small screens. How can i make it like the picture or whats going wrong? https://codepen.io/Boeroe/pen/xxMgrxz...
No description

website hosting

How can I host my website to a browser and it work effectively whenever it's searched

Grid question, wrapping when using grid template-rows

Hey, I've not used grid so much so bear with me, I'm styling a definition list and have got it looking exactly how I want it, however I want the dt + dd items to wrap onto a new line when overflowing horizontally. I guess my question is, is this possible with using grid-template-rows? and if so please impart me with your knowledge ❤️ example code is https://codepen.io/brumgb/pen/XWOpKEx...

Maybe a stupid question..

So I have a problem whenever I write CSS code in VS my page always scrolls back up to the top. I find this annoying as I cant see my changes. I'm a complete beginner so any help is welcomed.

infinite horizontal scroll animation in react

I have watched the tutorial in html and am trying to use this in react: https://codepen.io/kevinpowell/pen/BavVLra, however am not able to animated, Any help, this is my current implementation: import { useRef, useEffect } from "react"; export default function LogoCarousel() { const scrollers = useRef([]);...

Smooth gradient

Hello guys. I was just watching one of Kevins videos and noticed a smooth gradient which he used. How do you do so smooth gradient?...
No description

React Card CSS Layout ( beginner )

I am not able to target the from class div in the card, the style won't change even when I change the values of the properties. I want to turn the card into what is show in the image, please help me to do so I am a beginner. CODE: https://codepen.io/Prajwal-Nakil/pen/bGzBJrj...
No description

Margin-top and bottom not working

Hi guys, as you can see at the last page its right against the bottom of the previous div and against the top of the footer. If i try to add margin-top and bottom its not working. What am i doing wrong or where should i add this: https://codepen.io/Boeroe/pen/qBgqwRZ...