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

Implementing an animated progress bar for tracking article read progress.

I'm trying to animated a bar using css, the default continuous bar works fine, but I have a list of divs (say 10 divs) that are little squares in a row, and I want to paint x number of squares based on how much the css bar is animated. say 50% of the bar is animated so i'm at keyframe 5/10, I want to translate that progress to the number 5 and then render 5 filled blocks in my div list I'm using react and plain css. Here is my css, I took it from https://scroll-driven-animations.style/demos/progress-bar/css/ as you see on the screen, there is a red bar at the top which shows the scroll percentage (how far we have scrolled from the top of the article. and the green blocks that are filled are showing the same progress but in discrete units. (it's currently not working propertly the filled in ones are just a random number) in my latest approach I tried making a new css @property (--scrolled) and inside the keyframes interpolated between 0 and x (say 20 blocks) in my animation keyframes, but I'm not able to access the updated --scrolled property with js, I'm not even seeing it be updated on dev console. ...
No description

Getting previous route in Nuxt 3

Hey guys, how do I get information about the previous route I navigate from in Nuxt 3?

space between pushing content under the scroll bar

i had it working before, but i wanted the header to be sticky. The sticky property didnt work so i made it fixed. That worked, but now it had a new problem of taking up just enough space it needed to fit everything, and now ive put width 100% and it pushes the items behind the scroll bar. How do i fix this or make the sticky work with what i had originally?
No description

What are some good Javascript tutorials for someone who has experience in c++,java,python?

Hi, I recently graduated with a comp sci degree in may and for personal interest and to help get my first entry level position I've been learning as much as I can about front end development since October. Starting in October I did the FreeCodeCamps front end certification process using react. After struggling through the course I felt that I still didn't know enough so I then spent the next two weeks straight watching FCC's 12 hour bootstrap tutorial and then spent the next week finishing t...

TROUBLE WITH FETCH API AND DON'T KNOW IS IT ENOUGH [Javascript]

i want to move on, i mean learn frameworks but currently I learned fetch api JS and don't know If i should study headers, cors and second parameter of fetch I know basically what headers do but not all of things which I can put on second parameter fetch, I can't get answer...

Suggestion for Page Layout and How to Manage It

Hello πŸ‘‹πŸ» I would like to know, - How can I make aside element sticked on the right of the grid? I used position: sticky; but probably going to play with it more later on. - Since I am trying to make it responsive, how can I make it on top of the screen? Should I put section and aside element in a div? (But this time my grid-template-are property won't work well)...
No description

mapping array of objects in react

my goal is to create an accordion using useState hook and the array map method. I have mapped through my objects and they display correctly, but my issue is the useState hook toggles all the accordion items. how do i select a specific one toggle on click? my code: ```{faqsData.map(({ title, details, index }) => ( // faq item...

why grid display is slow

I have modal show a list of card product With display grid and col and row repeat(5,1fr) I have 50 product And i show 2 container with 2 container with 25 item Its take 4 seconde to show modal...

Is there a way to prevent these border-radius shine-through's?

So, like in the screenshot: you've got a dark background, inside it a light element with a border-radius and overflow:hidden And inside this element another one with a different background color (or an image). And the mask doesn't really fit the radius but you get these 1px background colored border lines.
I just saw a "solution" to paint this over / blur away on stackoverflow, which really just works in a few cases. Isn't there another way?...
No description

This ratio of this grid layout

it's simple, what would be the ratios of these rows and columns? ive figured out that in terms of cols, it's 12 but i can't figure out the rows.. any help? <3
No description

Aligning item in a Grid

Hi guys, how can I get rid of this white space which is between the logo image at the top, and the content at the bottom? Ideally, I would like for the content to sit right underneath the logo. I am using grid here. I used grid-template-areas property so the image would be at the right corner
No description

stretch a div to the bottom of the screen

I have a div that i want to fill the screen. how do i do this?
No description

Make 2 grid columns share the same size.

Hey guys, lets say i have a grid, that grid should have 3 columns. [ Logo | Nav | Button ] and i want Logo and Button to always be the same size so that nav is perfectly centered, but also only be as big as the largest of them, like auto would do, how would i do this? or is it completely impossible with CSS? Or Alternatively, if i only have [ Logo | Nav ] is there a way to add space next to Nav to make sure its still centered....

conquering responsive layouts lessen 9

i have been very frustrated with lessen 9 i almost gave up i compared day #9 to day 11 day 9 the columns are really off in 11 the bottom columns are right same code the only problem is the nav bar is stuck to left side. Please look at my codepen and tell me where my proble is https://codepen.io/Billyre/pen/abXepGw...

How to make this Line scroll in container with mouse

I am just new to js, working and practice I don't know about how mouse event will be used to make this line at middle to go with mouse I need help

[Next.js Deployment] Styles Not Applied in Static Export

I'm facing an issue with deploying a Next.js project. After following the steps for static export of HTML, CSS, and JavaScript files from the Next.js documentation (https://nextjs.org/docs/app/building-your-application/deploying/static-exports), the styles are not being applied. The generated HTML is just plain, without any of the expected TailwindCSS styling. What I've Tried: Checked the export path in the Next.js configuration....

Implementing a Non-Wrapping, Count-Based Multi-Select Dropdown with MUI Chips

I am using the MUI library for a project that involves a multi-select dropdown with chips representing the selected data. The functionality is working well, but I'm encountering an issue with responsiveness: the chips are wrapping onto multiple lines. What I would like to achieve is a design where, instead of wrapping, it displays a text like "+2 more" or "+3 more" at the end when there are more items than can fit in a single line. I'm not sure how to implement this feature in MUI. Could anyone provide assistance or guidance on how to achieve this in MUI? Code Sandbox Link: https://codesandbox.io/p/sandbox/mui-multiselect-sp4sg3?file=%2Fsrc%2FApp.js%3A10%2C13 I have attached my output and my required output images....
No description

Use subgrid in child element

I have a grid. It has 3 rows. Row 1: Header Row 2: Content Row 3: Block element ...

STILL NOT SOLVED: Inline svg mask not resizing?

well ive been struggling with this for way too long now, https://codepen.io/thecubiq/pen/LYqwRLM do you mind helping me to fix the svg mask to be responsive? thanks i tried defining viewbox, i tried using symbol and use. nothing working.....

pseudo element thickness varies

So while hovering these links on windows OS and in chrome, the thickness of the pseudo element on the anchor tag hover state varies. It doesn’t seem to depend on the order, sometimes it’s the first, sometimes the last, sometimes first and last, sometimes the middle, sometimes first two etc. cannot find any pattern and on Firefox or on Mac in chrome, they all look to be the same thickness. Photo of how I see it on windows/chrome https://imgur.com/vmg4cXD Here’s the code...