Particle animations with SCSS
This commit is contained in:
parent
36f260a811
commit
0e107e16a2
@ -49,7 +49,6 @@ var / skill info rpc
|
|||||||
* game
|
* game
|
||||||
|
|
||||||
*SERVER*
|
*SERVER*
|
||||||
Base Items - Buff / Debuff / Stun should be equippable / usable skills
|
|
||||||
|
|
||||||
push events
|
push events
|
||||||
|
|
||||||
@ -60,11 +59,6 @@ logging
|
|||||||
* vbox drops chances
|
* vbox drops chances
|
||||||
* 50% spec, 25% colour etc
|
* 50% spec, 25% colour etc
|
||||||
|
|
||||||
* confirm cryp without skill ready
|
|
||||||
* draw big warning !
|
|
||||||
* confirm all (turn timeouts) 10 - 15 seconds
|
|
||||||
|
|
||||||
|
|
||||||
* skills
|
* skills
|
||||||
* private fields for opponents
|
* private fields for opponents
|
||||||
|
|
||||||
|
|||||||
59
client/assets/scss/anims.scss
Normal file
59
client/assets/scss/anims.scss
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
|
||||||
|
.anim-container {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blast-cast {
|
||||||
|
position: absolute;
|
||||||
|
background: black;
|
||||||
|
opacity: .7;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@for $i from 1 through 100 {
|
||||||
|
@keyframes blast-cast-#{$i} {
|
||||||
|
100% {
|
||||||
|
transform: translate3d(-3em +random(200)/200, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@for $i from 1 through 100 {
|
||||||
|
.blast-cast:nth-child(#{$i}){
|
||||||
|
$size: random(30)+px;
|
||||||
|
height: $size;
|
||||||
|
width: $size;
|
||||||
|
transform: translate3d( (random(200) * 1px), (random(200) * 1px), (random(200) * 1px));
|
||||||
|
background: #15f4ee;
|
||||||
|
animation: blast-cast-#{$i} 0.7s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.blast-hit {
|
||||||
|
position: absolute;
|
||||||
|
background: black;
|
||||||
|
opacity: .7;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@for $i from 1 through 100 {
|
||||||
|
@keyframes blast-hit-#{$i} {
|
||||||
|
100% {
|
||||||
|
transform: translate3d((random(200) * 1px), (random(200) * 1px), (random(200) * 1px));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@for $i from 1 through 100 {
|
||||||
|
.blast-hit:nth-child(#{$i}){
|
||||||
|
$size: random(30)+px;
|
||||||
|
height: $size;
|
||||||
|
width: $size;
|
||||||
|
transform: translate3d(-3em +random(200)/200, 0, 0);
|
||||||
|
animation: blast-hit-#{$i} 0.7s infinite;
|
||||||
|
background: #15f4ee;
|
||||||
|
}
|
||||||
|
}
|
||||||
2217
client/assets/styles/anims.css
Normal file
2217
client/assets/styles/anims.css
Normal file
File diff suppressed because it is too large
Load Diff
@ -311,7 +311,6 @@ CRYP DAMAGE
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
COMBAT ANIMATIONS
|
COMBAT ANIMATIONS
|
||||||
*/
|
*/
|
||||||
@ -321,6 +320,7 @@ CRYP DAMAGE
|
|||||||
* w: http://animista.net, t: @cssanimista
|
* w: http://animista.net, t: @cssanimista
|
||||||
* ---------------------------------------------- */
|
* ---------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
.attack-cast {
|
.attack-cast {
|
||||||
-webkit-animation: attack-cast 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
-webkit-animation: attack-cast 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
||||||
animation: attack-cast 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
animation: attack-cast 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ require('./assets/styles/styles.mobile.css');
|
|||||||
require('./assets/styles/instance.css');
|
require('./assets/styles/instance.css');
|
||||||
require('./assets/styles/instance.mobile.css');
|
require('./assets/styles/instance.mobile.css');
|
||||||
require('./assets/styles/game.css');
|
require('./assets/styles/game.css');
|
||||||
|
require('./assets/styles/anims.css');
|
||||||
|
|
||||||
// kick it off
|
// kick it off
|
||||||
require('./src/app');
|
require('./src/app');
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "parcel index.html --host 0.0.0.0 --port 40080 --no-source-maps",
|
"start": "parcel index.html --host 0.0.0.0 --port 40080 --no-source-maps",
|
||||||
"build": "rm -rf dist && parcel build index.html && cp -r assets/molecules/ dist/",
|
"build": "rm -rf dist && parcel build index.html && cp -r assets/molecules/ dist/",
|
||||||
|
"scss": "node-sass --watch assets/scss -o assets/styles",
|
||||||
"lint": "eslint --fix --ext .jsx src/",
|
"lint": "eslint --fix --ext .jsx src/",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
@ -23,6 +24,7 @@
|
|||||||
"key": "^0.1.11",
|
"key": "^0.1.11",
|
||||||
"keymaster": "^1.6.2",
|
"keymaster": "^1.6.2",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
|
"node-sass": "^4.12.0",
|
||||||
"parcel": "^1.12.3",
|
"parcel": "^1.12.3",
|
||||||
"particles.js": "^2.0.0",
|
"particles.js": "^2.0.0",
|
||||||
"phaser": "^3.15.1",
|
"phaser": "^3.15.1",
|
||||||
|
|||||||
11
client/src/animations.jsx
Normal file
11
client/src/animations.jsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
const preact = require('preact');
|
||||||
|
|
||||||
|
function animationDivs(classes) {
|
||||||
|
switch (classes) {
|
||||||
|
case 'blast-cast': return Array.from({ length: 100 }).map(j => <div key={j} className="blast-cast"></div>);
|
||||||
|
case 'blast-hit': return Array.from({ length: 100 }).map(j => <div key={j} className="blast-hit"></div>);
|
||||||
|
default: return <div> </div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { animationDivs };
|
||||||
@ -1,5 +1,6 @@
|
|||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils');
|
const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils');
|
||||||
|
const { animationDivs } = require('../animations');
|
||||||
const GameCryp = require('./game.cryp');
|
const GameCryp = require('./game.cryp');
|
||||||
|
|
||||||
function GamePanel(props) {
|
function GamePanel(props) {
|
||||||
@ -142,6 +143,12 @@ function GamePanel(props) {
|
|||||||
.filter(s => playerTeamIds.includes(s.source_cryp_id) && s.target_cryp_id === cryp.id)
|
.filter(s => playerTeamIds.includes(s.source_cryp_id) && s.target_cryp_id === cryp.id)
|
||||||
.map((s, i) => <h3 key={i}>{`< ${s.skill}`}</h3>);
|
.map((s, i) => <h3 key={i}>{`< ${s.skill}`}</h3>);
|
||||||
|
|
||||||
|
const anim = (
|
||||||
|
<div className="anim-container">
|
||||||
|
{animationDivs(combatClass)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={i}
|
key={i}
|
||||||
@ -157,6 +164,7 @@ function GamePanel(props) {
|
|||||||
onClick={() => selectSkillTarget(cryp.id)} >
|
onClick={() => selectSkillTarget(cryp.id)} >
|
||||||
{crypAvatar(cryp.name)}
|
{crypAvatar(cryp.name)}
|
||||||
{combatTextEl}
|
{combatTextEl}
|
||||||
|
{anim}
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ const range = require('lodash/range');
|
|||||||
|
|
||||||
const actions = require('../actions');
|
const actions = require('../actions');
|
||||||
const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils');
|
const { STATS, eventClasses, getCombatText, crypAvatar } = require('../utils');
|
||||||
|
const { animationDivs } = require('../animations');
|
||||||
|
|
||||||
const SkillBtn = require('./skill.btn');
|
const SkillBtn = require('./skill.btn');
|
||||||
|
|
||||||
@ -83,6 +84,12 @@ function GameCryp(props) {
|
|||||||
.filter(s => playerTeamIds.includes(s.source_cryp_id) && s.target_cryp_id === cryp.id)
|
.filter(s => playerTeamIds.includes(s.source_cryp_id) && s.target_cryp_id === cryp.id)
|
||||||
.map((s, i) => <h3 key={i}>{`< ${s.skill}`}</h3>);
|
.map((s, i) => <h3 key={i}>{`< ${s.skill}`}</h3>);
|
||||||
|
|
||||||
|
const anim = (
|
||||||
|
<div className="anim-container">
|
||||||
|
{animationDivs(combatClass)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={ activeSkill ? { cursor: 'pointer' } : {}}
|
style={ activeSkill ? { cursor: 'pointer' } : {}}
|
||||||
@ -101,6 +108,7 @@ function GameCryp(props) {
|
|||||||
onClick={() => selectSkillTarget(cryp.id)} >
|
onClick={() => selectSkillTarget(cryp.id)} >
|
||||||
{crypAvatar(cryp.name)}
|
{crypAvatar(cryp.name)}
|
||||||
{combatTextEl}
|
{combatTextEl}
|
||||||
|
{anim}
|
||||||
</figure>
|
</figure>
|
||||||
<div className="effects">
|
<div className="effects">
|
||||||
{effects}
|
{effects}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
TIMES: {
|
TIMES: {
|
||||||
RESOLUTION_TIME_MS: 1000,
|
RESOLUTION_TIME_MS: 1000,
|
||||||
START_SKILL: 500,
|
START_SKILL: 700,
|
||||||
END_SKILL: 500,
|
END_SKILL: 700,
|
||||||
POST_SKILL: 500,
|
POST_SKILL: 1000,
|
||||||
},
|
},
|
||||||
|
|
||||||
INFO: {
|
INFO: {
|
||||||
|
|||||||
@ -399,17 +399,17 @@ impl Item {
|
|||||||
self.into_skill().unwrap().duration()),
|
self.into_skill().unwrap().duration()),
|
||||||
|
|
||||||
Item::Strike => format!(
|
Item::Strike => format!(
|
||||||
"Hits at maximum speeding dealing red damage {:?}% red power",
|
"Hits at maximum speed dealing red damage {:?}% red power",
|
||||||
self.into_skill().unwrap().multiplier()),
|
self.into_skill().unwrap().multiplier()),
|
||||||
Item::StrikeII => format!(
|
Item::StrikeII => format!(
|
||||||
"Hits at maximum speeding dealing red damage {:?}% red power",
|
"Hits at maximum speed dealing red damage {:?}% red power",
|
||||||
self.into_skill().unwrap().multiplier()),
|
self.into_skill().unwrap().multiplier()),
|
||||||
Item::StrikeIII => format!(
|
Item::StrikeIII => format!(
|
||||||
"Hits at maximum speeding dealing red damage {:?}% red power",
|
"Hits at maximum speed dealing red damage {:?}% red power",
|
||||||
self.into_skill().unwrap().multiplier()),
|
self.into_skill().unwrap().multiplier()),
|
||||||
|
|
||||||
Item::Siphon => format!(
|
Item::Siphon => format!(
|
||||||
"Deals blue damage {:?}% blue power each turn and heals caster based on damage dealt . Lasts {:?}T",
|
"Deals blue damage {:?}% blue power each turn and heals caster based on damage dealt. Lasts {:?}T",
|
||||||
self.into_skill().unwrap().multiplier(),
|
self.into_skill().unwrap().multiplier(),
|
||||||
self.into_skill().unwrap().duration()),
|
self.into_skill().unwrap().duration()),
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user