Muhammad Osama Aqleem orakzai Abdul Musavir S Tatheer Hussain® ABDULLAH . The Pig Game (Pure JS Edition) Thrilled to share my latest web development project! 🚀 What started as a simple dice game turned into a deep dive into DOM manipulation and Responsive Design. The "Switching" Headache The hardest part? Managing the Player Switching Logic. 🤯 I struggled with keeping the state consistent—resetting the current score, toggling the active player's background, and ensuring the logic didn't break when a player rolled a '1'. After several refactors, I mastered using State Variables and Class Toggling to create a seamless transition between players. It was a "Eureka" moment in my JavaScript journey! 📱 Truly Responsive (Side-by-Side Layout) Most mobile games stack elements vertically, but I wanted to keep the Desktop Aesthetic even on small screens. Implemented custom Media Queries to scale the entire UI. Used Fixed Pixel Units for the "Current Score" boxes to prevent text overflow on mobile. Ensured Touch Targets (buttons) are perfectly sized for mobile users. 🛠️ Key Features: Dynamic UI: Backgrounds and text colors change based on the active player and game state. Winning Logic: A dedicated "Winner State" where the winner's name highlights in white for a premium feel. Performance: Lightweight, fast, and built with zero external libraries—just HTML5, CSS3, and Vanilla JavaScript. Check out the live game here: https://lnkd.in/dcKWPjTh #WebDevelopment #JavaScript #CodingJourney #FrontendDeveloper #ResponsiveDesign #ProgrammingLife ab yeh check kar
More Relevant Posts
-
𝐌𝐞𝐝𝐢𝐚 𝐐𝐮𝐞𝐫𝐢𝐞𝐬 𝐚𝐧𝐝 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐢𝐯𝐞 𝐖𝐞𝐛 𝐃𝐞𝐬𝐢𝐠𝐧 📱💻 I'm working on a website for a client that needs to look great across all screen sizes—from small phones to large tablets and everything in between. 📲 I had set up media queries a few months ago, but they weren't properly adjusting text and images on the landing page for different devices. 😅 To fix this, I needed a way to test my CSS changes in real-time as I resized the browser window. After some research, I found a simple React solution: a useEffect hook that displays the current viewport dimensions on screen. 🎯 This live dimension display made debugging media queries much faster. Instead of guessing breakpoints, I could see exactly when layouts broke and adjust accordingly. ✨ Sometimes the simplest tools make the biggest difference in development workflow! 🚀 Below you can see the video of my screen showing live changes to the dimensions. The code is in the comments. #WebDevelopment #ReactJS #ResponsiveDesign #FrontendDevelopment #CSS #WebDesign #Coding #DeveloperLife #JavaScript #NextJS #MediaQueries #TechTips
To view or add a comment, sign in
-
🎮 Mini Project Highlight: Tic Tac Toe Game (Web Development) As part of my web development learning journey, I built a Tic Tac Toe game using HTML, CSS, and JavaScript—and this time, I made sure to handle every game outcome, including a draw condition. This project helped me move beyond theory and really understand how interactive web apps work under the hood. 🚀 What I implemented and learned: 1)Dynamic DOM manipulation to update the game board and messages in real time 2)Event handling to manage player moves and turn switching (X ↔ O) 3)Game logic to detect: Winning combinations Draw scenarios when all cells are filled with no winner 4)Used arrays and loops for efficient board tracking and cleaner logic 5)Added a reset / play again button to restart the game instantly without refreshing 6)Styled the layout using CSS Flexbox for a clean, responsive UI 🎯 Game Features: - Two-player mode (X vs O) - Real-time win and draw detection - Turn-based gameplay - Simple, user-friendly interface - Restart option for continuous play It may be a small game, but it was a big step in strengthening my JavaScript fundamentals and problem-solving skills. Every mini project like this makes me more confident to take on bigger challenges. Always excited to keep learning, building, and sharing my progress. If you’ve built something similar or have suggestions for what I should try next, I’d love to connect! #MiniProject #WebDevelopment #JavaScript #HTML #CSS #FrontendDevelopment #LinkedInProjects
To view or add a comment, sign in
-
I’ve been working on my frontend skills, and now I have a place to showcase them. My portfolio includes: Interactive contact form powered by EmailJS Responsive layout for all devices Smooth animations and modern design Check it out here: https://lnkd.in/dh6QJbHG This project was a great way to practice HTML, CSS, and JavaScript, and I’m excited to keep improving and building more interactive projects. #Frontend #Portfolio #JavaScript #WebDevelopment #Coding
To view or add a comment, sign in
-
🎬🎥 Movie Explorer | Frontend Project Demo 🍿💻 Sharing a demo video of my Movie Explorer Web Application, developed using HTML, CSS, JavaScript, and React, which allows users to explore and browse movies through a clean and interactive interface. 🔗 Live Project: 👉 https://lnkd.in/gWYXRDMa ✨ Highlights: ✔ Built with React for dynamic UI ✔ Smooth and interactive user experience ⚡ ✔ Responsive design across devices 📱💻 #MovieExplorer 🎬 #ReactJS ⚛️ #FrontendDevelopment 💻 #HTML #CSS #JavaScript 🚀
To view or add a comment, sign in
-
👉 Understanding Rendering, Reflow, and Repaint in React Applications Performance issues in React are often rooted in how browsers render UI — not in React itself. 👉 Rendering The browser builds the UI from HTML, CSS, and JavaScript. In React: State change → Component re-render → DOM update Excessive renders increase processing time. 👉 Reflow (Layout) — High Cost The browser recalculates element size and position. Triggered by changes in: width, height, margin, padding, display, font-size Reflows can affect large parts of the page and are expensive. 👉 Repaint — Lower Cost The browser redraws pixels without changing layout. Triggered by: color, background, shadow, visibility Faster than reflow, but still impacts performance 👉 Key Principle Reduce re-renders. Limit reflows. Optimize repaints. This is the foundation of scalable frontend performance. #React #JavaScript #WebPerformance #FrontendDevelopment
To view or add a comment, sign in
-
🚀 Leveling up my Frontend Game! 🕹️ I spent my day building a Neon-Themed Tic-Tac-Toe from scratch! 💻 It’s not just a game; it was a deep dive into DOM manipulation and win-logic. What I learned: State Management: Handling "X" vs "O" turns without bugs. Win Logic: Implementing the 8 winning combinations (rows, columns, diagonals). UI/UX: Using CSS pseudo-elements (::before/::after) to create those glowing neon symbols. The "Aha!" moment: Getting the draw logic to trigger perfectly only when all cells are filled and no winner is found. Check out the clean layout! It’s all built with HTML5, CSS Grid, and Vanilla JavaScript. What was your first JS project? Let's chat in the comments! 👇 #WebDevelopment #JavaScript #CodingJourney #Frontend #BuildingInPublic
To view or add a comment, sign in
-
A interviewer asked me the Difference between useEffect and useLayoutEffect in React ? Both useEffect and useLayoutEffect are React Hooks used to handle side effects, but the main difference is when they run in the rendering cycle. useEffect : Runs after the browser paints the UI Does not block rendering Best choice for most side effects ✅ Common use cases: API calls Event listeners Subscriptions Timers useLayoutEffect Runs after DOM updates but before the browser paints Blocks the paint until it finishes Useful when you need to measure or modify the DOM ✅ Common use cases: Reading element size or position Preventing layout shift or flicker Synchronous DOM updates Rendering flow Render → DOM Updates → useLayoutEffect → Paint → useEffect Which one should you use? 👉 Use useEffect by default 👉 Use useLayoutEffect only when you must interact with the DOM before paint 💡 Simple way to remember: useEffect → after screen is visible useLayoutEffect → before screen is visible #ReactJS #useEffect #useLayoutEffect #ReactHooks #FrontendDevelopment #WebDevelopment #JavaScript
To view or add a comment, sign in
-
🚀 Excited to announce the release of dynamic-card v2.0! Building modern, animated UI cards shouldn’t mean reinventing the wheel for every project. That’s why I built dynamic-card—a zero-dependency, high-performance web component designed to work anywhere. Whether you are using React, Vue, Angular, Svelte, or just plain HTML, this package gives you fully customizable, production-ready cards in seconds. Why use dynamic-card? 🔹 Ultra-Lightweight: Under 3KB gzipped—zero bloat for your application. 🔹 Framework Agnostic: Built with Web Components for universal compatibility. 🔹 Rich Feature Set: 13 built-in themes (Glassmorphism, Gradients, Dark/Light modes). 🔹 Interactive UI: Smooth entrance animations (fade, slide, bounce) and hover effects (glow, lift, shake). 🔹 Fully Scalable: Complete control over colors, images, and event support. I created this to streamline my own workflow, and I’m excited to share it with the developer community. Check it out, drop a star, or contribute! 📦 Install it now: npm install @farhanbshafiq/dynamic-card 🔗 Useful Links: npm: https://lnkd.in/g5Rb9sXc GitHub: https://lnkd.in/g3G6P9mc Let's build faster, together. 🙌 #OpenSource #WebDev #JavaScript #Frontend #WebComponents #npm #React #Vue #Angular #Svelte #UIUX #Programming
To view or add a comment, sign in
-
-
𝗘𝘃𝗲𝗿 𝗻𝗼𝘁𝗶𝗰𝗲𝗱 𝘆𝗼𝘂𝗿 𝗯𝗲𝗮𝘂𝘁𝗶𝗳𝘂𝗹 𝗳𝗼𝗿𝗺 𝗶𝗻𝗽𝘂𝘁𝘀 𝗴𝗲𝘁 𝗿𝘂𝗶𝗻𝗲𝗱 𝗯𝘆 𝗯𝗿𝗼𝘄𝘀𝗲𝗿 𝗮𝘂𝘁𝗼𝗳𝗶𝗹𝗹? 🎨 That annoying yellow/white background that appears when Chrome (or other browsers) fills your login forms?.... especially in dark/light theme UIs This happens because browsers apply default autofill styles once they fill a field, and those styles often use internal !𝗶𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 values that are hard to override with normal CSS. There’s a 𝗖𝗦𝗦 𝗽𝘀𝗲𝘂𝗱𝗼-𝗰𝗹𝗮𝘀𝘀 you can use called :autofill (and its legacy alias :-𝘄𝗲𝗯𝗸𝗶𝘁-𝗮𝘂𝘁𝗼𝗳𝗶𝗹𝗹) which matches inputs that have been autofilled by the browser. You can then apply your own styles for background, text color, etc. without breaking your design. Reference: https://lnkd.in/g9-77ZJ2 𝗬𝗼𝘂 𝗱𝗼𝗻’𝘁 𝗵𝗮𝘃𝗲 𝘁𝗼 𝗱𝗶𝘀𝗮𝗯𝗹𝗲 𝗮𝘂𝘁𝗼𝗳𝗶𝗹𝗹 — 𝗶𝘁’𝘀 𝗮 𝘂𝘀𝗲𝗳𝘂𝗹 𝗨𝗫 𝗳𝗲𝗮𝘁𝘂𝗿𝗲 — 𝗯𝘂𝘁 𝘆𝗼𝘂 𝗰𝗮𝗻 𝗺𝗮𝗸𝗲 𝗶𝘁 𝗳𝗶𝘁 𝘆𝗼𝘂𝗿 𝘁𝗵𝗲𝗺𝗲. Here’s a visual comparison 👇 #FrontendDevelopment #WebDevelopment #CSS #ReactJS #UIUX #WebDesign #JavaScript #FrontendTips #UIDesign #DesignSystems #Chrome #BrowserTips #Autofill #DeveloperLife #CodingTips #SoftwareEngineering #BuildInPublic #LinkedInTech
To view or add a comment, sign in
-
(Task 4) Project: To-do List Tasks are saved locally using browser storage, completion status is updated dynamically, and smart suggestions help users add tasks quickly. The app is fully responsive with smooth UI interactions. 🛠️ Languages Used HTML5 – App structure CSS3 – Styling, animations, and layout JavaScript – Task logic, localStorage handling, and interactivity
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Zabardast