From badc1d2c444c0d6f662de810c9f8fa109cd2dc98 Mon Sep 17 00:00:00 2001 From: DataEraserC <102341238+DataEraserC@users.noreply.github.com> Date: Sun, 30 Oct 2022 18:44:42 +0800 Subject: [PATCH] Add a mess --- html/12.html | 21 +++++++++++++++++++++ html/12.js | 24 ++++++++++++++++++++++++ html/13.css | 20 ++++++++++++++++++++ html/13.html | 24 ++++++++++++++++++++++++ html/13.js | 8 ++++++++ rust/tests/Cargo.toml | 9 +++++++++ rust/tests/src/main.rs | 10 ++++++++++ 7 files changed, 116 insertions(+) create mode 100644 html/12.html create mode 100644 html/12.js create mode 100644 html/13.css create mode 100644 html/13.html create mode 100644 html/13.js create mode 100644 rust/tests/Cargo.toml create mode 100644 rust/tests/src/main.rs diff --git a/html/12.html b/html/12.html new file mode 100644 index 0000000..113dafe --- /dev/null +++ b/html/12.html @@ -0,0 +1,21 @@ + + + + + + + + Document + + + +
+ + + +
+ + + + + \ No newline at end of file diff --git a/html/12.js b/html/12.js new file mode 100644 index 0000000..db97039 --- /dev/null +++ b/html/12.js @@ -0,0 +1,24 @@ +function a() { + x = document.forms["fo"]["txt"].value + if (x == null || x == "") { + alert("input can't be blank") + return false + } + else if (x == "123456") { + alert("login success!") + } + else { + alert("password is wrong") + return false + } +} +function b() { + windows.location = "11.html" +} + +function c() +{ + setTimeout(function(){ + document.write("1234565432") + },3000) +} \ No newline at end of file diff --git a/html/13.css b/html/13.css new file mode 100644 index 0000000..da89985 --- /dev/null +++ b/html/13.css @@ -0,0 +1,20 @@ +.a { + background-color: aliceblue; + height: 500px; + width: 1500px; + margin-left: 5%; + overflow: hidden; + position: absolute; +} +.b { + width: 4500px; + height: 500px; + display: flex; + /* left: -100px; */ + position: relative; +} +.c { + width: 1500px; + height: 500px; + float:left; +} \ No newline at end of file diff --git a/html/13.html b/html/13.html new file mode 100644 index 0000000..9a5a58e --- /dev/null +++ b/html/13.html @@ -0,0 +1,24 @@ + + + + + + + + Document + + + + + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/html/13.js b/html/13.js new file mode 100644 index 0000000..8a71d92 --- /dev/null +++ b/html/13.js @@ -0,0 +1,8 @@ +onload = function () { + setInterval(function () { + var x = document.getElementsByClassName("b")[0]; + console.log(x.style.left); // can be modified + console.log(x.offsetLeft); // read only + x.style.left = (x.offsetLeft - 1) + "px" + }, 10); +} \ No newline at end of file diff --git a/rust/tests/Cargo.toml b/rust/tests/Cargo.toml new file mode 100644 index 0000000..19efcb4 --- /dev/null +++ b/rust/tests/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +num = "0.4.0" \ No newline at end of file diff --git a/rust/tests/src/main.rs b/rust/tests/src/main.rs new file mode 100644 index 0000000..f91cd9c --- /dev/null +++ b/rust/tests/src/main.rs @@ -0,0 +1,10 @@ +fn main() { + let s1 = String::from("Hello world"); + + let s2 = takes_ownership(s1); + println!("{}", s1); + println!("{}", s2); +} +fn takes_ownership(s: String) -> String { + s +}