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

Scrollbar and overflow-y-auto issue

hey guys im working on a messaging app project rn and im facing a css issue ! ive tried all sorts of stuff to resolve it on my own but to no success tech: React and TailwindCSS for styling ill post a vid below so u guys can take a look basically i have...

How to optimize mediocre page speed results with Canvas element and Fontawesome.

Hi all! As a fresh new designer turned front end guy I'm having a hard time optimizing my website with some big things that according to Pagespeed insights are problematic. Namely (what I think are the biggest issues) my canvas element and Fontawesome. I'm using Hugo to generate static pages with vanilla CSS and JS with some external connections. Here is my speedtest result: ...

Managing images on an image-intensive website

I am replacing an old website and making a new one which is responsive, mobile-first. It is an online newspaper, and as such, will have a lot of images. It sounds like you have to be really mindful of webpage sizes and bandwidth to give a good user experience. So I am looking for advice of how to AVOID having images choke my website and thus frustrate end-users......

Having CSS Issue where putting margin in inner divs moves my whole component

Hey all . I am having an issue where i put a background color on my component but if i put margin in my inner div in the compoonent it moves the whole component. I am using the Flynt Wordpress Theme ``` flynt-component[name='BlockWysiwyg'] { background-color: var(--background-color);...

Make big image fit to canvas

Hi everyone, I'm trying to create a scratch effect using canvas. I'm having problems understanding how to make the "hidden" pic to behave like an object-fit: cover would... I know that I probably have to scale it, but I don't understand how. (https://stackoverflow.com/questions/23104582/scaling-an-image-to-fit-on-canvas) https://codepen.io/n00bCod3r/pen/gbYwxBY Just hold LMB and scratch the image, you'll see the hidden one appear...

When using Astro have you tried any CMS alongside with it ?

Hey guys im coding a website on Astro but wanted to know your opinion on a CMS you have used alongside Astro?

Variable Font: decreasing line-height while keeping glyphs center

https://codepen.io/fluffybacon-steam/pen/VYZjRVQ I am playing with variable fonts for the first time and having trouble raggling line-height in. There always seems to be a little bit of headspace that I don't want above the variable font; I want the line height to be "tight" against the top and bottom of the glyphs. Its an uppercase-only font so I assumed this would be easier but its not. Worst part is my hacky custom line-heights and paddings does not translate to other browsers very. Looking for a more constructive less magic number approach. I have already tried vertical alignment....

Shopify Hide Footer

So I am working on a shopify page that wants to hide the footer on certain pages to give more room for a iframe to load on mobile and I got to hide the footer without issue but the section doesnt take up newly created space and I cant figure out why?
The section is the only tag inside the main tag and the main tag uses the whole page. This is the css i have on the iframe. I am very new to css so I apologizes if I made any glaring errors 🤣...

Axios vs Fetch

Hello guys, sorry to disturb you all; I was just reading a bit about the difference between axios and fetch. From what I have understood, some of the differences is that axios already parse the data in the respond body and so we don't have to manually use something like response.json(). Similarly, when using post requests, axios don't need to include the JSON.stringify() method. By default it already does it. It also has some other benefits like a timeout argument which fetch doesn't have (I think). My question is, I came across the term "interceptors". I read a bit about it, from what I have understood, it's just something use to modify the request before it is send or modify the response before it is sent back. But I didn't really understand why are interceptors used or why do we need it . Can someone explain please...

Resources and skills required for building websites with unique animations

Can anyone please guide what are the recourses and skills required to build websites which use such kind of animations as shown in video? Being a front end devloper, i have never been challenged with such stuff but it is fascinating how such websites are brought to life. https://youtu.be/wpfE9XQuMBI?si=4QNXAlCdbl2c_FQy...

Overflow and Height Issues

So I am trying to make a chat UI for a website And issue I ran into is overflow, I made the chat section a specific height and made it scrollable so the chat doesn't take up the entire page and I added Inputs below it The input does not take up the remainder of the parents height despite me making the height "h-full" (I am using Tailwind CSS). And after experimenting, I found it's because of the chat container. I calculated the height like this "max-h-calc[calc(100vh-26rem)]" And when the user uploads an attachment, and the attachment is displayed it creates overflow. My goal is for the chat section to resize automatically and for there to be no overflow on this page...

Moving some element with range input, no javascript

Hi everyone, I'm trying to create some swipe captcha and everything works perfectly without javascript except one thing. When user moves the range I use javascript to move black box so visually user can see when it fits inside the red box. Is there a some weird css feature that I can achive this with?
No description

Flexbox or Grid?

I'm trying to build this UI here (see screenshot) I wanted to add the flex wrapping behavior for mobile responsiveness, but also am having trouble figuring out what I am supposed to do with flex basis or grow or shrink. If I give each tile flex: 0 0 588px, then they are not dynamic and they just "pop" onto the next row as I shrink the viewport. When I use flex: 1 1 588px as shown in the codepen, the tile that wraps to the 2nd row grows to take up all of the available space. Ideally, I want the top row to distribute the space as evenly as it can, and then match the width of each tile in the 2nd row (a faux grid). The idea being that each tile has a minimum width of 588px and will go to the next row if it falls below that. Then if we are on a really narrow viewport, the width can drop below 588px. ...
No description

:has() alternatives

Hey, are there any polyfills or alternate methods for :has() for browsers that don’t support it? Thanks in advance

position-visibility and @position-try to hide a popover

So I'm starting to experiment with the new properties and at-rules of popovers. And since popovers will end up in the top layer, I have yet to figure out how to use hide them if they would overflow e.g. a top main menu. I figured out you could use position-visibility: anchors-visible;, but if the main menu is taller than the anchor, that doesn't really help. Let's say I know the height of the main menu (e.g. 120px), shouldn't I be able to do something like this?...

How does the cascade affect media/container queries?

Hey, if I’m catering for browsers that don’t support @container, I may do something like so- ```css @media (min-width: 55rem) { .element {…} }...

optimization | @font-face with <link>

Hey, i know pre-loading fonts or links of any sort of importance aids in optimization. If i have a local font that i have a @font-face declaration for, can i also include something like <link rel="preload" href="fonts/fontName.woff2" as="font" type="font/woff2/> alongside it or am i unable to have both? Thanks in advance....

How to avoid duplicate if checks when overriding a method in JavaScript?

I have the following parent class method in JavaScript: `class Parent { jump() { if (!this.isDead()) {...

Border inside grid (animated if possible)

any ideas how to make this borders inside of the grid? with little dots at the ends and maybe draw them at first load...
No description

Need help with my layout responsiveness.

Hey, im making a website for a group that i have with some friends but im not able to get the layout to be responsive (NOT talking about on mobile) The problem: The problem is that when i resize the page on my browser (chrome) horizontally and/or vertically, it doesn't look very nice. Elements like images and text are overlapping and changing position when they should be static....