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

How do I get HEIGHT or MAX-HEIGHT to work dynamically with TRANSITION in CSS?

I have an accordion menu, which I would like to open and close smoothly Although this appears fairly smooth, what in fact is happening is the transition is working over the full 1000px of the max-height and not the actual height. If you open all the sub-menus of section 5 and then open and close the main section, and then compare that to opening and closing section 1, you will see the apparent latency as you catch the tail-end of the transitions....

How to achieve image fixed to certain background position?

The title might be confusing, because I don't know how to exactly explain this. On this website there are semicircle images: https://luxana.peerduck.com/ Each image is inside of a semicircle frame (which is background?). And each image has a golden leaf attached to it. How would you make something like this? Any tips will be appreciated. ๐Ÿ˜Š

Tabbed view with challenging CSS

I need to implement the tabbed view in the attached screenshot. The thing that's hanging me up is how to do the shadow effect. The current design, which is being replaced by this one, has a shadow around the tabs and the tab content that I implemented with the drop-shadow filter (the tabs are actually contained within the content div, and positioned so that they stick up above the div). But the new design only has a shadow around the current tab. Other tabs just appear as text. So I need to figu...
No description

Failed to Fetch (JS)

A friend of mine sent me a website and I was curious as to how they were getting data. I found an API which I'm playing around with fetch data using JavaScript. I'm attempting to read an API, but it returns "TypeError: Failed to fetch" Here's my code: ```...

Clever way to use grid instead of position absolute in a common layout pattern

Hey people! I have this common layout patter that I almost aways create with absolute positioning the image on the right. But this makes the responsive part of it harder and more verbose, I was wondering if there is some more cleaver way of doing it, maybe with grid? I can easily position it with grid using something like: ```scss...
No description

how do i put two out of three inputs on the same line?

how do i put two out of three inputs on the same line while the third is on the second one? codepen: https://codepen.io/staticoly/pen/dywJxOb (though i don't know how much of a help that would be)...
No description

Function call in hook with React

So heres is the thing, and i'm trying to study javascript refence x copy, and shallow copy, to understand it. Basically, if we have a function, and put it into a hook, and export it from the hook: ```js...

Weather API App v2

Hi again! My previous post had too many questions so it got a little chaotic. This one is simpler. The code below works, it displays the location and temperature, however I don't see any way of applying CSS to it, so i need to change app.textContent to either innerHTML (where I can add a div and then a Class/ID to the div), or maybe createElement etc.....

Intersection Observer error

Hi, I'm a UX designer trying to get that hang of coding in Vue JS. I wouldn't say it's going great, so here I am asking for some assistance to solve my current issue!
Uncaught TypeError: IntersectionObserver.observe: Argument 1 is not an object.
Uncaught TypeError: IntersectionObserver.observe: Argument 1 is not an object.
Code in question;...

Position sticky on UL element

Hello friends I tried to follow Kevin's short video (https://www.youtube.com/shorts/39rbYbVhb0Y?feature=share) about position sticky in my case it is not working: here is my html ```html <main class="ds-flex"> <aside class="ds-flex" style="align-items: start; border: 1px solid blue;"> <div style="position: sticky; top: 2em;">...

float: right not working

I tried floating an image to get 2 other elements wrap around it, but that didnt go as planned float: right doesnt work while float left works perfectly. Heres the codepen: https://codepen.io/staticoly/pen/dywJxOb...
No description

How can I overlap these two images and keep the overlap responsive?

Hi, I am trying to replicate this design with two overlapping images and a vertical caption. The vertical caption should start in line with the bottom of the top-most image. I have first tried using position: absolute; on the images and setting their heights to 80%. Then setting image one to top: 0; left: 0; and image two to bottom: 0, right: 0;. This worked but wasn't great responsively. I thought maybe a grid would work better for this, however I'm still having trouble with responsiveness....
No description

Change Nav Bar on Wordpress

Hello! I have created a new nav bar and would like to apply it to only one page. When I do so, it changes the nav bar on every page. I'm not the original creator of my site and I'm not sure how to go about fixing this. Thanks ๐Ÿ‘

stack two images using CSS on mobile screens (solved)

3 days ago I started a Frontend Mentor project and quickly faced the problem found in the title. . On top of the image cropping and stacking, I need the two images to expand together while not losing aspect ratio (or at the very least, not noticeably losing aspect ratio) and not move away from each other. Additionally, the combined image (or their container) must take up space so that the other elements around it don't overflow it. My current solution achieves everything but the the phone image is bigger than the background image. It is a cursed piece of code that exploits the poor grid module into giving me a div with a background image (the non-phone image) where I then add an img tag with the phone image. My other attempts at using different position values managed to do the cropping and stacking, but they either had overflow problems or the two images expanded at different rates and moved away from each other. ...
This is what i got working with correct expansion & no overflow

Animating columns for tables

How should i animate columns populating or being removed for a table

JS not selecting my element

Hello, I was trying to copy a design I found. Itโ€™s a โ€œscroll to topโ€ button. But the problem is it doesnโ€™t work. I will provide code and some details. I havenโ€™t found any answers on internet. HTML ...

Help me please deploy my FullStack proejct on vercel

I deployed my project to vercel and got 404 NOT FOUND error I want deploy my React + Vite + TypeScript + express + Node.js porject with frontend on localhost:8000 and backend on localhost:3000 to vercel sucessfuly I have this folder structure and vercel.json (I know that I need to write functions for my backend endpoints)...
No description

Weather APP using weatherapi.com

The goal of this is to be able to show the current weather in a specific location (searchable). Now I have access to it, and I can see a Call (the url), and a response body (bunch of JSON). Now... I know I can use fetch to access or pull (I think pull is the word), the API url, so does that mean I can then access any of the JSON properties without having to add them to my codebase somewhere? ```js...

CSS slide-in with translateX property not staying in place

Hello, everyone ๐Ÿ‘‹. My problem with this is that the form is supposed to slide in from the left and stay in place so the user can add a new note. I am using the transform translateX property initially set to 100% to move the form to the right. Then when a button is clicked, the translateX property will be set to 0 which moves the form into view from the right to the left with a smooth animation. ...