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

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

dynamic size with only clamp, min and max

I have a div, I want its width to be 50% as long as 95vw is not possible. If 95vw is possible, I want 95vw to be the width. Can I express this logic with clamp, min and max?

Instead of the background color "light blue" , I want to turn it light green for right and red

Red for wrong. I am using the document.body.style but its not working for some reason. Is there any other way I can get this done?
No description

responsive mobile button isnt working

im currently following a tutorial on how to create a responsive navbar put im struggling as i cant make the mobile button to work i use no libs on my site here is all my code needed...

JavaScript question

So apparently the correct answers is 3. I don’t get why there are 3 loops before the code stops. In the 3rd loop i = 2 and x = 3. Shouldn’t there be 1 more loop since i < 3 . I get why x = 3 what I don’t get is my the loops stops there at i = 2 and x = 3 . i still smaller than 3
No description

Code Pen to Local system?

Hi All! I have moved Kevin's Code Pen https://codepen.io/kevinpowell/pen/BavVLra to my local system and every thing works except for the animation. Other than copy, paste, and linking the css and js to the HTML file is there something else I need to do to get this to work? Thank you....

How do i link my HTML to JS?

Im a beginner so its my first time ever doing this.

Question on CSS Cascade algorithm

I was learning about css cascade algorithm and when trying it out in browser i saw a weird behaviour. for any css property - an user agent stylesheet is specified as !important cannot be overriden by author style sheet. which is true and correct. take this example : ...
No description

Code doesn't run on vscode

https://codepen.io/Ned-Michael/pen/eYbKONr Hello, the code works perfectly on Codepen, anytime I try to run it on vs studio my CSS file doesn't show up on the web page, meanwhile, I've linked successfully on my HTML file....

Tailwind CSS and Bootstrap

Please guys. Is there anyone that can help with a material on Tailwind CSS and Bootstrap?

Window.onclick

i have this weird issue where window.onclick is not triggering my code looks something like this ``` window.onload = () => { window.onclick = function() {...

Content is too tall compared to its parent and overflows

Hi everyone! I have no idea how to solve this. If I make the viewport bigger, <main> tag which is the main container here becomes bigger too, and overflow stops as after a certain point <main> grows bigger then it's content (like it should) and content starts to grow accordingly (second picture is what happens when height is bigger). It only happens after the screen becomes wider then 800px, which is my breakpoint for media query. ...
No description

flow chart

any good solutions for generating this flow chart like components?
No description

overflow of footer during printing

I already created post on backend please look into it. Attaching link of that post below. https://discord.com/channels/436251713830125568/1156284822386397297...