Skip to content

Commit

Permalink
fix a vw/vh bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofuyesnew committed Dec 5, 2018
1 parent 42bd0ce commit b2f0abe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/js/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ const app = new Vue({
case '3':
unit = 'vw'
wUnit = +this.frameData.prewidth / +data.design
wUnit = +this.frameData.preheight / +data.design
hUnit = +this.frameData.preheight / +data.design
break
}
let step = (100 / this.fileList.length).toFixed(2)
let animClass = `.${data.name} {\n width: ${wUnit}${unit};\n height: ${hUnit}${unit};\n background-size: ${`${(col * wUnit).toFixed(2)}${unit} ${(row * hUnit).toFixed(2)}${unit}`};\n}\n\n.${data.name}.anim {\n animation: ${data.name} ${data.time}s ${
+data.delay ? `${data.delay}s` : ''
} steps(1, end) forwords ${
data.loop ? (+data.loopNum ? data.loopNum : 'infinite') : ''
let animClass = `.${data.name} {\n width: ${wUnit}${unit};\n height: ${hUnit}${unit};\n background-size: ${`${(col * wUnit).toFixed(2)}${unit} ${(row * hUnit).toFixed(2)}${unit}`};\n}\n\n.${data.name}.anim {\n animation: ${data.name} ${data.time}s${
+data.delay ? ` ${data.delay}s ` : ' '
}steps(1, end) forwords${
data.loop ? (+data.loopNum ? ` ${data.loopNum}` : ' infinite') : ''
};\n}`
// console.log(animClass)
// console.log(ani mClass)
let frames = ''
for (let i = 0; i < this.fileList.length; i++) {
if (i === 0) {
Expand Down

0 comments on commit b2f0abe

Please sign in to comment.