commit 8f4c8cfa862101e469d05c2efc7807ef75812828 Author: soul2 <1052986332@qq.com> Date: Thu Feb 9 15:49:44 2023 +0800 first commit diff --git a/checkQuality/checkQuality-move.css b/checkQuality/checkQuality-move.css new file mode 100644 index 0000000..741006d --- /dev/null +++ b/checkQuality/checkQuality-move.css @@ -0,0 +1,61 @@ +@media(max-width:669px) { + + * { + font-size: 22px; + } + + body .mv-bg { + animation-duration: 9s; + } + + body { + height: 100%; + width: 100%; + overflow: hidden; + } + + #page { + padding: 0 5%; + padding-top: 11.5vh; + } + + input[type='text'] { + border-radius: 2.5px; + outline: none; + border: 1px solid rgba(153, 153, 255, .6); + background-color: rgba(0, 0, 0, .3); + color: #fff; + width: 300px; + padding-left: .5em; + height: 40px; + } + + input[type='text']:hover { + box-shadow: cyan 0 0 3px; + background-color: rgba(0, 0, 0, .1); + } + + input[type='text']:focus { + box-shadow: cyan 0 0 3px; + background-color: rgba(0, 0, 0, .1); + } + + input::input-placeholder { + color: #fff; + } + + #check-result { + color: #fff; + margin-top: 8px; + text-shadow: cyan 1px 1px 2.5px; + } + + .outlink { + width: 100%; + margin-top: 40px; + } + .outlink span { + color: white; + } + +} diff --git a/checkQuality/checkQuality-pc.css b/checkQuality/checkQuality-pc.css new file mode 100644 index 0000000..a591d62 --- /dev/null +++ b/checkQuality/checkQuality-pc.css @@ -0,0 +1,61 @@ +@media(min-width:669px) { + + body { + background: url(http://soul2.cn/images/background/home/1.jpg) center no-repeat fixed; + background-size: 100% 100%; + -moz-background-size: 100% 100%; + -webkit-background-size: 100% 100%; + height: 100%; + width: 100%; + overflow: hidden; + } + + #page { + padding: 0 22vh; + padding-top: 4vh; + } + + input[type='text'] { + border-radius: 2.5px; + outline: none; + border: 1px solid rgba(153, 153, 255, .6); + background-color: rgba(255, 255, 255, .1); + color: #fff; + width: 200px; + padding-left: .5em; + height: 30px; + } + + input[type='text']:hover { + box-shadow: cyan 0 0 3px; + background-color: rgba(255, 255, 255, .175); + } + + input[type='text']:focus { + box-shadow: cyan 0 0 3px; + background-color: rgba(255, 255, 255, .25); + } + + input::input-placeholder { + color: #fff; + } + + input::-webkit-input-placeholder { + color: #cccccc; + } + + #check-result { + color: #fff; + margin-top: 2px; + text-shadow: cyan 1px 1px 2.5px; + } + + .outlink { + width: 15%; + margin-top: 30px; + } + .outlink span { + color: white; + } + +} diff --git a/checkQuality/checkQuality.js b/checkQuality/checkQuality.js new file mode 100644 index 0000000..eb8e5fe --- /dev/null +++ b/checkQuality/checkQuality.js @@ -0,0 +1,31 @@ +function isQuality(n) { + let m = Math.floor(n / 2) + 1 + for (var i = 2; i < m; i++) { + if (n % i == 0) { + return false + } + } + return true +} + +function checkNaturalnumber(obj) { + return (/^[0-9]+$/.test(obj) && (obj > 0)) +} + +function handleInputChange() { + var a = document.querySelector("input[type='text']") + var r = document.getElementById("check-result") + if (!a.value) { + r.innerText = '未输入内容' + } else if (a.value.length > 10) { + r.innerText = '输入内容过长' + } else if (!checkNaturalnumber(a.value)) { + r.innerText = '输入内容不合法,请输入自然数!' + } else { + r.innerText = `${a.value} ${isQuality(a.value) ? '是' : '不是'}质数` + if (a.value == 1) { + r.innerText += `\n任何大于1的整数均可被表示成一串唯一素数之乘积。为了确保该定理的唯一性,1被定义为不是素数。——Wiki` + } + } + +} diff --git a/checkQuality/index.html b/checkQuality/index.html new file mode 100644 index 0000000..379f075 --- /dev/null +++ b/checkQuality/index.html @@ -0,0 +1,26 @@ + + + + + Soul的记事本 + + + + + + + + + +
+ +
未输入内容
+ +
+ + diff --git a/globals/footer.css b/globals/footer.css new file mode 100644 index 0000000..7a031ab --- /dev/null +++ b/globals/footer.css @@ -0,0 +1,11 @@ +.footer { + position: absolute; + bottom: 10px; + left: 0; + text-align: center; + width: 100%; +} + +.beianhao { + color: #fff; +} diff --git a/globals/footer.js b/globals/footer.js new file mode 100644 index 0000000..fe47f84 --- /dev/null +++ b/globals/footer.js @@ -0,0 +1,9 @@ +setTimeout(() => { + let footer = document.createElement('div') + footer.innerHTML = `` + footer.classList.add("off-select") + document.querySelector('body').appendChild(footer) + let footer_style = document.createElement('link') + footer_style.innerHTML = `` + document.querySelector('head').appendChild(footer_style) +}, 0) \ No newline at end of file diff --git a/globals/globals.css b/globals/globals.css new file mode 100644 index 0000000..b0d1514 --- /dev/null +++ b/globals/globals.css @@ -0,0 +1,33 @@ +* { + font-family: '微软雅黑'; + box-sizing: border-box; + margin: 0; + padding: 0; +} + +.off-select, +.menu-item { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.on-pointer { + cursor: pointer; +} + +input::-webkit-input-placeholder { + color: #aaa; +} + +a { + text-decoration: none; + color: #ff9600; +} + +a:hover { + border-bottom: 1px solid #ff9600; +} + + diff --git a/globals/mv-bg.css b/globals/mv-bg.css new file mode 100644 index 0000000..fe1502c --- /dev/null +++ b/globals/mv-bg.css @@ -0,0 +1,46 @@ +@media(max-width:669px) { + .mv-bg { + background: linear-gradient(135deg, + hsl(170deg, 25%, 20%), + hsl(190deg, 45%, 30%), + hsl(240deg, 25%, 20%), + hsl(280deg, 45%, 30%), + hsl(320deg, 30%, 60%)); + background-size: 500% 500%; + -moz-background-size: 500% 500%; + -webkit-background-size: 500% 500%; + animation: bg-linear 60s infinite; + height: 100%; + width: 100%; + position: absolute; + top: 0%; + left: 0; + z-index: -1; + } + + @keyframes bg-linear { + 0% { + background-position: 0% 0%; + } + + 20% { + background-position: 50% 0%; + } + + 40% { + background-position: 0% 50%; + } + + 60% { + background-position: 100% 0%; + } + + 80% { + background-position: 0% 100%; + } + + 100% { + background-position: 0% 0%; + } + } +} diff --git a/globals/mv-bg.js b/globals/mv-bg.js new file mode 100644 index 0000000..584574e --- /dev/null +++ b/globals/mv-bg.js @@ -0,0 +1,10 @@ +if( window.innerWidth < 669 ){ + setTimeout(() => { + let mv_bg = document.createElement('div') + mv_bg.innerHTML = `
` + document.querySelector('body').appendChild(mv_bg) + let mv_bg_style = document.createElement('link') + mv_bg_style.innerHTML = `` + document.querySelector('head').appendChild(mv_bg_style) + }, 1) +} \ No newline at end of file