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

need some help in loops in js, can someone hop on voicechat?

need some help in loops in js, can someone hop on voicechat?

I am losing my mind on this nav problem

I have a simple navbar. It is not centering in the middle of the screen, no matter what I do. I cannot recreate the issue in codepen. I've stripped out all of my html and css besides my nav. Here is my html: ```html <body> <main>...

Responsive carousel

I've created this carousel, with the help of js, html and css. Functionality seems to work. But when I try to adjust the code so that when there is no more cards on left or right respective arrow should disappear. Right now it just loops. Another q: Is it possible to update this to a responsive carousel? Normal page load is 3 * 3 tile. But the screen size is small then maybe 2 * 2 or something like that to adapt the changes. Codepen: https://codepen.io/Abhi1234567890/pen/yLxLGXV...

AI autocomplete

I need to implement ai autocomplete, but don't know where to start! Any idea/resource where I can check?

Fonts not appearing in my network tab but getting no errors in my code

I'm using vite as a build tool What could be wrong in my code or set up, I have attached the image...

The observer pattern and nested objects

I'm just struggling a little with the observer pattern and preventing observers from registering multiple times. I've got a model that implements an Observable interface, so registerObserver/removeObserver and updateObserver functions, and a View with a constructor that calls this.model.registerObserver(this). The problem is each view can have nested views, and those views are created with the new keyword. That means (I think) that I'm unable to run a check in the registerObserver function to make sure that the view isn't already registered :/ Am a bit stuck!...

Display flex vertical alignment and responsiveness or position absolute?

I'm trying out various ways to do this and so far only position absolute made sense to me to get accurate spacing. With display flex there was a lot of spacing issues which were solved with margins but way too much tweaking was involved. Any advice on which other approach you suggest and please explain why over display flex or etc. Thank you. https://codepen.io/3dharp/pen/KKGKZNo...

@use not working

I am trying to use @use to import my reset nd nav code but its not working

Position absolute DOESN'T work

Hey, I'm trying to put the icons side by side with the text that I write from the modal. But the position absolute in the CSS it is not working. How can I solve it? I want the icons to be in this position loke in the image below: https://codepen.io/ssstephanyyy/pen/poOmdZY...

Why react script doesn't work

hello everyone, i'm trying to learn react js from SCRIMBA courses, and i copied the same scripts but still wont work, even i put the scripts on head didn't work even in body won't work anyone help me please?

position: relative;

Hey everyone, I have div which has a padding on it, within that div I have an image. These are the styles ```css div { padding: 1rem; }...

Needed guidance on a loading page layout

Feels like im playing tag of war of the margin top and bottom values. attached the design to this post. Here is the codepen:...

Undefined variable in component

I'm getting a lot of my variables undefined and ran at times when they shouldn't run. My best guess is that it is related to the way I make the Api call. When I run the program, the console statements doesn't get printed on chrome but on edge?? When I start the problem I get the error ERROR TypeError: Cannot read properties of undefined (reading 'trim') in app.component.ts ngOnInit() when I try to read csv. The csv are not empty and this method works as expected to load the csv into the arrays...

How to name font color variables in scss/css

I have 3 font colors, how to name the variables? color-light color-mid-dark color-dark? color-primary color-secondary color-trinary?

HTML5 input type="date" tag ignoring assigned value in script-triggered picker in Firefox

Can someone offer a workaround for this problem? Objective: allow date picker to appear when wrapper element is clicked for a date element which does not allow direct access. ```html...

Parent and child constructors

if I have a UserForm class:
class UserForm extends View {
// no constructor
}
class UserForm extends View {
// no constructor
}
...

Need Help with Grid

Code Pen: https://codepen.io/Arslan-Akbar/pen/poOMadb Images included also with grids So I'm trying to learn grid by making a small project....

Keeping getting the push ERROR

I keep getting this ERROR in the console everytime I call this function as you can see in the image. Why is this happening and how can I solve it? my intention with code was to create a new list of array everytime I change the const data and not to substitute the before alteration with a new one like the code is doing

Get the content inside div

say i have the following div
<div class = "button">420</div>
<div class = "button">420</div>
...

Facing problem while using border-image-slice

I am using this code in order to learn about border-image-slice and other related property. The problem is the unit of value defined for border-image-slice. Eg i get different output if i supply value 35, 35px and 35%. I understand the reason for the %age value, but shouldn't the output for other two be the same? I have also attached the image i am using in this example....