Created
August 16, 2021 11:45
-
-
Save kujirahand/005adff6965f737a2d3d5b065f6e2d0c to your computer and use it in GitHub Desktop.
3×3のグリッドのアイデア発想ツール 改良版
This file contains 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
<!DOCTYPE html><meta charset="utf-8"><html><body> | |
<!-- UIを作成 --> | |
<div id="g"></div> | |
<p style="clear:both"></p> | |
<p><a id="save" download="idea.txt" href="#">保存</a></p> | |
<!-- JavaScript --> | |
<script> | |
// 3×3のグリッドを作成 | |
const g = document.querySelector('#g') | |
const items = [] | |
for (let i = 0; i < 9; i++) { | |
const e = document.createElement('textarea') | |
e.innerHTML = '?' | |
if (i == 4) { e.className = 'center' } | |
g.appendChild(e) | |
items.push(e) | |
} | |
// 保存リンクでデータをダウンロード | |
const save = document.querySelector('#save') | |
save.onclick = (e) => { | |
const m = items.map(i => i.value) | |
const text = m.join('\n') | |
const blob = new Blob([text], {'type': 'text/plain'}) | |
save.href = URL.createObjectURL(blob) | |
}; | |
</script> | |
<style> | |
#g { width: 600px; } | |
textarea { | |
padding: 0px; margin: 0px; | |
width: 198px; height: 150px; | |
font-size: 1.3em; float: left; | |
} | |
.center { background-color: #fff0f0; } | |
</style> | |
</body></html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment