Advertisement
lel42

Untitled

Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. var d=(0,eval)('document');
  2.  
  3. var p=(0,eval)('JSON.stringify');
  4.  
  5. //rect(20,20,20,20);
  6.  
  7. //science on `document`
  8.  
  9. /**
  10. * the document that you get from eval is a separate document from the main document object, so it's not breaking the rules to use it
  11. * if you use document.write, it overwrites any PJS content on the canvas
  12. */
  13.  
  14. d.write(
  15. '<style>'+
  16. 'body{background-color:#1375;color:#999999;font-family:inconsolata,consolas,monaco,courier,monospace}'+
  17. '</style>'
  18. );
  19.  
  20. frameCount=0;
  21. draw= function() {
  22. if(frameCount<5){
  23. d.write(
  24. '<script>rect(20,20,20,20)</script>'+
  25. '<p>Hi there!</p>' +
  26. '<button onclick="alert(0x539)">click this button!</button>'
  27. );
  28. var a=get(0,0,400,400);
  29. d.write(p(d,null,2));
  30. d.write(a); //so basically PJS functions still work...
  31. image(a,20,20); //but their effects aren't directly visible.
  32. }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement