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 would you animate this sidebar toggle?

As you can see I try to use display: none, and it's working fine, because mainMenu expands to full width, but when i use display: none, it doesn't animate smoothly, I have transition: translate 200ms ease-in-out; in my sideMenu element
No description

Animation: Rotate In on Open and Rotate Out Reverse on Close: asking for Feedback

I made this animation, and everything works I as want, but turns it's move complicated then I assumed and it took way more code than I expected. Therefore I just wonder is there a better way to do the same, more efficiently? Please, let me know if you know! Codepen: https://codepen.io/JunSu-Ho/pen/JjwBLwK...

how to change the color to red in Material UI ?

Anybody knows how I can change the color like in the picture ?
No description

Regex pattern returns true, while inside function returns false

Hello everyone, I am working on a little project to dive deeper into HTML,CSS and Javascript and I came across rpoblem in one of my functions, where I use a fully working regex pattern. I tested it in console.log, it always returns true for the strings i am checking. Here is the pattern: ```js...

centering div issue

So could someone tell me where I went wrong in trying to center it ? I put a display flex on the body but it didnโ€™t center it like it usually do with a previous project . And also when shown on my laptop itโ€™s full width but on my phone itโ€™s shrinked down HELP please LOL

Horizontal layout webpage

I am building horizontally separated site. It has 2 columns, left one and right one. The left section is suppose to be 40vw and 100vh. The right section is 60vw and 100vh....
No description

CSS

Donโ€™t know how to create this layer inside this background help?? Css still a learner ๐Ÿ™๐Ÿ™
No description

Creating an Infinite Vertical Carousel with Framer Motion

I'm working on building a vertical carousel using Framer Motion in my React application. The carousel moves downwards, but I'm facing an issue where it stops at the end and doesn't loop continuously. What I want to achieve is an infinite loop where the bottom-most picture smoothly transitions back to the top. Is there a way to achieve this, possibly with CSS or through a different approach in Framer Motion? https://github.com/roycejwilliams/royce-portfolio-react/blob/main/royce-portfolio/src/components/Carousel.jsx...

Astro - how to pass data from the server- to the client-side JavaScript

I'm sorry for not providing any code but I have doubts on whether my code would be even relevant in light of my question. Also, I have no idea which part of the code could be helpful, so, when asked for, I'll provide the requested part of the code, probably using some playground. I'm coding a relatively simple website, using Astro, and I seem to have an issue with passing data between the server- and client-side JavaScript. The thing is, I'm fetching some data inside the server-side JavaScript (Front Matter) and need those inside my client-side JavaScript, to simply filter them....
No description

Curve in the end for the last navigation link

SUMMARY: I have an idea to add a small curve to each link at the bottom, but I'm facing an issue with the last one. I added a background image to the body tag, and this is where the problem arises. PROBLEM: Green section that should be transparent. However, when I add transparency, the curved effect disappears (due to the negative margin-left). TRIED: I attempted to use a border-left, but it didn't work....
No description

What is the most "Semantic" way of adding svg's inside button elements?

Like this ```html <button class="btn__nav hamburger" value="<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1' stroke-linecap='round' stroke-linejoin='round' class='feather feather-menu'><line x1='3' y1='12' x2='21' y2='12'></line><line x1='3' y1='6' x2='21' y2='6'></line><line x1='3' y1='18' x2='21' y2='18'></line></svg>"> Menu...

Weather App

I'm building a simple weather app project. Current, I'm using open-meteo.com's API for weather data. One of the parameters I'm using is weather interpretation codes. The variable documentation is attached (see picture) My question is, what's the best method at converting code into description? I know there's multiple ways, such as if/else if, case, sets, etc. (I'm assuming using Key / Value) What would you recommend? Thanks....
No description

Continuous text change depicting encryption/security using code

I want to achieve an effect like this using code. Will start from random and finish at a specific sentence like "Security @ Apple" (without the background effect)
No description

Problem with a basic responsive container, which needs a min-height even when empty

https://codepen.io/OrzCode/pen/mdKjpYb I have a #content div in the middle section of this Codepen, which holds the content. This #content div is supposed to be 80% height of its parent (the middle cyan/teal section) when empty/to begin with, and should grow to scale to content size. I can't get it to both: (1) grow with content without overflowing (which is what is currently happening in this codepen), and also (2) have a minimum size even when empty. eg when the #content div is empty, it should still be 80% height/width of the parent box. The #content div disappears entirely if I add code to make the middle section grow based on content....

Icon inside Button

I've made a button component which I than used somewhere else. I placed fontawesome 6 icon <i></i> inside it and it's well aliged with the text in the button. As it was little bit bigger I changed the font-size of it. Now the icon is not vertically aligned. I tried using svg which works fine and it's alignment is not affected by the font-size of the button. Why is that. Picture and codepen link are given. CODE PEN: font-size on line 37. https://codepen.io/Arslan-Akbar/pen/oNJMNqY...
No description

Struggling with the new view transitions API

Hi! I am exploring the View transitions API. I have a simple demo with just a box that changes background-color and width on click. Since I see some things I don't understand (the height also changes during animation) I wanted to try to debug/replay it in the browser dev tools. EDIT: I kinda solved it, but I am struggling with the API itself. Please jump down to the latest reply I open the Animations drawer, I click the box, I record the animation, I see it right there. But I cannot figure out how to "replay it". When I click play, change speed, or draw manually, nothing happens in the main browser window. I don't understand. What do I have to do to actually see the animation being replayed....
No description

IntersectionObserver [JS]

Hello, I'm attempting to use IntersectionObserver() in JS to create a lazy loading effect. My code at the moment is the basic setup. Where I'm stuck at the moment is trying to figure out how to detect the child of the element being observed. Basically, I want to check if .cards is observed and if true, console.log which card is within the intersection. Thanks ๐Ÿ‘ ...

Button positioning

Pls how do I make this buttons stay on the same position regardless of how the paragraphs words wrap? I've googled & chatgtp how to do it and the answers see don't work, probably because Google doesn't understand my question precisely...
No description

NextJS,

I have a Next.js application where I've replaced React with Preact. In the profiler, I notice that the rendering time for the Portal, specifically for the 'next-route-announcer,' ranges from 1.5 to 3 seconds. I'm trying to identify the root cause of this delay. What areas should I investigate to pinpoint the issue?
No description