diff --git a/.DS_Store b/.DS_Store index 4f5d935..bb2a5f9 100644 --- a/.DS_Store +++ b/.DS_Store Binary files differ diff --git a/dbl.html b/dbl.html new file mode 100644 index 0000000..73ea874 --- /dev/null +++ b/dbl.html @@ -0,0 +1,24 @@ + + + + +たいとる + + + + +

間違い探し【ゼロを探せ】

+

OOO

+

OO

+

0

+

OO

+

OOO

+ +

+

+

+

+

+ + + \ No newline at end of file diff --git a/dbl.js b/dbl.js new file mode 100755 index 0000000..19add40 --- /dev/null +++ b/dbl.js @@ -0,0 +1,13 @@ +function dblSize(){ + var pElements = document.querySelectorAll("p"); + if(pElements.length == 0){ + alert("p要素はこの文書にありません"); + }else{ + for(let font of pElements){ + font.style.fontSize = "200%"; + } + } +} +window.addEventListener("load", function(e){ + document.body.addEventListener("click", dblSize); +}); \ No newline at end of file diff --git a/dokan.css b/dokan.css new file mode 100644 index 0000000..d0967b1 --- /dev/null +++ b/dokan.css @@ -0,0 +1,25 @@ +.square_contents { + display: flex; + flex-wrap: wrap; + max-width: 600px; + } + + .square_contents div { + position: relative; + width: 31%; + background: #ffb6c1; + margin: 1%; + } + + .square_contents div::before { + content: ""; + display: block; + padding-top: 100%; + } + + .square_contents p { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + } \ No newline at end of file diff --git a/dokan.html b/dokan.html new file mode 100644 index 0000000..8ae1eab --- /dev/null +++ b/dokan.html @@ -0,0 +1,24 @@ + + + +Hello Hello Hello + + + + +
+

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+
+

+

開始を押してスタート!

+ + \ No newline at end of file diff --git a/dokan.js b/dokan.js new file mode 100644 index 0000000..db8aaee --- /dev/null +++ b/dokan.js @@ -0,0 +1,35 @@ +function CountDown() { + var count = 6; + var tmID; + var infobox = document.getElementById("info"); + var start = document.getElementById("start"); + var clear = document.getElementById("clear"); + + function countDown() { + if (--count < 0) { + infobox.innerHTML = "失敗"; + } else { + infobox.innerHTML = count + "秒前"; + tmID = setTimeout(countDown, 1000); + } + } + +function startCountDown() { + tmID = setTimeout(countDown, 1000); + var list = document.getElementsByTagName('div'); + for (let i of list){ + i.removeEventListener("click", startCountDown, false); + clear.addEventListener('click', stopCountDown); + } +} + +function stopCountDown() { + if (count >= 0) { + clearTimeout(tmID); + infobox.innerHTML = "成功"; + } +} + +start.addEventListener("click", startCountDown, false); +}; +document.addEventListener("DOMContentLoaded", CountDown, false); \ No newline at end of file diff --git a/hello.js b/hello.js index d14ccc0..da6036e 100644 --- a/hello.js +++ b/hello.js @@ -2,4 +2,4 @@ document.getElementById("h1").addEventListener("click", (e) => { alert("Hello"); }, false); -}); +}); \ No newline at end of file diff --git a/rensyu.js b/rensyu.js new file mode 100755 index 0000000..4fb29d1 --- /dev/null +++ b/rensyu.js @@ -0,0 +1,14 @@ +var g1 = "外側のg1"; +var g2 = "外側のg2"; +function foo() { + var g1 = "fooでg1を設定"; + g2 = "fooでg2を設定"; + g3 = "fooでg3を設定"; + var g4 = "fooでg4を設定"; +} +foo(); +console.log("g1="+g1); +console.log("g2="+g2); +console.log("g3="+g3); +console.log("g4="+g4); + \ No newline at end of file