var configObject = function(){ //stage properties... var stageProperties = { stageWidth: 1200, stageHeight: 600, stageBGColor: 'rgba(255, 250, 220, 1)', manifest: [ //scene_0 { "src": "snell_law.png", "id": "law"}, { "src": "table_top.png", "id": "table"}, { "src": "mat.png", "id": "mat"}, { "src": "support.png", "id": "support"}, { "src": "glass_slab.png", "id": "window"}, { "src": "flint_glass.png", "id": "flint"}, { "src": "fused_silica_glass.png", "id": "fusedSilica"}, { "src": "pyrex_glass.png", "id": "pyrex"}, { "src": "radiation_shielding_window_glass.png", "id": "radiationShielding"}, { "src": "protractor.png", "id": "protractor"}, { "src": "laser_torch.png", "id": "laser"}, ], sounds: { path: "./assets/", manifest: [ { id: "welcome", src: { mp3: "mp3/welcome.mp3" } }, { id: "glass", src: { mp3: "mp3/select_glass.mp3" } }, { id: "slider", src: { mp3: "mp3/slider.mp3" } }, { id: "glass_set", src: { mp3: "mp3/glass_set.mp3" } }, { id: "switch_on", src: { mp3: "mp3/switch_on.mp3" } }, { id: "protractor_set", src: { mp3: "mp3/protractor_set.mp3" } }, { id: "backgroundMusic", src: { mp3: "mp3/morning_garden.mp3" } }, ] } }; //define the scenes... var scenes = { //names must be in the order they are played... names: [ "Measurement of the Refractive Index of Glasses", //scene_0 ], //defaults, may be overwritten (TODO) offset: 5, bgColor: 'rgba(204, 204, 204, 0.4)', border: { size: 2, color: 'black' }, borderRadius: [5, 5, 5, 5], }; //scene assets... var assets = { properties: [ //scene_0 { law: { id: 'law', x: 0, y: 0, scaleX: 1, scaleY: 1 }, table: { id: 'table', x: 35, y: 45, scaleX: 1, scaleY: 1 }, mat: { id: 'mat', x: 1165, y: 566, scaleX: 1, scaleY: 1 }, support: { id: 'support', x: -20, y: 485, scaleX: 0.5, scaleY: 0.5 }, window: { id: 'window', x: 250, y: 80, scaleX: 1, scaleY: 1 }, flint: { id: 'flint', x: 250, y: 80, scaleX: 1, scaleY: 1 }, pyrex: { id: 'pyrex', x: 250, y: 80, scaleX: 1, scaleY: 1 }, fusedSilica: { id: 'fusedSilica', x: 250, y: 80, scaleX: 1, scaleY: 1 }, radiationShielding: { id: 'radiationShielding', x: 250, y: 80, scaleX: 1, scaleY: 1 }, protractor: { id: 'protractor', x: 850, y: 300, scaleX: 0.3, scaleY: 0.3 }, laser: { id: 'laser', x: 850, y: 200, scaleX: 0.8, scaleY: 0.8 }, }, //scene_1, etc... ] }; //scene controls... var controls = { properties: [ //scene_0 { slider: { id: 'slider', x: 915, y: 550, width: 200, height: 8, handleWidth: 15, handleMax: 75, handleUnit: '', handleInitPos: 0, trackBGSolid: '#E8CB93', trackBGType: 'solid', trackBorder: { thickness: 2, color: '#422C02' }, colorChange: false, displayBubble: false, visible: false }, dropDown: { x: 750, y: 100, w: 300, item_h: 25, font_h: 16, items: [ { text: 'Select Glass'}, { text: 'Window Glass'}, { text: 'Fused Silica'}, { text: 'Pyrex (Borosilicate)'}, { text: 'Flint/Lead Glass'}, { text: 'Gorilla Glass'}, { text: 'Radiation-shielding Window Glass'}, ], visible: true, }, calculateButton: { x: 930, y: 460, radius: 20, displayLabel: true, visible: false, type: 'rectangular', text: 'Calculate RI', BGFillSolid: { normal: 'rgba(10, 200, 80, 1)', hover: 'rgba(255, 204, 0, 1)', active: 'rgba(255, 0, 0, 1)' } }, }, //scene_1, etc ... ] }; var about = { appName: 'CGCGRI Refraction Index of Glasses', appVersion: '1.0', appDate: '22nd January, 2022', author: 'Shubhojoy Mitra', authorEmail: 'shubhojoy@gmail.com', description: 'Interactive Simulation to Measure the Refractive Index of Glasses', usage: `1. How can I add a glass to measure its RI?\n Click on the drop-down box labelled "Select Glass" and choose one from the list. This will load a new glass on the black mat atop four supports slightly raizing it from the surface of the table.\n 2. How can I see the refracted light in the glass slab?\n Click the laser torch to set it in the right position at the level of the glass slab. The laser torch will be automatically turned on and you will be able to observe the ray of green laser light being refracted in the glass slab.\n 3. How can I measure the angle of refraction?\n Click on the protractor and it will be automatically placed at the correct position so you can measure the angle of refraction of the laser beam.\n 4. How can I change the angle of incidence of the laser beam?\n By default, the angle of incidence is 0 degrees. To change it, you must move the laser torch. In order to do so, you must drag the handle of the slider that appears on the bottom left. A large red text will display to what degree you moved the laser beam in relation to the normal represented by a dashed grey line. You can change the angle of incidence to any value from 0 to 75 degrees.\n 5. How can I calculate the refractive index of the glass?\n Click on the button labelled "Calculate RI" and follow the instructions given to calculate the RI. In order to obtain the correct result, you must select the angle of refraction measured with the protractor.` }; var config = { setStageProperties: function(){ this.stageProperties = stageProperties; }, setScenes: function(){ this.scenes = scenes; }, setAssets: function(){ this.assets = assets; }, setControls: function(){ this.controls = controls; }, setAbout: function(){ this.about = about; }, init: function(){ this.setStageProperties(); this.setScenes(); this.setAssets(); this.setControls(); this.setAbout(); return this; } }; var globalConfig = config.init(); return globalConfig; };