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

transition property not applying after changing it via js

im changing width via js to simulate the scale. when i do that the transition property is not applying and the change happens sudden but when i reload the data saved in local storage is retrieved and the transition is applied.

Frontend Mentor Question & Feedback

https://www.frontendmentor.io/challenges/article-preview-component-dYBN_pYFT Attached are the desktop and mobile versions. My question is: I feel like the way I set up the layout is too hardcoded. I relied a lot on max-widths/heights instead of letting the content be dynamic. I'd appreciate some feedback; this was a lot harder than it should have been for me especially since I'm not exactly new to html/css, so I guess I'm not as good as I thought I was 😂 https://codepen.io/vince1444/pen/YzOgYeM...

After applying position sticky, button not working

I created a sidebar with buttons to locate throughout the document, but after applying position sticky, buttons are not working at all not even hover effect is working

Why is my JS not working?

(JS Fiddle for context: https://jsfiddle.net/qLry5cwx/2/) The js is supposed to display a modal but it appears to not even try to execute. The code still works in another project of mine, from which I ripped all of the code, but not on my new site. I cannot figure out for the life of me why it isn't working. Can someone help me? Cheers...

How to stop browser from applying system default theme to my site?

Some browsers like via browser are applying system default theme to my site, how can I prevent this.

Manifest v3 extension refuses to load styles in Chrome, no issue in FireFox

I am at a loss. FireFox will happily load the CSS files I've listed, whereas Chrome will not. I've made sure to re-run my bundler, reload my extension, and update my browsers. ...

Custom Music Player - Play song where it left off after Page Refresh

Hi, I don't know much about JS so i have a piece of JavaScript code used for a Custom Music Player that was created with ChatGPT. But ChatGPT seem to have some limit for how long code it can write because when i ask to fix so the song will keep playing after i refresh the page, it stops generating the code pretty much in the middle of the script... So i hope that someone here can help me fix this. I do know that localStorage needs to be used. But i dont know exactly how to do it. The script is too long to paste here in the chat so i have to upload it to pastebin......

fetch

I'm aware fetch has a getReader within it's response for handling streams but can I append chunks of mp3 data into some html audio file to achieve Audio buffering before play (so I can play the audio before it's fully loaded) kind of like SoundCloud and what YouTube does with video... I tried with Audio type didn't work any other web audio things to achieve this?

Why do only some styles in my media query work?

(Jsfiddle for context: https://jsfiddle.net/0w34L6sr/10/) For some reason, it seems that only some styles defined in my media query for width are applying when their parameters are achieved. Like when the screen width is less than 50rem, the icon font size should reduce from 2rem to 1rem and the left border on the span should disappear, but neither appear to apply. Another problem with media queries that I'm encountering (not in the jsfiddle) is that some styles have to be in their own media query to work, even though the query parameters themselves are identical....

Keep text within a div with complex shape created with clipped path

Hi! I'm looking at code examples to create a hex grid using CSS and want to achieve a hex grid that allows content of all types. The examples are all graphical or photo based, and when I play around with them trying to add text elements, it is clear that clipping paths don't actually define a hexagonal box but rather adjust the visuals to look and act hexagonal for visual purposes. However, I want a true hex shape that I can place text within that will allow automatically breaking and adjusting text to the hex shape. Has anyone had any experience with similar designs?...

Issues with time (rfc2822Date to longformat)

im getting time from api's and i wanted to change the styling of time from Sat, 25 Mar 2023 10:05:20 GMT to Saturday, March 25 at 3:35 PM the only issue is the time, it has to be 10:05am instead its taking 3:35pm. i dont know where this 3:35is getting from, im not in that timezone etc. this is the code which im using ...

Guidance on how to handle .json with many objects which contain .svg images

#general I have a "jobs.json" file which holds many 'job posting' objects which will be imported into my index.js and then looped thru, in order to ultimately have their information be added to the html via template literals. My issue is that each object includes, as its "image" property, an .svg image. ...

animation: rotate linear + scale alternate-reverse

https://codepen.io/JunSu-Ho/pen/dyqwQGd how do I combine those animations?, I need scaling to be alternate-reverse, but I want rotate to be linear, rotating same direction not reversing...

How save changes to HTML on reload?

So if I dynamically add HTML elements, and reload the page, for it to not return to default but to be shown with the changes. I'm wondering is there simple code for it? ```js...

HTML Image Maps - Is this feature worth learning?

Hello. I'm currently learning HTML and have came across the HTML Image Maps element. For those of you with experience, is this used often? I can't seem to think of a scenario as to where this would even be useful. Not to mention that its probably not that good for assistive technology? It seems pointless, and just wanted to ask if its even worth researching and learning about the feature. Thanks.

Weird button hitbox(click-area?)

Hello! I'm having problem with button click-area when using Event Delegation. Basically only a small part of button is respond to being clicked if button has content inside of it, but if I directly target it with EventListener it works fine. Why is that? Picture below is example of a button, consisted of <img> and <p> tag. It only registers click when clicked between the "arrow" and "Reply" text when being targeted by EventDelegation, but works fine when you attach Listener to it. Project link below if you want to test it. When you click in between arrow and text, in console "Not working" text will appear, when it should appear when clicked on the whole button....

getting two different value for the full viewport height using css and javascript

hey folks I'm using these two different methods to get the full viewport height I dont know why these are giving two different values 1st Method by pure css ```css .root {...

Input Field Function on JS

Hey guys can I ask how can I implement a function on js. This is my brain thinks when click on a input field the h1 title should be change to somewhat any color to make the title h1 focus. I have a h1 title which is Question 1 that has color black and I have also a Input where they should put an answer....

Website jumps around when virtual keyboard is up

I have a login page. ( used in full screen mode like a PWA. Added to home screen ) When the user clicks on one of the input boxes the virtual keyboard pops up. When the user finishes typing the username he either wants to click away from the box to be able to click to the login button or wants to click to the password input box. When the user clicks away the virtual keyboard hides but bring the page with itself to the bottom. And if the user clicks again, the website jumps back to it's normal position. I have included a gif demonstrating the problem. and here is a codepen link: https://codepen.io/drrandom/pen/eYLbBdq...