aligning svg's with text and creating underlines that don't "chop" at the end due to margins.
It could just be my eyesight, but these SVG's look to not be lining up correctly with my text (also, do you hate the font as much as I do right now?)
I'm also wanting to add an underline/border-bottom the Projects, which is fine if I have no margin, but when I add margin it creates gaps at the end.. reason I'm using margin is because the SVG sits right at the very end of the page without anything there to bring it in a little.
145 Replies
This is the top 3 lines, they're the exact same code as this
Projects is the below code
Wait why are they buttons
Does it change something on the page rather than redirect you?
Bruh you are doing this all wrong š
only this area should be changing D:
Ah that's a tricky one. So you basically want SPA functionality without making an SPA
If I understand correctly
Usually SPAs still use links but they change the functionality based off the route in the URL
Basically
I have no idea what I'm doing and i'm winging it
š
Lol if this is just for practice using buttons is fine
You should still have them in a list though
I believe the projects are in a list
Oh is the projects button a dropdown?
Got it
nah the + brings up an input field
Oh okay
So you're trying to align the svg on the left of the projects with the projects text right?
Yep
It's a h3 with the svg inside the h3 tags
<h3><svg blablabla>Projects</h3>
I wouldn't put it in a heading, I'm making a codepen rn
What font is this again?
doesn't matter, I don't like the font
honestly the entire thing needs refactoring, it's super scuffed š
Haha me on every project I make ever
Font probably matters because of their glyphs so it might not be perfectly aligned unless you add some hacky margins
yea don't use h3
or any heading level for a nav/buttons
it was originally just a p tag
No negative margins
margin-bottom: 2px
going back to a point earlier, you said buttons are a bad idea for the links?
https://codepen.io/vince1444/pen/Yzdyqpb
Yea, if they're affectively changing a page I'd imagine you want them to be anchors, but what you're doing is basically an SPA without client-side routing. I have no idea how you'd set that up yourself
You'd probably want to leverage any SPA framework out there instead of making it yourself but it might be a good learning opportunity
he is following some BS from Odin project
It's supposed to just be a site built using modules
its not by his own doing lol
I've kinda just done.... it oddly
yeah if I had svelte or reacte this would've been done much much easier š
stay on topic though
only needs help with align center xD
mod power š
so in general, you display: flex, align-items: center;
Ya you can use grid too
and then if there's any irregularities it's likely a font issue?
You don't even need flex or grid either you can use inline elements too I'd imagine if you really want too lol
any idea how I sort the underline issue I had also? (also in the title, don't hit me b1)
lol
If you care about backwards compatibility flex gap isn't supported <2020 in Safari I don't think so you'd want to use grid if you want to use gap or use margin-right/left
I've influence Vince enough I just watch him.
<,<;;
Yea each font is different, so adjust line heights and margins to get it pixel perfect
Nod nod
I've learned a lot from you š
Wym?
oh get a room
š
Did we just both add the rofl emote at the same time
that's crazy
So I have this
notice how the svg is right up at the edge
You want to add padding and remove the underline?
I don't see anything in your code that would cause it I don't think, that you sent here
Ah actually that one is fine
I think it all lines up
(I'll fix the projects svg)
Cool. Also I'm not competent with accessibility so this could be wrong but if you keep the buttons I think you'd want to add aria attributes like aria-controls/aria-expanded
I'll probably change them later mate, no worries
reading through the code, the entire thing's a bit of a mess š
yo cdl
are you doing css today
Bit of everything!
nice
css is a nightmare
I'd advise him to just complete the project to specs he is following a lesson plan.
chatgpt cant even do that shit
I mean its one thing if you have a good idea nad want to expand on the project sure.
but adding complexity when he is trying to nail down specifics is not always great.
Ya that makes a lot of sense
like its easy for you to say that cause you think about and have been already xD
have you seen my code, and the specs, b1?
I don't think I'm anywhere close š
but I don't disagree totally but I would use proper summary/details then
if you are going to break their lessons break them right
xD
it says use modules and webpack, I used vite and i have 2 modules for random parts, then ive just bundled everything into a main.js file
then my mentor was like "hey we need state, let's add render functions"
hahaha
and now im like WHAT IS GOING ON
Yea idk man...
uh oh
I really wanna make a from html to frameworks* course lol
quick favour b1, if you don't mind. Look at the code, and let me know how over-complicated i've made it? I'm genuinely curious
I see the struggles and so wanna provide something better... these roadmaps are stupid
wow
specially with the industry taking a full circle right now with SSR/SSG/Hybrid/Transitional apps
when most devs had no idea how the web has worked for generations
they see the hype and think its how its done to get a job
10% of websites work like that xD
70% are php
damn youre literally talking to me rn
lol I also got switched up thought we were in general again
sorry CDL hijacked
walks away bad mod
unbelievable.
@CDL who are you being mentored by
creating SPA with plain javascript is like extremely hard bro
its really not that hard though xD
nah youre a senior dev its easy for you
I think its not the best thing if you don't full understand what its doing but xD
I'm a mid at most <,<;;
how many years exp?
just curious
DOM manipulation is a must know though
mixed had 8 years of old web knowledge left for a decade and been relearning modern web for 3 years now?
I been making websites for long time though fo sure
DAMN
literally a Veteran
thats dope
yea I was learning when it was born xD
I think the issue with my code is
I've gone hybrid
I have a SPA root id div, the i have hard-coded html. I have a main js file, then i have some random module files
š
no hybrid would be if you had static/ssr with a client side router
by hybrid i mean, a monstrosity
That is where I think odin project is missleading you
did it even go into http ?
like post/get?
this project however, has been the one that has made me question my life decisions
or its just like we going to show you the JS way...
Uhhhh
like you know how a http request works?
I know post/get yea
what is odin project?
not to derail this too much but here's the specs for this project
https://www.theodinproject.com/lessons/node-path-javascript-todo-list
and this is my absolute nightmare of an attempt
https://github.com/callum-laing/todo-list
should put a NSFW on my github tbh, it's a hard read
I don't know any better but it feels like I'm mixing up like 5 different concepts/ways of building this
piece of this, piece of that, peice of this, throw it all into 1
ohhhh i had no idea about this
its been like a year i started coding, i just learnt from youtube lol
TOP's been good to me in general, but some of it is a little sus
yea its a odd mix
this is the first project where I've actually hit a wall, like a literal wall
usually i get through it after a few days
ive been on this a week and im still very confused
yea ngl I'd have a hard time following this lol
not your code but the lesson
the todo-list?
I read it as "create a project object, and inside that you can create tasks" open a project -> reveals the current tasks
I'm somewhat tempted to just bench it and come back to it later on as I'm grinding my teeth here
didn't even align center and that looks great just saying
<,<;;
24px font with 24px svg ig
oo no you have it on button
xD pulling from flex override
vince has already scolded me for using a button
-.-
I mean it is a button
1 week time on a problem is enough, i think you should look at other peoples solution now and learn from it
a hrefs are for links
buttons are for actions
I would've used a href
but my thought process was
why you never change pages
button for onclick to call a function
you are injecting it all
exactly you are fine
It's what I was talking about with the client side routing though
if this was a mpa I would scold you
He's basically doing that but with buttons instead of links
right but he is not going to manage the history api and all that so
Ye
yea idk š®
next project is weather app š
making things overt for a simple todo
So you agree this is overly complex for a todo right
if this was something I was releasing to the public then I would worry about all that ig.
when I do proejcts to learn its very focused on the thing/concept I want to learn.
So this would be like local storage/dom injection/dom surfing.
honestly it could do with some Classes too but I'm not one to do that either haha
I could've just copied my restaurant app tbh and tweaked some styling
https://callum-laing.github.io/restaurant/ as far as the modules goes anyway
So the other thing would be how to make it with a different approach but again you are following lessons so.
clearly not, it says use webpack, im using vite š
I don't blame you there though
they're using DOM state, my mentor guided me through using a render function
not like they really had you dong that much in webpack either though
enjoy
yea see I see that so much differently
but again I think of HTML first then JS later
event delegation and classes would brrrr for a vanilla todo though
I'm somewhat tempted to restart this entire and just treat what I've built already as a learning experience
because I have no idea how to finish the bloody thing
character development
I have a great video from CMgriffing about unfinished projects
please share
I'm not even mad about ditching this one tbhy
cmgriffing
YouTube
Side Project Hell: Do you have too many unfinished side projects?
In this video, I discuss "Side Project Hell" and how it's not actually that bad when you gain some perspective.
A comic from "CommitStrip" called "West Side Project Story" hits very close to home and might make us feel bad about it. Instead, we can dig deeper and recognize the subtext that I am almost certain they intended but they don't make i...
I think having a few people assist me has made it overcomplicated for me to get on the right track
if that makes sense
yea too many chefs
Yea
and they all have their own styles
yup
xD
so now I look at it like "what in the hell is going on"
that is why you must find "your" style
I'm 10000% sure this could'e been done with half the code I've currently written
in my defence, I have 15 github repos, this is my first unfinished project š
Ahhh ok I get what he's saying.. Yeah I definitely need to work on some DOM specific things, object specific things and some localStorage, as those 3 are weaknesses (and I've never done localStorage)
btw he banned me from his twitch because I said I was learning React and i find it extremely tedious because React is painful compared to Svelte š
Chris is so funny ...
anyway lets close this one, thanks for the helps peeps, I'll consider my options, but I may bench this and come back to it/make a new version once I practise some of the concepts
Like he hates the framework debates so comments like that he gets mad at and claims no bias but he is a React famboi
yeah exactly š
he raged then banned me
š heard it many times