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

Page loader

Is it possible to display actual page loading progress like from 0% to 100%?

Code Refactoring JavaScript

Hello, I was practicing dom and trying to use functions to reduce amount of code, this is what i did first:

how to make a Quiz app generate Randome options/answers from an array.

Hello. I’m building a quiz app and I’m trying to run a function that selects random answers from an array quizObject[question]. I tried looping through the array to get the answers but it still didnt work. I also realized that when it works, the answer with the “isTrue” variable will be displayed along with a text of “isTrue”....

How to select certain Index in Array?

Hello, Let’s say for example I have an array such as: let sample = [“5”,”+”,”6”];...

How to embed a rich-text editor on a website?

For starters, I'm sorry if it's a wrong place for this question, I wasn't sure where should I ask it. I'd like to add a rich-text editor to my website, because I want to allow my user to create long content, and they may want to input code blocks, links, images and so on. How do I do that? Do I need a CMS for that? Or maybe some plugin? I tried to do the research on my own but I haven't found anything that would be of any help. Also, I have no previous experience working with CMSs, so I'm not even sure what should I look for....
No description

Hero Section help

first time making a hero section, i am using flexbox. do i give it a set height or no? if so what is the best practice. im trying to make my hero look like his, its pretty big but doesnt go all the way down...
No description

Navigation list sliding from hamburger menu.

Hey guys, getting desperate again with probably trivial question, but hopefully someone could help me understand what can i do here: I am trying to build sliding navigation bar on mobile version of my react-app by using hamburger menu. I also want it to be smooth animated. I can't figure out how to properly do it. Usually in tutorials they do it either with top: -100% to top:0 by using parent position: relative and child position: absolute and they slide from top of the browser (or translateY). However in my case i have 2 top elements that are positioned above the navigation menu, thus they slide in through them and also background of container div isn't applying its background color when button is active. I want it to slide below logo and hamburger button, not from the top of the browser moving through it and also extending background of div container that wraps both header and nav ...
No description

Help me with html `video` tag

When I browse sample videos on Android browser it doesn't play the sound. Anyone know the reason?...

Undefined Variable

I'm working on building a calculator app with little knowledge of JS (jumping into an example to force myself to learn). What I'm trying to do is take an input and add to a variable 'total'. Currently, the variable 'total' is undefined. Based on button click, it gets defined by whichever number is pressed. However, when outputting, it pre-fixes with 'undefined' despite being defined prior to output (see attachment) How could I go about fixing this?...
No description

Dragging webpage Horizontal and vertical

http://christmas.rogue.studio/ can anyone give a rough idea on how to create a dragging webpage like the above website...

How to place this svg as my background footer with Tailwind?

Guys i dont know how to do this. I want my footer exactly like this but i have it fixed on the screen. So if i scroll up it follows me. Here is the Footer component where i think only the "relative z-50 bg-footer" classes are relevant: ```react "use client"; import Link from "next/link";...
No description

Google reCAPTCHA v3 sitekey missing (only in production)

I'm trying to add reCAPTCHA v3 to my website, it is made with React.js and Vite, hosting with Netlify. I am storing the sitekey variable in a .env file using "VITE_" as the prefix, and calling it with "import.meta.env" instead of "process.env" (gives errors otherwise). It works perfectly in localhost but for some reason in production I get the error: "Missing required parameters: sitekey", when console.logging the variable it comes out as undefined. I also tried to add the variable through Netlify but it also comes out as undefined.. Can anyone help me? Thanks in advance!...

Pagination

I need help with my pagination. What I wanna do is have a pagination I can use to access the pages in my HTML file. Also, I want the pagination to have previous and next buttons. Please help out

RESPONSIVE DESIGN DOUBT

guys in web development while developing html files is it only the <meta name="viewport" content="width=device-width, initial-scale=1.0"> tag is enough to create a web page set for all devices view or is there any other points to consider...

Horizontal scroll bar not appearing in Chrome, for absolutely positioned flexbox div inside a grid.

TLDR: I am expecting to have a horizontal scroll bar appear on a div. However no scroll bar appears in chrome browser, and an uninteractive scroll bar appears in firefox browser. The scroll behaviour does work using gesture / shift+scroll wheel. Reproduction of the bug is in attached .mht file, attempts to recreate it "simply" in codepen etc have been unsuccessful. The application is an online card game and there is one section where a player can keep multiple cards, named "permanents" In the attached .mht file I have one example where there are multiple card divs inside of the permanents zone (see screenshot for issue)....
No description

Add vertical line

how can i add vertical line like in image i have tried it by using border-left but it height become equal to the div height check the attach image and here is my code link"https://play.tailwindcss.com/NS1BlJ5Wh3?file=css
No description

Small white space at the bottom of my website.

I am making a website using react and tailwind but I just came across some white space at the bottom of the website screen when viewing it. The only thing that has fixed this white space is with overflow-auto on the outermost div in my App.js file. I feel like there is a better way to handle this though. I have tried h-screen, min-h-screen, h-full, and min-h-full and nothing seems to help. Here is my code:...
No description

custom property choices

Hey, i've been seeing many ways to go about custom properties and i'm wondering what exactly the most beneficial layout method is. i'd really appreciate an explanation anyone may have with this, thank you in advance! for example some people tie it in with utility classes like so- ```css :root {...