Skip to content

Mathbkj/flip-the-coin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flip the coin | devChallenges

Solution for a challenge Flip The Coin from devChallenges.io.

Table of Contents

Overview

This is an interactive Flip the Coin game built with vanilla HTML, CSS, and JavaScript. Click the button or the coin to flip it and get a random result (Heads or Tails). The application features smooth animations, responsive design, and a modern UI with semantic color palettes.

What I learned

  • CSS Animations & Easing Functions: Used cubic-bezier with overshoot effects to create bouncy, elastic spinning animations
  • Semantic Color Palettes: Implemented 16 CSS custom properties organized by function (primary accent, background, text, shadows) for better maintainability
  • Responsive Design: Used CSS clamp() function for fluid scaling across mobile, tablet, and desktop viewports
  • Event Management: Handled button interactions with proper state management and animation timing
  • DOM Manipulation: Dynamically updated coin images and results while animations were in progress
  • Web Audio API: Generated procedural sound effects for coin flip interactions (optional enhancement)

Useful resources

Built with

  • HTML5 - Semantic markup structure
  • CSS3 - Custom properties (variables), animations, flexbox, responsive design with clamp()
  • JavaScript - Event handling, DOM manipulation, animation control
  • Raleway Font - Google Fonts for modern typography
  • Semantic Color System - 16 CSS variables for maintainable color management

Features

  • Smooth Coin Animation - Elastic spinning effect with cubic-bezier easing
  • 🎲 Random Result Generator - 50/50 chance between Heads and Tails
  • 📱 Fully Responsive - Works seamlessly on mobile (412px), tablet (1024px), and desktop (1350px+)
  • 🎨 Semantic Color Palette - 16 CSS custom properties for consistency and maintainability
  • Interactive Button - 3D effect with shadow on hover and click states
  • 🖼️ Dynamic Image Updates - Coin face changes based on flip result
  • Accessible Design - Proper contrast ratios and semantic HTML
  • 🎵 Optional Sound Effects - Web Audio API for procedural coin flip sounds

Acknowledgements

Author

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors