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

/**
 * Restart button.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import { Shape } from '../../../kite/js/imports.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';
import InstanceRegistry from '../../../phet-core/js/documentation/InstanceRegistry.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import { HBox, Path, Rectangle } from '../../../scenery/js/imports.js';
import RoundPushButton, { RoundPushButtonOptions } from '../../../sun/js/buttons/RoundPushButton.js';
import sceneryPhet from '../sceneryPhet.js';

// constants
const scale = 0.75;
const vscale = 1.15;
const barWidth = 6 * scale;
const barHeight = 18 * scale * vscale;
const triangleWidth = 14 * scale;
const triangleHeight = 18 * scale * vscale;

type SelfOptions = EmptySelfOptions;

export type RestartButtonOptions = SelfOptions & StrictOmit<RoundPushButtonOptions, 'content'>;

export default class RestartButton extends RoundPushButton {

  public constructor( providedOptions?: RestartButtonOptions ) {

    const options = optionize<RestartButtonOptions, SelfOptions, RoundPushButtonOptions>()( {}, providedOptions );

    const barPath = new Rectangle( 0, 0, barWidth, barHeight, { fill: 'black', stroke: '#bbbbbb', lineWidth: 1 } );
    const trianglePath = new Path( new Shape().moveTo( 0, triangleHeight / 2 ).lineTo( -triangleWidth, 0 ).lineTo( 0, -triangleHeight / 2 ).close(), {
      fill: 'black',
      stroke: '#bbbbbb',
      lineWidth: 1
    } );
    const trianglePath2 = new Path( new Shape().moveTo( 0, triangleHeight / 2 ).lineTo( -triangleWidth, 0 ).lineTo( 0, -triangleHeight / 2 ).close(), {
      fill: 'black',
      stroke: '#bbbbbb',
      lineWidth: 1
    } );

    options.content = new HBox( { children: [ barPath, trianglePath, trianglePath2 ], spacing: -1 } );

    super( options );

    // support for binder documentation, stripped out in builds and only runs when ?binder is specified
    assert && phet.chipper.queryParameters.binder && InstanceRegistry.registerDataURL( 'scenery-phet', 'RestartButton', this );
  }
}

sceneryPhet.register( 'RestartButton', RestartButton );<commit_msg>improve restartButton icon to match better font-awesome 6 backward-fast and other play/pause control icons, https://github.com/phetsims/gravity-and-orbits/issues/447<commit_after>// Copyright 2014-2022, University of Colorado Boulder

/**
 * Restart button.
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import { Shape } from '../../../kite/js/imports.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';
import InstanceRegistry from '../../../phet-core/js/documentation/InstanceRegistry.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import { HBox, Path, Rectangle } from '../../../scenery/js/imports.js';
import RoundPushButton, { RoundPushButtonOptions } from '../../../sun/js/buttons/RoundPushButton.js';
import sceneryPhet from '../sceneryPhet.js';

// constants
const scale = 0.75;
const vscale = 1.15;
const barWidth = 4 * scale;
const barHeight = 19 * scale * vscale;
const triangleWidth = 15 * scale;
const triangleHeight = 19 * scale * vscale;

type SelfOptions = EmptySelfOptions;

export type RestartButtonOptions = SelfOptions & StrictOmit<RoundPushButtonOptions, 'content'>;

export default class RestartButton extends RoundPushButton {

  public constructor( providedOptions?: RestartButtonOptions ) {

    const options = optionize<RestartButtonOptions, SelfOptions, RoundPushButtonOptions>()( {}, providedOptions );

    const barPath = new Rectangle( 0, 0, barWidth, barHeight, { fill: 'black' } );
    const trianglePath = new Path( new Shape().moveTo( 0, triangleHeight / 2 ).lineTo( -triangleWidth, 0 ).lineTo( 0, -triangleHeight / 2 ).close(), {
      fill: 'black'
    } );
    const trianglePath2 = new Path( new Shape().moveTo( 0, triangleHeight / 2 ).lineTo( -triangleWidth, 0 ).lineTo( 0, -triangleHeight / 2 ).close(), {
      fill: 'black'
    } );

    options.content = new HBox( { children: [ barPath, trianglePath, trianglePath2 ], spacing: -1 } );

    super( options );

    // support for binder documentation, stripped out in builds and only runs when ?binder is specified
    assert && phet.chipper.queryParameters.binder && InstanceRegistry.registerDataURL( 'scenery-phet', 'RestartButton', this );
  }
}

sceneryPhet.register( 'RestartButton', RestartButton );
{'fraction_non_alphanumeric': 0.14557943718147573, 'fraction_numerical': 0.01750498559716375, 'mean_word_length': 3.848549946294307, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, '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': '3072677', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1331, 'n_words': 384}