FEATURES:
- Standalone: no need any other source
- Only one file: so load only one JS file
- Single player mode: No server required
- Multi player mode (on progress)
I used:
- JavaScript
- webpack and some loaders: to pack to one file
- Wallpaper Access: used for background image
- UNO card deck images as svg and UNO card back image as svg
DEMO is available on the GitHub page. DEMO on GitHub page
The code is available on GitHub.
<script src='https://raw.githubusercontent.com/newini/uno-game-js/master/uno_game.js'></script>
Download from GitHub,
wget https://raw.githubusercontent.com/newini/uno-game-js/master/uno_game.js
and add load uno game js from HTML.
<script src='uno_game.js'></script>
TBA
Put this one line in the HTML body.
<div id='uno-game'></div>
This repo is compiled with webpack
. So, first install webpack by
npm install webpack webpack-cli style-loader css-loader file-loader sass sass-loader --save-dev
webpack
,webpack-cli
: webpackstyle-loader
: Createsstyle
nodes from JS stringscss-loader
: Translates CSS into CommonJSfile-loader
: copy image files to distsass
,sass-loader
: Compiles Sass to CSS--save-dev
: write dependencies indevDependencies
instead ofdependencies
inpackage.json
Edit webpack.config.js
to use webpack loaders
npx webpack
or
npm run build
This command will generate dist/main.js
- multiplay