Glam Up My Markup: Camp Activities - The Frontend Challenge Submission
CodingWithRand
Posted on March 31, 2024
This is a submission for DEV Challenge v24.03.20, Glam Up My Markup: Camp Activities
What I Built
I created a creative form submission for a camp activities inquiry. It can enhance user experience while filling in the form with interactive elements, cool animations, and effects. In this form, you can...
Select your preferred camp activity with the portrait of the image of your selected camp activity showing on the side.
Provide additional information such as food allergies to the counselor.
Enjoy the vibe on the webpage. (The camping background image integrates with moving clouds in the background and mysterious bushes at the bottom of the page that can shrink and grow when clicked on it)
To enhance the user experience to the maximum, I made the website responsive. Hence, mobile users can fill in the form conveniently without getting annoyed by the ugly UI interface.
Demo
Camp Activities Selection Section
Textareas Section
Mobile View
Note: Please click on the bushes at the bottom of the page to reveal the Submit button, in case you don't see it
You can access the website that I hosted on GitHub here
And here is the source code
A project to join the DEV.to - Glam Up My Markup 💅 Contest
Interested? You can also join here
MIT License
Copyright (c) 2024 Thanwisit Angsachon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT…
I had seen the challenge post since the start of the contest date. It took me such a long time to finally come up with this idea. In the first place, I got a rough idea about putting a camping-related image as a background, and probably binding the form elements to other images to make it interesting and interactive. But the real progress was made 4-5 days before the challenge due date.
So, I was searching for nice images for the page. The vector graphic images looked good in my point of view because they look simple and clean, which may make the user feel comfortable filling in the form.
And with the reason of simplicity and convenience, I also chose the font that suits the reason.
But I needed creativity and interactivity too, and that requires a lot more elements to be pre-rendered on the page that I might even have to change the HTML structure.
From this
<sectionid="camp-activities-inquiry"><h1>Camp Activities Inquiry</h1><formaction="/submit-form"method="POST"><labelfor="activity-select">Which camp activities are you most looking forward to?</label><selectid="activity-select"name="activity"><optionvalue="">--Please choose an option--</option><optionvalue="hiking">Hiking</option><optionvalue="canoeing">Canoeing</option><optionvalue="fishing">Fishing</option><optionvalue="crafts">Crafts</option><optionvalue="archery">Archery</option></select><labelfor="food-allergies">Food Allergies (if any)</label><textareaid="food-allergies"name="food_allergies"rows="4"cols="50"></textarea><labelfor="additional-info">Additional things the counselor should know</label><textareaid="additional-info"name="additional_info"rows="4"cols="50"></textarea><buttontype="submit">Submit</button></form></section>
However, according to the rules, you shouldn't directly apply the change to the given HTML code. So, that is IMPOSSIBLE!!
Or is it?*VSauce theme played*
Well, there is a way, and it is to use the JavaScript which is allowed to append the element node to the DOM. That is one of the new things I have learned from participating in this contest. I didn't know that you could do this like inserting JSX in React (Of course you can because React is also a javascript library) The fundamentals of DOM I only had were selecting elements, styling or adding classes to them, and some event listeners of the elements. Creating DOM nodes or elements is a new thing for me. Now, I know how to create new elements and append them to the DOM in the right order.
Besides that, working on this project is like reviewing my knowledge of vanilla JavaScript and DOM Manipulation, because the interactivity of the page mainly relies on JavaScript. We also have to mention CSS too, since it brings creativity to the page and makes the page neat and responsive. In conclusion, I have learned new methods to add DOM elements in JavaScript and strengthened my knowledge of JavaScript and CSS to write the perfect code that works well.
As submitting the project a few hours before the deadline, I can guarantee that this project has enough quality to contend with other participants. I have checked thoroughly into the code and conducted many tests on the project to ensure it works perfectly fine.
(To be honest, I would like to add sound to the webpage and make the form submission confirmation system too, but due to the lack of time. I scrapped that idea)
Thank you for reading my post to the end, I really appreciate it!