Latest solutions
Responseive countries webapp using API with theme switcher (ReactJS)
#reactSubmitted over 2 years ago
Latest comments
- @dripping-codeSubmitted over 2 years ago@king-oldmatePosted over 2 years ago
There are a couple of ways to center align content. What would probably be best in this situation is to use flexbox {display: flex; justify-content: center; align-items: center}. I really recommend you search and practice how to achieve this, and perhaps even resubmit this challenge.
@media queries are generally how one would create a responsive page, but that's not really applicable on this challenge.
Marked as helpful0 - @AfriannsSubmitted over 2 years ago@king-oldmatePosted over 2 years ago
There are ways of doing it, and event delegation would probably be the most efficient method, but since there aren't that many dropdown menus, all you need to do is code it so that no matter what menu item you click, it will:
- hide every other menu
- reveal the menu that was clicked.
Hope that made sense! (Just experiment with it!)
0 - @johannesteshomeSubmitted over 2 years ago@king-oldmatePosted over 2 years ago
I did this same challenge with TailwindCSS, you can see my source code here: https://github.com/king-oldmate/FEM-advice-generator-app/blob/master/src/App.js
Anyway, I used the following class with arbitrary values for the shadow/glow effect: hover:shadow-[0_0_22px_8px_rgba(82,255,168,0.5)]
here's the documentation for it: https://tailwindcss.com/docs/box-shadow
Marked as helpful1 - @wmartyrSubmitted over 2 years ago@king-oldmatePosted over 2 years ago
Well done. Looking at your code, we pretty much did the same thing. To load to a separate HTML file wouldn't even work, since the JavaScript would reload and you would lose your variable. No, part of the point of these easier exercises is to develop components, and those should be as contained (encapsulated) as possible.
Marked as helpful0 - @darthskyySubmitted almost 3 years ago@king-oldmatePosted almost 3 years ago
Good work.
I personally use Tailwind CSS for styling, but you could even use just plain old CSS if you wanted to try making the card yourself. Just break done the card into all it's different parts.
I prefer using Flexbox for alignment if I have multiple elements or need to center vertically, but if it's just one I will very often use margin: 0 auto;
0 - @z3sbSubmitted almost 3 years ago@king-oldmatePosted almost 3 years ago
Well done, the layouts look great for both desktop and mobile.
I'm not sure if you noticed that you have some bugs in your JavaScript. Firstly, the active colour doesn't change when you choose a different time-frame (i.e. weekly always stays highlighted no matter what is active), and secondly, if you click anywhere in the options div it shows no data anywhere in your dashboard. You ought to have event listeners for each time-frame.
Keep it up!
Marked as helpful0