Kivory
Kivory
Explore posts from servers
KPCKevin Powell - Community
Created by Kivory on 1/10/2025 in #front-end
What's wrong with my JS code here?
This is code to make each ".user-message" div that's created test if its font-family is "Roboto", and if it is, to change the font size to 40px.
let paras = document.querySelectorAll('.user-message');

paras.forEach((para) => {
let compStyles = window.getComputedStyle(para);
let computedFontFamily = compStyles.getPropertyValue('font-family')
if (computedFontFamily == "Roboto"){
para.style.fontSize = "40px";
}
}
)
let paras = document.querySelectorAll('.user-message');

paras.forEach((para) => {
let compStyles = window.getComputedStyle(para);
let computedFontFamily = compStyles.getPropertyValue('font-family')
if (computedFontFamily == "Roboto"){
para.style.fontSize = "40px";
}
}
)
new divs with the ".user-message" tag are created every second. none of them are having their font size changed though when they're created. What's the way to go about this?
18 replies
KPCKevin Powell - Community
Created by Kivory on 1/9/2025 in #front-end
How do I make an animation where a div goes from height: 0px; to [its regular height]?
one of my divs has a height that depends on the content inside it, and i want to make an animation for it to start out with a height: 0px; and then expand to have its regular height. How could this be done using @keyframes?
22 replies
KPCKevin Powell - Community
Created by Kivory on 11/23/2024 in #front-end
Decreasing window width (of browser) causes <body> to stop stretching to fit the entire page?
No description
13 replies
KPCKevin Powell - Community
Created by Kivory on 11/21/2024 in #front-end
Error trying to change src of image using javascript
function changeImage(index) {
console.log(`${index+1}`);

var image1 = document.getElementById("img1");
image1.src = `images/${index+1}/1.png`;
}
function changeImage(index) {
console.log(`${index+1}`);

var image1 = document.getElementById("img1");
image1.src = `images/${index+1}/1.png`;
}
TypeError: image1 is null What's going on here? console.log returns "1" just fine, which is the name of the proper directory.
19 replies
KPCKevin Powell - Community
Created by Kivory on 11/21/2024 in #front-end
How to parse through images in a folder and display each image on the webpage?
I'd assume to use document.createElement() in a for loop for each file in the folder. How can I go around making that for loop though? How can I use javascript to read what's inside the folder?
4 replies
KPCKevin Powell - Community
Created by Kivory on 11/21/2024 in #front-end
Trying to get a custom div to follow the cursor. Gives me error "cursorDot.style is undefined"
Here's the code I used in my javascript file:
const cursorDot = document.querySelectorAll(".cursor-dot");

window.addEventListener("mousemove", function (e) {

const posX = e.clientX;
const posY = e.clientY;

console.log(posX);

cursorDot.style.left = `${posX}px`;
cursorDot.style.top = `${posY}px`;

});
const cursorDot = document.querySelectorAll(".cursor-dot");

window.addEventListener("mousemove", function (e) {

const posX = e.clientX;
const posY = e.clientY;

console.log(posX);

cursorDot.style.left = `${posX}px`;
cursorDot.style.top = `${posY}px`;

});
and the HTML and CSS:
<div class="cursor-dot"></div>
<div class="cursor-dot"></div>
.cursor-dot {
height: 15px;
width: 15px;
background-color: white;
position: fixed;
top: 0;
left: 0;
transform: translate(-50%, -50%);
border-radius: 50%;
pointer-events: none;
z-index: 1;
}
.cursor-dot {
height: 15px;
width: 15px;
background-color: white;
position: fixed;
top: 0;
left: 0;
transform: translate(-50%, -50%);
border-radius: 50%;
pointer-events: none;
z-index: 1;
}
error in console: "cursorDot.style is undefined"
3 replies
KPCKevin Powell - Community
Created by Kivory on 10/3/2024 in #front-end
Following "infinite horizontal scroll animation" tutorial from Kevin on Youtube; not working (help!)
No description
35 replies
AAdmincraft
Created by Kivory on 8/14/2023 in #questions
Dangers of enforce-secure-profile being set to false in server.properties?
What kinds of problems could I run into?
11 replies
AAdmincraft
Created by Kivory on 7/14/2023 in #questions
The longer I leave the server running, the more the RAM usage increases until it crashes
Even if nothing unordinary is happening, just the longer the server is up, the more the RAM usage increases until it crashes. It's peculiar because the server works perfectly fine the entire time, the TPS is always 20. I ran a Spark profiler and have the result. Give me advice on what I can do.
40 replies
AAdmincraft
Created by Kivory on 7/5/2023 in #questions
Server host with the best deals? (that isn't server.pro)
My bank's having issues with server.pro atm and I want some good alternatives with good deals on hosting.
6 replies