File tree Expand file tree Collapse file tree 3 files changed +23
-19
lines changed
packages/npm-packages/ruby-wasm-wasi/example Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Original file line number Diff line number Diff line change
1
+ < html >
2
+ < script src ="../dist/browser.script.js "> </ script >
3
+ < script type ="text/ruby ">
4
+ puts "Hello, world!"
5
+ </ script >
6
+ </ html >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < script src ="../../ruby-head-wasm-wasi/dist/browser.script.iife.js "> </ script >
3
+ < button id ="draw "> Draw Omikuji</ button >
4
+ < script type ="text/ruby ">
5
+ require "js"
6
+ luckiness = [ "Lucky" , "Unlucky" ] . sample
7
+ document = JS . global [ :document ]
8
+ JS . global [ :document ] . write luckiness
9
+ button = document . getElementById "draw"
10
+ result = document . getElementById "result"
11
+ button . addEventListener "click" do | e |
12
+ puts e
13
+ luckiness = [ "Lucky" , "Unlucky" ] . sample
14
+ result [ :innerText ] = luckiness
15
+ end
16
+ </ script >
17
+ </ html >
You can’t perform that action at this time.
0 commit comments