Skip to content

Commit

Permalink
Add in notepad rings, see: #102
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Nov 1, 2022
1 parent 4d52c25 commit 3b9ae89
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
8 changes: 8 additions & 0 deletions images/license.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,13 @@
"projectURL": "https://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Mariah Hermsmeyer"
},
"notepadRing.png": {
"text": [
"Copyright 2022 University of Colorado Boulder"
],
"projectURL": "https://phet.colorado.edu",
"license": "contact [email protected]",
"notes": "created by Mariah Hermsmeyer"
}
}
Binary file added images/notepadRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions images/notepadRing_png.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable */
import asyncLoader from '../../phet-core/js/asyncLoader.js';

const image = new Image();
const unlock = asyncLoader.createLock( image );
image.onload = unlock;
image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAABFCAYAAAAB8xWyAAAACXBIWXMAAAsSAAALEgHS3X78AAALGUlEQVRoge1bb0xUVxb/3Znn/AHmOTPSNwrY6kQUFQobm5Htuls2U6OtQpnNplu7CtvW4r9JQzbtBlNbN5oITUhBM7YfmuxGE0B3NVBda2mlywdpELoV9qGwoRkJ9d88YJjM8KbwZvDuB4QFZN7MIHVw018yH+bec887v5x7zz33vvMIpRT/j2DmWiEhRA8g32QyvUIpXeHxeFIkSVKP96tUqhGWZXsUCsW/BEH4O4BGSqlnzu2YK48RQnI4jvtAEATLM888E0hNTV2Qnp4Ok8kEjuMm5ARBgMvlQkdHB9rb24PXr19njEZjk9vtPkApbZwTYzAHxAghOSzLnlywYMESm83GWK1WxMfHRzxeEAQ0NDSgrq7uXnx8fHd/f//uuSA4a2KEED3LsrWSJP1y+/btyry8vIcyRBRF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52Lp168Ra++yzz3DlyhW0t7eDUoqlS5fW9/b2/olS+u8ZlVJK580PY/eIlwghfgB0+o8QMqpQKLoB/CKcrnnhMTkQQvSzKXP6L1hkJqxfcnS/AAAAAElFTkSuQmCC';
export default image;
4 changes: 2 additions & 2 deletions js/common/MeanShareAndBalanceConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ const MeanShareAndBalanceConstants = {
CHOCOLATE_HEIGHT: 12,
PERSON_WIDTH: 105,

PLATE_CHOCOLATE_CENTER_Y: 250,
PLATE_CHOCOLATE_CENTER_Y: 310,
PEOPLE_CENTER_Y: 500,
MAX_NUMBER_OF_CHOCOLATES: 10,
MIN_NUMBER_OF_CHOCOLATES: 0,
NOTEBOOK_PAPER_CENTER_Y: 240
NOTEBOOK_PAPER_CENTER_Y: 220

};

Expand Down
34 changes: 30 additions & 4 deletions js/common/view/NoteBookPaperNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,41 @@
*/

import meanShareAndBalance from '../../meanShareAndBalance.js';
import { Node, Image } from '../../../../scenery/js/imports.js';
import { Node, Rectangle, Image } from '../../../../scenery/js/imports.js';
import MeanShareAndBalanceConstants from '../MeanShareAndBalanceConstants.js';
import notebookPaperBackground_png from '../../../images/notebookPaperBackground_png.js';
import notepadRing_png from '../../../images/notepadRing_png.js';

export default class NoteBookPaperNode extends Node {

public constructor() {
const background = new Image( notebookPaperBackground_png, { scale: 0.48 } );
super( { children: [ background ], centerY: MeanShareAndBalanceConstants.NOTEBOOK_PAPER_CENTER_Y } );

const paperStackNode = new Node();
const paperWidth = 700;
const paperHeight = 240;
const paperStackHeight = 4;
const stackOffset = 3;

for ( let i = paperStackHeight; i > 0; i-- ) {
const xOffset = i * -stackOffset;
const yOffset = i * stackOffset;
const paper = new Rectangle( xOffset, yOffset, paperWidth, paperHeight, {
fill: 'white',
stroke: 'black',
cornerRadius: 10
} );
paperStackNode.addChild( paper );
}

const rings = [];
const numberOfRings = 6;

for ( let i = 0; i < numberOfRings; i++ ) {
const x = i * ( ( paperWidth - 20 ) / numberOfRings ) + 30;

rings.push( new Image( notepadRing_png, { x: x, y: -21.5, scale: 0.8 } ) );
}

super( { children: [ paperStackNode, ...rings ], centerY: MeanShareAndBalanceConstants.NOTEBOOK_PAPER_CENTER_Y } );
}
}

Expand Down

0 comments on commit 3b9ae89

Please sign in to comment.