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

Why is the 4th image showing first in my GSAP scroll-trigger animation?

I’m working on a scroll-triggered animation using GSAP in a React app. The goal is to animate a sequence of photos as the user scrolls, with each photo becoming visible one after another. However, when the page loads, the last photo (4th image) shows up first and then animates in the correct order from 1 to 4. When I try to fix the issue by moving the first photo to the front, it results in a duplicate first photo before the animation starts, which then animates correctly. ``` const photosRef = useRef<HTMLDivElement>(null);...

Ruled grid line || Gradient

How can I create gradient line look like image
No description

Custom border in css

I am trying to make a custom border in style. I need the box to be like in first pic. I tried tweaking border radius but its not matching as per design, can someone help me with it. codesandbox link: https://codesandbox.io/p/sandbox/xzzh99 Here's the code i tried ``` <div...
No description

Fixed background-gradient on menu items

Hi all, I am trying to create a menu with menu items that have a shared background gradient. But I can not get it to work. As you can see in my CodePen the gradient works fine when set to the background of the parent <ul> but when set to the <li> with a background-attachment: fixed; it's not working as expected. There is a slight difference in color. But not the gradient I expect to see. https://codepen.io/commproNL/pen/QwLadZX I would really like some help and explanation on this one, I can not see what I am doing wrong....

Looking for free repositories for animated SVGs

I'm currently looking for some animated SVG icons such as the ones I've found here: https://iconscout.com/lottie-animation-pack/success-and-cross-mark Unfortunately they seem not to be free for commercial purposes and are only available as lottie files (instead of animated SVGs). I'm therefore wondering If someone knows some free repositories for such animated SVGs like the ones above....

Landing Page Using Grid Methodology

I am making a sample page using only CSS grid for the rows and different sections. I am considering to use a container in each section and apply the grid to that container. Or use a child row, then apply my grid for the elements. Any good flow to follow. As an example: ```<section class="services_section"> <div class="container"> <div class="grid">...

Recreate a circle gradient border

So I'm creating a website based on a design and I have to recreate the reviews section (which has the reviews all around the circles), which has those interesting circles with gradients. I was wondering which way is more logical - doing with a gradient or with border? Here's a link to the design - https://dribbble.com/shots/25168170-Web-App-Landing-Page. Thanks in advance!...

Inset property vs top/right/bottom/left

Hey all! Curious about something.. I'm using "inset: calc(some stuff);" and then declaring "left: initial;" because I want to set top, right and bottom to a certain value but leave left unchanged while using position: fixed. Basically a cart drawer with a bit of margin on the sides. If I use "inset: calc(some stuff) calc(some stuff) calc(some stuff) initial" it doesn't work. Wondering why that is? I always thought shorthands were literaly just a quicker way to write the same exact thing bit it seems to behave differently than using individual properties by themselves....

how to make li elements centered ?

```css header{ position: fixed; left: 0;...
No description

what does the model of a (global?) object look like?

Hey, what does the model of a (global? i'm not sure if that's the right word) object look like? For example document in document.querySelector. I understand that document is the object, but is it a class that has a function called querySelector in along with the others? e.g. I'd appreciate any help, thanks in advance....

Nested Checkboxes in Pure CSS. Is it possible?

I created a website showing off checkboxes with a single-parent checkbox and three-child checkboxes. I have implementations in Vue, React, Vanilla JS, and others. I wanted to see if I could do a CSS-only implementation. Here is a link to the CSS-only code example: https://codepen.io/jsolly/pen/LEPOmKo It 'almost' works. The problem arises when all the boxes get checked, and you try to 'uncheck' them....
No description

I need help centering my table of content

I have no idea why my table of content won't center for the media query that I set up. I have tried display: flex; justify-content: center; align-items: center; I also tried margin-right: auto; marigin-left: auto; I put up a border around my class "dropdown" class to see if it spanned across the entire screen horizontally and it did. So it confuses me why margin auto or flexbox is not working for me? Any help would be appreciated. https://blogbydave.netlify.app/blog/2024-10-30-virtualization/...

Please how do i achieve this?

I want to implement this design. Any help will be very much appreciated and if you have any idea of a codepen that’d be awesome! Thanks y’all

CSS Grid Layout with an element spanning dynamic number of grid rows

I'm not sure if this is possible but I thought I would ask before I resort to manipulating the dom with javascript since I don't have control of the html. I have a page with a dynamic number of sections and I need to create a 2 column layout for those sections. The first section needs to go into the first column and span all the rows created by the rest of the sections. Since the number of total sections is dynamic, I can't use grid-row: 1 / -1; I'd have to do something like grid-row: span 200; but I also need this first section to be position sticky and this prevents that from working. The only other thing I can think of is using javascript to wrap all the other sections in a div so I only have 1 row within the grid to worry about. Here is a code pen example of the basic layout I'm going for but I can't use the grid-row: span 3; that is in the example since I won't know how many rows there could be. https://codepen.io/shborrowman/pen/yyBPNmd Does anyone know if this is even possible or is the javascript route of placing all but the first section inside a div the only way to go?...

Need help with react, and react-router.

Hey guys, I am working on a project, and I need some help. So basically in this project, the navbar and the hero-section or the first component of every page has to be wrapped under same div, because they both share the same background, and if I make them separate components, and apply background separately on them, the designs, aren't consistent. for example let's say on Home Page, I have multiple sections, like Hero section, feature section, testimonials section, etc, now I want navbar and hero section to be a same component basically under the same div and other components to be out of it, because navbar and her-section for each page shares the same background. How can I achieve it using React router and Shared Layouts ?...

CSS Flexbox: Items Not Taking Full Width After 730px Media Query

Hi! I have an issue with the code that after 730px i want the middle content box to have a max width of 725px and width 100% and i have set the flex items to columns and set their width to 100% so they take the full width so that the pages becomes responsive but they are not taking the full width of their parent so will you people please help me in solving the issue here is the link to the code https://codepen.io/Myra-Gull/pen/JoPrgXB

Is there anyway to make overflow in x visible while y is scrollable?

```css .foo { overflow-x: visible; overflow-y: auto; }...

Is it possible to access computed aria values from JS

I want to access the aria-expanded computed property on an element without it being present as an attribute. In chrome devtools's accessibility tab, the property exists as a computed property, but I can't figure out how to access this value via JS. Is it possible, or is just internal state in chrome that I don't have access to? element.ariaExpanded and element.getAttribute("aria-expanded") both just return null - so assume they are just trying to read the non-existent attribute, rather than the computed value....
No description

how to create a Dynamic SVG line path based on hover interaction.

Hello friends! I am need to create a svg line path that animates in. along this svg path i have divs the shape of circles. This line path resembles a sine wave except that the amplitudes are flat on top. I need to find a way that when i hover over one of these circles place along the line path the circle scales bigger while making the line path on the left and right side grow. I feel like this is a terrible explanation so please refer to images. ...
No description