• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

caleb531 / flip-book / 10499304652

22 Aug 2024 12:01AM UTC coverage: 27.382% (-0.2%) from 27.541%
10499304652

push

github

caleb531
Convert components to JSX

72 of 100 branches covered (72.0%)

Branch coverage included in aggregate %.

54 of 648 new or added lines in 27 files covered. (8.33%)

54 existing lines in 21 files now uncovered.

405 of 1642 relevant lines covered (24.67%)

8.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/scripts/components/settings.jsx
1
import ControlComponent from './control.jsx';
×
2

3
class SettingsComponent {
×
UNCOV
4
  async setFrameDuration(story, framesPerSecond) {
×
5
    story.setFramesPerSecond(Number(framesPerSecond));
×
6
    await story.save();
×
7
  }
×
8

9
  async incrementNumPreviousFramesToShow(story) {
×
10
    story.numPreviousFramesToShow = Math.min(story.numPreviousFramesToShow + 1, 4);
×
11
    await story.save();
×
12
  }
×
13

14
  async decrementNumPreviousFramesToShow(story) {
×
15
    story.numPreviousFramesToShow = Math.max(0, story.numPreviousFramesToShow - 1);
×
16
    await story.save();
×
17
  }
×
18

19
  async setLineWidth(story, lineWidth) {
×
20
    story.frameStyles.lineWidth = Number(lineWidth);
×
21
    await story.save();
×
22
  }
×
23

NEW
24
  view({ attrs: { story } }) {
×
NEW
25
    return (
×
NEW
26
      <div className="settings">
×
NEW
27
        <h2>Settings</h2>
×
NEW
28
        <div className="setting">
×
NEW
29
          <label htmlFor="setting-fps">FPS</label>
×
NEW
30
          <input
×
NEW
31
            type="range"
×
NEW
32
            min="2"
×
NEW
33
            max="30"
×
NEW
34
            step="2"
×
NEW
35
            id="setting-fps"
×
NEW
36
            value={story.getFramesPerSecond()}
×
NEW
37
            oninput={({ target }) => this.setFrameDuration(story, target.value)}
×
NEW
38
          />
×
NEW
39
          <span className="setting-value">{story.getFramesPerSecond()}</span>
×
NEW
40
        </div>
×
NEW
41
        <div className="setting">
×
NEW
42
          <label>Previous Frames to Show</label>
×
NEW
43
          <ControlComponent
×
NEW
44
            id="decrement-previous-frames"
×
NEW
45
            title="Show One Less Previous Frame"
×
NEW
46
            icon="decrement"
×
NEW
47
            action={() => this.decrementNumPreviousFramesToShow(story)}
×
NEW
48
          />
×
NEW
49
          <span className="setting-value setting-value-previous-frames">
×
NEW
50
            {story.numPreviousFramesToShow}
×
NEW
51
          </span>
×
NEW
52
          <ControlComponent
×
NEW
53
            id="increment-previous-frames"
×
NEW
54
            title="Show One More Previous Frame"
×
NEW
55
            icon="increment"
×
NEW
56
            action={() => this.incrementNumPreviousFramesToShow(story)}
×
NEW
57
          />
×
NEW
58
        </div>
×
NEW
59
        <div className="setting">
×
NEW
60
          <label htmlFor="setting-stroke-width">Stroke Width</label>
×
NEW
61
          <input
×
NEW
62
            type="range"
×
NEW
63
            min="4"
×
NEW
64
            max="20"
×
NEW
65
            step="4"
×
NEW
66
            id="setting-stroke-width"
×
NEW
67
            value={story.frameStyles.lineWidth}
×
NEW
68
            oninput={({ target }) => this.setLineWidth(story, target.value)}
×
NEW
69
          />
×
NEW
70
          <span className="setting-value">{story.frameStyles.lineWidth}</span>
×
NEW
71
        </div>
×
NEW
72
      </div>
×
73
    );
UNCOV
74
  }
×
UNCOV
75
}
×
76

77
export default SettingsComponent;
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc