<commit_before>// Copyright 2018-2022, University of Colorado Boulder

/**
 * Demonstrates vegas UI components.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */

import BooleanProperty from '../../../axon/js/BooleanProperty.js';
import NumberProperty from '../../../axon/js/NumberProperty.js';
import Range from '../../../dot/js/Range.js';
import Utils from '../../../dot/js/Utils.js';
import ScreenView from '../../../joist/js/ScreenView.js';
import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import { HBox, Text, VBox } from '../../../scenery/js/imports.js';
import RectangularPushButton from '../../../sun/js/buttons/RectangularPushButton.js';
import Checkbox from '../../../sun/js/Checkbox.js';
import HSlider from '../../../sun/js/HSlider.js';
import Tandem from '../../../tandem/js/Tandem.js';
import FiniteStatusBar from '../FiniteStatusBar.js';
import LevelCompletedNode from '../LevelCompletedNode.js';
import vegas from '../vegas.js';

// constants
const PERFECT_SCORE = 10;
const NUMBER_OF_CHALLENGES = 10;
const DEFAULT_FONT = new PhetFont( 20 );

export default class FiniteChallengesScreenView extends ScreenView {

  public constructor() {

    super( {
      tandem: Tandem.OPT_OUT
    } );

    // 1-based
    const levelProperty = new NumberProperty( 1, {
      numberType: 'Integer',
      range: new Range( 1, 5 )
    } );
    const challengeIndexProperty = new NumberProperty( 0, {
      numberType: 'Integer',
      range: new Range( 0, NUMBER_OF_CHALLENGES - 1 )
    } );
    const numberOfChallengesProperty = new NumberProperty( NUMBER_OF_CHALLENGES, {
      numberType: 'Integer',
      range: new Range( 1, NUMBER_OF_CHALLENGES )
    } );
    const scoreProperty = new NumberProperty( 0, {
      numberType: 'Integer',
      range: new Range( 0, PERFECT_SCORE )
    } );
    const elapsedTimeProperty = new NumberProperty( 0, {
      range: new Range( 0, 1000 )
    } );
    const timerEnabledProperty = new BooleanProperty( true );

    // status bar across the top
    const statusBar = new FiniteStatusBar( this.layoutBounds, this.visibleBoundsProperty, scoreProperty, {
      font: new PhetFont( 20 ),
      levelProperty: levelProperty,
      challengeIndexProperty: challengeIndexProperty,
      numberOfChallengesProperty: numberOfChallengesProperty,
      elapsedTimeProperty: elapsedTimeProperty,
      timerEnabledProperty: timerEnabledProperty,
      startOverButtonOptions: {
        listener: () => { console.log( 'Start Over' ); }
      }
    } );
    this.addChild( statusBar );

    // Controls for changing Properties
    const levelSlider = new HBox( {
      children: [
        new Text( 'Level: ', { font: DEFAULT_FONT } ),
        new HSlider( levelProperty, levelProperty.range!, {
          constrainValue: value => Utils.roundSymmetric( value )
        } )
      ]
    } );

    const challengeIndexSlider = new HBox( {
      children: [
        new Text( 'Challenge: ', { font: DEFAULT_FONT } ),
        new HSlider( challengeIndexProperty, challengeIndexProperty.range!, {
          constrainValue: value => Utils.roundSymmetric( value )
        } )<commit_msg>add fill to status bar, so it's visible<commit_after>// Copyright 2018-2022, University of Colorado Boulder

/**
 * Demonstrates vegas UI components.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PixelZoom, Inc.)
 */

import BooleanProperty from '../../../axon/js/BooleanProperty.js';
import NumberProperty from '../../../axon/js/NumberProperty.js';
import Range from '../../../dot/js/Range.js';
import Utils from '../../../dot/js/Utils.js';
import ScreenView from '../../../joist/js/ScreenView.js';
import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import { HBox, Text, VBox } from '../../../scenery/js/imports.js';
import RectangularPushButton from '../../../sun/js/buttons/RectangularPushButton.js';
import Checkbox from '../../../sun/js/Checkbox.js';
import HSlider from '../../../sun/js/HSlider.js';
import Tandem from '../../../tandem/js/Tandem.js';
import FiniteStatusBar from '../FiniteStatusBar.js';
import LevelCompletedNode from '../LevelCompletedNode.js';
import vegas from '../vegas.js';

// constants
const PERFECT_SCORE = 10;
const NUMBER_OF_CHALLENGES = 10;
const DEFAULT_FONT = new PhetFont( 20 );

export default class FiniteChallengesScreenView extends ScreenView {

  public constructor() {

    super( {
      tandem: Tandem.OPT_OUT
    } );

    // 1-based
    const levelProperty = new NumberProperty( 1, {
      numberType: 'Integer',
      range: new Range( 1, 5 )
    } );
    const challengeIndexProperty = new NumberProperty( 0, {
      numberType: 'Integer',
      range: new Range( 0, NUMBER_OF_CHALLENGES - 1 )
    } );
    const numberOfChallengesProperty = new NumberProperty( NUMBER_OF_CHALLENGES, {
      numberType: 'Integer',
      range: new Range( 1, NUMBER_OF_CHALLENGES )
    } );
    const scoreProperty = new NumberProperty( 0, {
      numberType: 'Integer',
      range: new Range( 0, PERFECT_SCORE )
    } );
    const elapsedTimeProperty = new NumberProperty( 0, {
      range: new Range( 0, 1000 )
    } );
    const timerEnabledProperty = new BooleanProperty( true );

    // status bar across the top
    const statusBar = new FiniteStatusBar( this.layoutBounds, this.visibleBoundsProperty, scoreProperty, {
      barFill: 'pink',
      font: new PhetFont( 20 ),
      levelProperty: levelProperty,
      challengeIndexProperty: challengeIndexProperty,
      numberOfChallengesProperty: numberOfChallengesProperty,
      elapsedTimeProperty: elapsedTimeProperty,
      timerEnabledProperty: timerEnabledProperty,
      startOverButtonOptions: {
        listener: () => { console.log( 'Start Over' ); }
      }
    } );
    this.addChild( statusBar );

    // Controls for changing Properties
    const levelSlider = new HBox( {
      children: [
        new Text( 'Level: ', { font: DEFAULT_FONT } ),
        new HSlider( levelProperty, levelProperty.range!, {
          constrainValue: value => Utils.roundSymmetric( value )
        } )
      ]
    } );

    const challengeIndexSlider = new HBox( {
      children: [
        new Text( 'Challenge: ', { font: DEFAULT_FONT } ),
        new HSlider( challengeIndexProperty, challengeIndexProperty.range!, {
          constrainValue: value => Utils.roundSymmetric( value )
        } )
{'fraction_non_alphanumeric': 0.13625685199686766, 'fraction_numerical': 0.010023492560689115, 'mean_word_length': 2.9226044226044228, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1441487', 'n_tokens_mistral': 1976, 'n_tokens_neox': 1875, 'n_words': 487}