Created
April 22, 2013 15:44
-
-
Save sfentress/5436162 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| document.onload = function() { | |
| iframe = document.getElementById('iframe'); | |
| activity = { | |
| "_id": "activity", | |
| "title": "Sample JSON activity", | |
| "show_oscilloscope": "true", | |
| "showComponentDrawer": "true", | |
| "circuit": [ | |
| { | |
| "type": "function generator", | |
| "UID": "source", | |
| "frequencies": [ | |
| "logarithmic", | |
| 100, | |
| 100000, | |
| 1001 | |
| ], | |
| "amplitude": 10 | |
| }, | |
| { | |
| "type": "inductor", | |
| "draggable": true, | |
| "UID": "L1", | |
| "inductance": "0.001", | |
| "connections": "c5,c11", | |
| "label": "L1" | |
| }, | |
| { | |
| "type": "capacitor", | |
| "draggable": true, | |
| "UID": "C1", | |
| "capacitance": 0.000001, | |
| "connections": "b11,b17", | |
| "label": "C1" | |
| }, | |
| { | |
| "type": "resistor", | |
| "draggable": true, | |
| "UID": "R1", | |
| "resistance": "100", | |
| "connections": "c17,c23", | |
| "label": "L1" | |
| }, | |
| { | |
| "type": "wire", | |
| "draggable": true, | |
| "connections": "left_positive20,a23" | |
| }, | |
| { | |
| "type": "wire", | |
| "draggable": true, | |
| "connections": "left_negative8,a5" | |
| } | |
| ] | |
| } | |
| iframe.contentWindow.postMessage(JSON.stringify(activity), '*'); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <h1>Example embedded SPARKS circuit</h1> | |
| <iframe src="http://sparks.portal.concord.org/sparks-content/embeddable.html#postMessage" width="800px" height="500px"></iframe> | |
| <p>Check out this cool circuit from <a href="http://sparks.concord.org">http://sparks.concord.org</a>!</p> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment