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

How to make a Quiz App disable other options after an option is selected?

Hello, i need help with my Javascript quiz app. I need to disable other options after an option is selected. I also need to find a way to make sure that when the "Next" button is clicked, the previously selected options/buttons are deselected. I've tried doing this myself but wasnt able to. I'd appreciate your help....

Position Sticky different behavior between Browsers

I am currently trying to make a Modal which is in the middle of the screen. But if the screen gets smaller in the Y direction it should stick to the top with some margin. In firefox (V: 117.0) it works as expected but if i try to look at it on other browsers like chrome (V: 116.0.5845.188) (edge (V: 116.0.1938.76) it overflows somehow and i do not know why. Are there any other solutions to achieve this or am i doing something wrong. Here is the code on codepen:...

5t3ph Eckles npm for static site

Hi - I was using the Live Server and Live Sass Compiler in VSCode until last week when I found Kevs video about the npm from Steph Eckles. I donโ€™t really know how it works but is someone able to check the lines Iโ€™ve added for assets and for js? Donโ€™t want to miss something stupid!! Thank you!...
No description

semantic tag uses

Hey, Iโ€™m wondering what sort of designs or sections of a website require certain tags semantically. For example, cards tend to use <article>, would anyone be able to give any insight or even a link to a a guide perhaps? Which leads me to another question, should span only be used for styling portions of text or are there more use cases for it? Thanks in advance!...

blend problem

is there a way to blend this background image with some kind of image so it covers the below section does not look like its a different section i mean can the land part of image extend some how background repeat or smth?
No description

Semantic HTML

I'm a beginner, and I'm unsure on how to set my semantic elements. Which tag should I use for main, article, section, and div on HTML? Please assist.

How to accurate the canvas height with mobile keyboard shown?

Suppose I want the red Div to remain centered regardless of whether the keyboard is displayed. I've noticed that the canvas height remains fixed even when I use 100%, 100vh, 100dvh, 100lvh, or 100svh. Here's the pen I'm working on: https://codepen.io/hackett-lai/pen/eYbvbwM What's the best solution for this scenario?...
No description

How do you know if the user is using a Mac?

So I found this code online:
window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey
window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey
The problem is that platform is deprecated, what can I use instead? This is the entire code, basically i'm trying to run a function if the user presses CTRL + S or CMD + S ofc...

XHR "error" event listener not working when URL is wrong. Confused as to why

Working through Colt Steele's JavaScript course, and learning about XHR. This snippet is supposed to throw an error when the URL isn't correct. If I type gibberish like /planetiuhnuoidhfugn/ it still works/I'm not seeing an error in Chrome DevTools. It'll throw the error if I change "swapi" to "swap" or "dev" to "co" as "swapi.co" no longer exists: ```js const firstReq = new XMLHttpRequest(); firstReq.addEventListener("load", function () { console.log("IT WORKED!!!");...

question about assigning a function to a variable

I'm testing and trying out some new things I recently learn about functions and I come across something like this ```js let testFunction = function() { console.log('Hello')...

How can I implement the lines shown around the "enter" button

I am creating a react portfolio using some designs I made on Figma. My goal is to replicate the enter button shown below where the two lines are split by the word "enter". Is there a way to make this work using tailwind css? Here's my code below: ```...
No description

How to get an element to fit within its parent?

I'm working on a simple layout: https://codepen.io/u3b4/pen/gOZmKmw The basic structure is something like: ```html <main>...

Grid properties issue

Html: <div class="branding" <img src="image" class="img-1"> <img src="image" class="img-2"> <img src="image" class="img-3">...
No description

Optimized way of implementing Hero background Video

Does any of you have some experiencing with optimizing a video, which is played, in loop and with autoplay, the background of a website's hero? It is currently quite large (around 10MB), which is clearly too much for a user to download, but it still needs to be of fairly good quality Thank you in advance! ๐Ÿ˜Š...

having problem centering in mobile version

i dont know why its not center in mobile version can someone help me out ```html <!DOCTYPE html> <html lang="en"> <head>...
No description

Magento 2 Override PageBuilder carousel/widget.js

I want to extend the 'initSlider' function from 'Magento_PageBuilder/js/content-type/products/appearance/carousel/widget'in my custom model with mixin. ```javascript var config = { config: {...

Trouble with pseudo element

Hi everyone! I'm trying to replicate this line between the bullet points in the screen shot. Code pen link https://codepen.io/ezekielswanson/pen/qBLrXYJ ...
No description

CSS dev build is inconsistent with deploy build

Everything looks good and works fine in my react app dev build, but some css styles aren't being correctly applied to the production build i host on my github pages through gh-pages npm package (through this guide https://github.com/gitname/react-gh-pages) this is my hosted app: https://arthwr.github.io/little-lemon-app/ The problem with mobile version hamburger button. ...
No description

Let vs var vs const

Can any one help me understand how these three different ways to create a variable really works within a function? From what i already learn var is functions scoped let and const is block scope. Whats confusing to me is does this mean that if I create a variable using var I can use that variable anywhere inside the function and let/const can only be used within a specific block for example a if/switch statement? Also how do you even know when its the right time to use a specific type of variable?...