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

caleb531 / flip-book / 10499286139

21 Aug 2024 11:59PM UTC coverage: 25.53% (-2.0%) from 27.541%
10499286139

push

github

caleb531
Convert components to JSX

72 of 100 branches covered (72.0%)

Branch coverage included in aggregate %.

0 of 743 new or added lines in 22 files covered. (0.0%)

54 existing lines in 21 files now uncovered.

386 of 1694 relevant lines covered (22.79%)

6.85 hits per line

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

0.0
/scripts/components/settings.jsx
NEW
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) {
×
NEW
10
    story.numPreviousFramesToShow = Math.min(
×
NEW
11
      story.numPreviousFramesToShow + 1,
×
NEW
12
      4,
×
NEW
13
    );
×
14
    await story.save();
×
15
  }
×
16

17
  async decrementNumPreviousFramesToShow(story) {
×
NEW
18
    story.numPreviousFramesToShow = Math.max(
×
NEW
19
      0,
×
NEW
20
      story.numPreviousFramesToShow - 1,
×
NEW
21
    );
×
22
    await story.save();
×
23
  }
×
24

25
  async setLineWidth(story, lineWidth) {
×
26
    story.frameStyles.lineWidth = Number(lineWidth);
×
27
    await story.save();
×
28
  }
×
29

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

83
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

© 2025 Coveralls, Inc