1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

wslでelixir その166

Last updated at Posted at 2025-03-18

概要

wsl(wsl2じゃない)で、elixirやってみた。
練習問題やってみた。

練習問題

Livebookの、kino.jsで、circuitjsを動作させよ。

参考にしたページ

写真

image.png

サンプルコード


defmodule KinoHTML.Iframe do
	use Kino.JS
	def new(html) do
		Kino.JS.new(__MODULE__, html)
	end
	asset "main.js" do
		"""
		export function init(ctx, html) {
			const iframe = document.createElement("iframe");
			iframe.setAttribute("src", html);
			iframe.style.width = "100%";
			iframe.style.height = "500px";
			iframe.style.border = "0";
			ctx.root.appendChild(iframe);
		}
		"""
	end
end

KinoHTML.Iframe.new("https://code4fukui.github.io/circuitjs1/war/circuitjs.html?ctz=CQAgjCAMB0l3BWEA2aAWB8CcBmSy0AOBBAdkJE0sskoFMBaMMAKAHkQ05xlaEwATD1oiWAc07cBhCl1o4BIqCwBOIAV2GTaYXlHCFILAMbatc9TP0x4kCGnSlkyfshwJkYUmi9RYdlgAldU1dWg1aLGROakVqJRgEFgB7fQV9LiwKJBgIHRSY9NpMrHjYJAghNBAcFgALGvUaliA")


以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?