Awesome
<h1 align="center">VueSolitaire</h1> <h2 align="center"> </h2> <p align="center"> <img src="https://img.shields.io/npm/dy/silentlad"> <img src="https://img.shields.io/badge/made%20by-silentlad-blue.svg" > <img src="https://img.shields.io/badge/vue-2.2.4-green.svg"> <img src="https://badges.frapsoft.com/os/v1/open-source.svg?v=103" > <img src="https://beerpay.io/silent-lad/VueSolitaire/badge.svg?style=flat"> <img src="https://img.shields.io/github/stars/silent-lad/VueSolitaire.svg?style=flat"> <img src="https://img.shields.io/github/languages/top/silent-lad/VueSolitaire.svg"> <img src="https://img.shields.io/github/issues/silent-lad/VueSolitaire.svg"> <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat"> </p> <img src="./readme_assets/h2.png" width="100%"> <h2 align="center"><a href="https://solitairevue.firebaseapp.com">Live Demo</a></h2>Contributions are Welcome
Description
NOW WITH DRAG AND DROP
<p align="center"> <img src="https://media.giphy.com/media/7OWdOQupgCClrZb19P/giphy.gif" width="80%"></p>Solitaire implemented by scratch on vue.js. It contains 3 types of solitaire namely spider(which was made famous by microsoft back when I was a kid) ,spider 4 suit and klondike. I've learned web development myself without any course or coaching so don't expect too much from the source code xD.
This project is inspired by AadumKhor Go check out his flutter implementation of the same Here .
How to play
Drag and Drop [Chrome,Opera]:-
- Drag the card or the card pile you want to move.
- Drop the dragged card pile on the target and if the move is legal card will move
- Note:- Drag and Drop doesn't work for properly for firefox due to their lack of support to html Drag and drop API - https://bugzilla.mozilla.org/show_bug.cgi?id=505521 .
Click edition [Mobile,Firefox,Chrome,Safari,Opera]-
- Click on the card or card pile you want to move .The pile turns to blue.
- Click on the destination card and if the move is legal the cards will stack below the target.
About the project.
Drag and Drop
- Drag and drop is implemented with native html5 drag and drop api with @drag, @dragend, @dragenter eventlisteners on the Card.vue component.
- Libraries like Vue.draggable were not used as i had to write most of the drag and drop logic according to the solitaire game type and I also had to MOVE the stack of cards.
- Ghost image in drag is removed instead the whole stack of card moves with cursor change.
CSS
-
Each and every card is 100% css except the SVG of the suit in the center of the card,which is made by illustrator tool.
<p align="center"><img src="./readme_assets/4.png" width="30%"></p>
3 mode menu
Choose from 3 variants of solitaire form the main menu
<p align="center"><img src="./readme_assets/menu.png" width="70%"></p>Variants
Klondike
<p align="center"> <img src="./readme_assets/3.png" width="80%"> </p> <!-- <img src="./readme_assets/3.png" width="50%"> -->Spider 4 Suit
<p align="center"> <img src="./readme_assets/5.png" width="80%"> </p>Spider 1 Suit
<p align="center"> <img src="./readme_assets/1.png" width="80%"> </p>Project setup
npm install
npm run serve
Future scope
- Add winning animation.
Support on Beerpay
Hey dude! Help me out for a couple of :beers:!