https://github.com/medsagou/coin-flip
Coin flip application
https://github.com/medsagou/coin-flip
Last synced: 4 months ago
JSON representation
Coin flip application
- Host: GitHub
- URL: https://github.com/medsagou/coin-flip
- Owner: medsagou
- Created: 2023-04-04T16:45:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T23:36:13.000Z (about 2 years ago)
- Last Synced: 2025-01-03T19:26:53.922Z (6 months ago)
- Language: CSS
- Size: 558 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coin Flip by Mohamed Sagou
### Built with
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- [React](https://reactjs.org/) - JS library
- [Next.js](https://nextjs.org/) - React framework
- [Styled Components](https://styled-components.com/) - For styles
- [Modern css reset](https://piccalil.li/blog/a-modern-css-reset/) - piccalil### What I learned
Use this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.
```html
Interactive rating component main
![]()
Flip the coin
By Mohamed Sagou,
Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering! For more information, Visit my Git repo
![]()
![]()
Heads: 0
Tails: 0
```
```css
.numbers[state="active"] {
cursor: pointer;
background-color: var(--neutral-300);
color: var(--neutral-100);
}@media (hover: hover) {
.button-container > button:hover {
background-color: var(--neutral-100);
cursor: pointer;
color: var(--primary-orng);
}
.numbers:hover {
cursor: pointer;
background-color: var(--primary-orng);
color: var(--neutral-100);
}
}
``````js
function updateStats() {
document.querySelector("#heads-count").textContent = `Heads: ${heads}`;
document.querySelector("#tails-count").textContent = `Tails: ${tails}`;
}
function disableButton() {
flipBtn.disabled = true;
setTimeout(function () {
flipBtn.disabled = false;
}, 3000);
}
resetBtn.addEventListener("click", () => {
coin.style.animation = "none";
heads = 0;
tails = 0;
updateStats();
});
```### Continued development
My first project with menu, Im so glad for finishing this work. Specialy the mobile version with the side menu on the right.
### Useful resources
- [W3schools](https://www.w3schools.com/) - This helped me for javaScript eventListener. I really liked this pattern and will use it going forward.
- [stackoverflow](https://stackoverflow.com/) - this website help me on the javascript when i get stock.## Author
- Website - [Mohamed Sagou](https://github.com/medsagou)
- Frontend Mentor - [@medsagou](https://www.frontendmentor.io/profile/medsagou)
- Twitter - [@sagoumohamed](https://www.twitter.com/sagoumohamed)## Acknowledgments
nothing for this project.