MarkBoots
MarkBoots
KPCKevin Powell - Community
Created by snxxwyy on 6/28/2024 in #front-end
image not behaving as intended unless wrapped in a div
min-width: 0 will do the trick i think
8 replies
KPCKevin Powell - Community
Created by Daryl M on 6/28/2024 in #front-end
Stop focus to the embedded form
I never used it before, but maybe one of the sandbox attribute values can help here? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
9 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
ah no, that indeed wont work, because the children depend on the width i've updated the pen with a possible sollution
15 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
you could do width: fit-content
15 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
ah okay, the gap is because of the translate. it's not nessesarry anymore to translate the second one to the right by default. it already is thanks to the grid https://codepen.io/MarkBoots/pen/WNBWbyL
15 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
gonna need to see more than this. can you make a codepen/sandbox
15 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
i dont really understand tbh. what about this https://codepen.io/MarkBoots/pen/vYwPzap?editors=1100
15 replies
KPCKevin Powell - Community
Created by Dennis on 6/26/2024 in #front-end
Parent container with child elements position: absolute does not size properly to fit the children
why make the .first and .second absolute?, you can just make them regular childs of the .paginatedContainer
15 replies
KPCKevin Powell - Community
Created by Irtal on 6/26/2024 in #front-end
I want to create an effect and i dont know how
besides the techniques of drawing on canvas, there will be a lot maths/physics to apply. I would suggest watching some video's of 'Frank's Laboratory' on youtube. He does a lot of canvas animations/interactions and explains the process really well https://www.youtube.com/c/Frankslaboratory
4 replies
KPCKevin Powell - Community
Created by snxxwyy on 6/25/2024 in #front-end
grid-template-columns vs grid-auto-columns
- the first will wrap to a new row if there is no space. - the second just sets a default for a column. (could be usefull if you have set grid-auto-flow: column for a horizontal scroll p.e.)
10 replies
KPCKevin Powell - Community
Created by xilli on 6/24/2024 in #front-end
focus-visible not properly working on inputs
you could do a bit of js
<input type="text">
<input type="text">
input.no-focus {
outline: none;
}
input.no-focus {
outline: none;
}
const inputs = document.querySelectorAll("input");
inputs.forEach(input => {
input.addEventListener('pointerdown', focusInput);
input.addEventListener('blur', blurInput)
})
function focusInput(e){
e.target.classList.add("no-focus");
}
function blurInput(e){
e.target.classList.remove("no-focus");
}
const inputs = document.querySelectorAll("input");
inputs.forEach(input => {
input.addEventListener('pointerdown', focusInput);
input.addEventListener('blur', blurInput)
})
function focusInput(e){
e.target.classList.add("no-focus");
}
function blurInput(e){
e.target.classList.remove("no-focus");
}
if the input is clicked (pointer-down) the class no-focus is added, when leaving the input (blur) the class will be removed
13 replies
KPCKevin Powell - Community
Created by Ali on 6/24/2024 in #front-end
Any idea how to achieve these animation?
you could also look at lottie
7 replies
KPCKevin Powell - Community
Created by Ali on 6/24/2024 in #front-end
Any idea how to achieve these animation?
yea, it would be doable with a lot lot lot of css. but svg is the way to go here
7 replies
KPCKevin Powell - Community
Created by Dylan on 6/24/2024 in #front-end
Trying to make a website for tracking student attendance and behaviour
have to learn some back-end and db stuff as well.
16 replies
KPCKevin Powell - Community
Created by big saf 🍉 on 6/23/2024 in #front-end
How to filter specific key + values in Javascript
const filtered = array.map(entry => {
const { name, office } = entry; /* deconstruct the object's specific keys */
return { name, office } /* return an object with only those key/value pairs */
}
const filtered = array.map(entry => {
const { name, office } = entry; /* deconstruct the object's specific keys */
return { name, office } /* return an object with only those key/value pairs */
}
19 replies
KPCKevin Powell - Community
Created by Incognitus on 6/23/2024 in #front-end
Is it possible to use container queries on container itself?
no, only on the childs (or pseudo elements). so probably you want to wrap the card in a div and make that the container. I know you have already considered that, but it's the only way as far as I know)
6 replies
KPCKevin Powell - Community
Created by big saf 🍉 on 6/23/2024 in #front-end
How to filter specific key + values in Javascript
please give me an example of the data you have and the result you want
19 replies
KPCKevin Powell - Community
Created by big saf 🍉 on 6/23/2024 in #front-end
How to filter specific key + values in Javascript
const results = people.filter(person => person.age === 10 && person.gender === 'male');
const results = people.filter(person => person.age === 10 && person.gender === 'male');
this returns an array of person objects that match the criterea
19 replies
KPCKevin Powell - Community
Created by lanszelot on 6/23/2024 in #front-end
JS why everythingis changing in the array?
if you make it a form, you can take advantage of the new FormData() constructor that makes it easier to collect all the fields and values.
<form class="elrejt" id="teszta">
<label>Tészta hozzávalója: </label><br>
<input type="text" name="teszta_hozzavalo"><br>

<label>Mennyiség: </label><br>
<input type="number" name="teszta_mennyiseg" min="0" step=".01"><br>

<label>Mértékegység: </label><br>
<select name="teszta_mertekegyseg">
<option value="sanyi">---válassz mértékegységet---</option>
...
</select>
<br>

<button type="submit">Hozzáadás</button>

</form>
<form class="elrejt" id="teszta">
<label>Tészta hozzávalója: </label><br>
<input type="text" name="teszta_hozzavalo"><br>

<label>Mennyiség: </label><br>
<input type="number" name="teszta_mennyiseg" min="0" step=".01"><br>

<label>Mértékegység: </label><br>
<select name="teszta_mertekegyseg">
<option value="sanyi">---válassz mértékegységet---</option>
...
</select>
<br>

<button type="submit">Hozzáadás</button>

</form>
const tesztaTomb = [];
const form = document.querySelector("#teszta");
form.addEventListener('submit', handleFormSubmit)

function handleFormSubmit(e){
e.preventDefault();
const data = new FormData(e.target);
const teszta_hozzavalo = data.get('teszta_hozzavalo');
const teszta_mennyiseg = data.get('teszta_mennyiseg');
const teszta_mertekegyseg = data.get('teszta_mertekegyseg');

tesztaTomb.push({
teszta_hozzavalo,
teszta_mennyiseg,
teszta_mertekegyseg
})

console.log(tesztaTomb)
}
const tesztaTomb = [];
const form = document.querySelector("#teszta");
form.addEventListener('submit', handleFormSubmit)

function handleFormSubmit(e){
e.preventDefault();
const data = new FormData(e.target);
const teszta_hozzavalo = data.get('teszta_hozzavalo');
const teszta_mennyiseg = data.get('teszta_mennyiseg');
const teszta_mertekegyseg = data.get('teszta_mertekegyseg');

tesztaTomb.push({
teszta_hozzavalo,
teszta_mennyiseg,
teszta_mertekegyseg
})

console.log(tesztaTomb)
}
4 replies