Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

All comments

  • roodhouse 520

    @roodhouse

    Submitted

    The first useful thing I learned was the ability to place a background image and background color on the same element. Previously I had been creating extra divs, moving them around and adjusting opacity. But the below code works just fine:

    <div id='wrapper' className='h-full bg-[url("./images/bg-intro-mobile.png")] bg-orange pt-[88px] px-6 pb-[68px] xl:px-0 xl:py-[121px] xl:flex xl:flex-col xl:flex-wrap xl:items-center'>
    

    I spent a lot of time trying to better understand React Hook Form during this project. I ran up against the default browser vaildation widget again. Previously I could work around it but with so many fields in this project the work around was not the best route. Finally I gave up and googled "chrome validation widget prevents react hook form from working on email fields". That search term was a winner and brought me to this page with the solution. It is very simple and I am happy to be done with this issue forever. Here is a SS of the error from the browser:

    Here is the simple code that fixes it and allows the code from React Hook Form to do its job:

    <form noValidate onSubmit={handleSubmit(onSubmit, onError)}>
    

    The last thing I learned was how to change the text color dynamically. Set the original text color and change the text color when an error it triggered. Simple enough. But how to change the text color back to the original color when the user begins to change the input? Listener waiting for the input event was the key here:

    function onError(e) {  
    // When an error occurs then for each error find the warning div for that field and display it
    for (const error in e) {
    let errorText = document.getElementById(error);
    console.log(errorText.value)
    errorText.style.color = '#FF7979'
    let errorElement = document.getElementById(error).parentElement.nextSibling
    errorElement.style.display = 'block'
    // Listen for when the user begins to fix the input and change the color of the text back to black
    errorText.addEventListener('input', function(){
    console.log('change')
    errorText.style.color ='#3D3B48'
    })
    }
    }
    
    roodhouse 520

    @roodhouse

    Posted

    Not sure what viewport that the generated screenshot is coming from. The site looks fine when I visit it myself. Both on vercel and my own personal site. I had ditch github pages for this project as it would not deploy. Not sure if the two issues are connected or not.

    I found it. I have height set to 100vh and when the viewport is in landscape then it creates the same images as the screenshot. I am going to let this one go for now.

    0
  • roodhouse 520

    @roodhouse

    Posted

    Killing it. Well done.

    1
  • roodhouse 520

    @roodhouse

    Posted

    Hey. Great job! You have the spacing and padding/margins down really well. IMO you should utilize more container divs to help with the styling. For instance if you were to drop a <div> <div> <h1> then you would be able to manipulate the 2 higher up divs before you touched the h1. This would allow you to then see what styling is left to implement on h1. You might find one or two things or nothing is needed at all. Personally, I attempt to place the bulk of my styling on divs and if needed, then I style the data directly. Anyway, great start and keep it going!

    0
  • @Gamalielaradeya

    Submitted

    im using tailwind in all my project because I want to learn tailwind and its help me learning CSS and HTML faster than a normal programming, i want to share all my project for you guys

    on this project i use CDN TailwindCss because i think its still simple

    roodhouse 520

    @roodhouse

    Posted

    Tailwind has been great for me. I want to expand to other things but Tailwind is so efficient.

    0