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

querySelectorAll(); !!

k so i have a div with the id "gridContainer" and then i have 100 divs inside of it each having the same "box" class now i want to get all those 100 divs and store em inside an array.. ...

Triggering an event for search box when enter key is pressed or clicking on svg.

I coded twice once for keypress and another for click event. IS there a better approach for such situations? ``` const locationInputEnter = document.querySelector("#location-search-btn"); const locationInputClick = document.querySelector(".search-btn");...

<picture> tag and resolving images in my hero section

I'm trying to increase the performance of my site, so I've got 3 different jpg hero image sizes, and 3 different webp sizes: ``` <picture> <source ...

How do I approach this kind of design or layout?

I used grid to achieve the background but, I couldn't get my text to be like that of the shot 😦

How do I create a responsive text?

A project I'm working on have lots of media queries just for the text to adapt to screen sizes. I would love to implement a fluid text responsiveness or even a stepped responsiveness but in better way with or less media queries. Thanks 🙂...

How do I maintain the size of the image without shrinking the text.

Please, I need help on that, it should be like the image here 👉🏾 Thanks 🙂...

Fixed Navbar

Is there any way to fix the navbar at the top while the sibling container shouldn't overlap with nav , it should start after nav ```html <div class="parent"> <nav></nav> <div class="sibling"></div>...

Aria attributes for JavaScript added content

I have a project where the results of a form submit is added to the DOM. I'm using mostly createTextNode and append to add text to h3 and span elements. Should I add aria attributes to those elements, and if so which one(s)?

how to format date & time in javascript

how do i truncate the 'GMT+0100 (West Africa Standard Time)' part from my
new Date
new Date
? i know of the
get functions
get functions
, but i want the month to stay formatted as text and not numbers?...

react window

I have flex card mui and responsive I want to use react window but i cant get same design Who have any idea to fix that React-window with responsive card If have 2 card i show 2 card vertical centered in container...

nav not working on mobile

When the nav is in mobile mode, the background doesn't show https://codepen.io/RS_2009/pen/wvEmXgd?editors=1100...

How do i approach this UI?

I have this UI requirement, i have tried to replicate this, but i am not able to position the profile image in center along with the surrounding stats, can anyone suggest an approach for this.

How do I handle images with too many different sizes on a blog page?

soo there are small images, big 16:9 images, square images lying everywhere on my blog page and I just don't know how to write css to handle them all at once. Is there a solve-all css line that I can use to automatically make sure all are in the right aspect ratio, doesn't clip content, doesn't overflow out of its container

Help needed with Pseudo classes.

Im trying to make something like, when a list item is hovered, the rest of the list items should become little bit transparent. ``` <div class="flex weekly-forecast "> <ul class="flex daily-weekly-forecast">...

Why am I unable to apply "Event Delegation" in this project?

Project link: https://astonishing-cupcake-035f30.netlify.app/ Hello, when I try to add event listener to the parent div, or even whole body, it does not work. I'm guessing it's due to the way I'm adding elements with JSON, but I'm not sure myself. ...

Overlapping grid areas issue

I try to understand how template areas overlapping works following a video series on Kevins channel. I have this code for small screens: ```css .overlapping-grid { display: grid;...

React and JWT

I'm used to the normal vanilla way of having a cookie go with every request and authenticated and a page is sent back...am using react how can this be achieved, if after a login I use Context API, even though my token is still in cookie the auth state defaults back to false after refresh, storing in local storage isn't advisable..my question is how can I achieve protected routes with react even after page refresh

several contact forms. need a tool to send it to the related store.

Does anyone know if email.js has the option where I can pass a email in params of sort and make the email send to that email from params instead of my linked account? Or another library that does this? I have 35 different contact forms to stores on my site. and would like it to ship the mail to them not me...

Dynamically requiring images?

I've a module that contains a class that represents the Hero section of my site. The Hero has a slider of images. At the top of the class I'm importing the images: ```...