@TSune-web
Submitted
Hi, Frontend Mentor community! 👋
For this challenge, I struggled to figure out how to read the local JSON file provided with vanilla JS. If you have a cool trick for this, I'm happy to hear that!
Happy coding! ☕️
@sylverdrag
@TSune-web
Submitted
Hi, Frontend Mentor community! 👋
For this challenge, I struggled to figure out how to read the local JSON file provided with vanilla JS. If you have a cool trick for this, I'm happy to hear that!
Happy coding! ☕️
@sylverdrag
Posted
Looks good, but there are couple issues:
function highlight_day(){
const d = new Date();
let day = d.getDay();
let bar = ".bar:nth-child("+day+")";
$(bar).css("background", "hsl(186, 34%, 60%)");
}
For instance:
var fraction = maxAmount / 100;
let barHeight = stat.amount /fraction;
bar.style.height = barHeight + "%";
Marked as helpful
@justinnvera
Submitted
How can I improve my CSS positioning?
@sylverdrag
Posted
Some suggestions:
border-radius: You have border-radius in "main", and then you realized this didn't work as expected, so you added a border radius to the image as well. You can avoid doing that using "overflow: hidden;" on "main". This hides everything which goes beyond the area of "main"
letter-spacing and small caps: Instead of spacing capital letters manually in "P E R F U M E", you can use CSS to get better control: font-variant: small-caps; letter-spacing: 0.2rem; This gives you a better control on the spacing, and it is more SEO friendly ("perfume" is a keyword, P E R... is a sequence of individual letters).
You can declare only one type of display per element. If you declare more, only the last one applies: main .checkout button { display: block; display: flex; is the same as main .checkout button { display: flex;
The original is split half-half between image and text. You can do that by assigning 50% to your ".hero-image-container" and adjust ".text" to include the padding (so about 45%). A better way to do it is to give the main container a width in rem and split it in half for the image and the text, that way it will scale, but you can also get the proportion exactly right.
Anyway, good job on your first solution. I hope this helps.
@nikhil149
Submitted
Unable to design circle Icons on top container. Can anyone help on that.
@sylverdrag
Posted
The "circles" is in fact a logo picture which you can find in the images provided.
Alternatively, you can draw the logo fairly easily with a couple divs, a border radius of 50% to turn the div in a circle, z-index to put one on top of the other, and a bit of positioning.