diff --git a/aa b/aa new file mode 100644 index 0000000..e69de29 diff --git a/energy-login/GifPlayer.js b/energy-login/GifPlayer.js new file mode 100644 index 0000000..710e495 --- /dev/null +++ b/energy-login/GifPlayer.js @@ -0,0 +1,89 @@ + +class GifPlayer { + + /** + * + * @param {*} template 图片模板路径:变量,{i} + * @param {*} num 图片的总数{i}=0~(num-1), 默认34 + * @param {*} canvas 画布 + * @param {*} radioRate 播放速率比,0=不播放 默认1 + */ + constructor(template, num, canvas, radioRate) { + this.load = false; + this.canvas = canvas; + this.radioRate = radioRate; + this.ctx = this.canvas.getContext('2d'); + // this.ctx.save(); + this.#init(template, num); + } + + async #init(template, num) { + this.imgs = await this.loadImgs(template, num); + this.canvas.dispatchEvent(new CustomEvent('loadend', { bubbles: false })) + this.load = true; + this.canvas.width = this.imgs[0].naturalWidth * window.devicePixelRatio; + this.canvas.height = this.imgs[0].naturalHeight * window.devicePixelRatio; + this.i = 0; + this.time = Date.now(); + this.playing = true; + this.ctx.drawImage(this.imgs[0], 0, 0, this.canvas.width, this.canvas.height); + this.#backgroudPlay(); + } + + /** + * 加载图片 + * @param {*} template 图片模板路径:变量,{i} + * @param {*} num 图片的总数{i}=0~(num-1), 默认34 + */ + loadImgs(template, num = 34) { + return new Promise((resolve, reject) => { + const imgs = []; + const ps = []; + for (let i = 0; i < num; i++) { + const img = new Image(); + img.src = template.replace('{i}', i); + imgs[i] = img; + ps.push(new Promise((resolve1, reject1) => { + img.onload = resolve1; + img.onerror = reject1; + })); + } + Promise.all(ps).then(() => { + resolve(imgs); + }).catch(err => { + reject(err); + }) + }) + } + + #backgroudPlay() { + if (this.radioRate === 0 || !this.playing) { + requestAnimationFrame(() => { this.#backgroudPlay() }); + return; + } + + let now = Date.now(); + if (now - this.time >= 50 / this.radioRate) { + this.time = now; + this.i++; + if (this.i >= this.imgs.length) { + this.i = 0; + this.canvas.dispatchEvent(new CustomEvent('loopend', { bubbles: false })) + } + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + // this.ctx.restore(); + this.ctx.drawImage(this.imgs[this.i], 0, 0, this.canvas.width, this.canvas.height); + } + requestAnimationFrame(() => { this.#backgroudPlay() }); + } + + start() { + this.playing = true; + } + + stop() { + this.playing = false; + } + +} +export { GifPlayer }; \ No newline at end of file diff --git a/energy-login/assets/login/energy-base.png b/energy-login/assets/login/energy-base.png new file mode 100644 index 0000000..e8f2d0e Binary files /dev/null and b/energy-login/assets/login/energy-base.png differ diff --git a/energy-login/assets/login/energy-body.png b/energy-login/assets/login/energy-body.png new file mode 100644 index 0000000..65c4b59 Binary files /dev/null and b/energy-login/assets/login/energy-body.png differ diff --git a/energy-login/assets/login/energy-input.png b/energy-login/assets/login/energy-input.png new file mode 100644 index 0000000..54f5023 Binary files /dev/null and b/energy-login/assets/login/energy-input.png differ diff --git a/energy-login/assets/login/energy-input2.png b/energy-login/assets/login/energy-input2.png new file mode 100644 index 0000000..9692f90 Binary files /dev/null and b/energy-login/assets/login/energy-input2.png differ diff --git a/energy-login/assets/login/gif/0.png b/energy-login/assets/login/gif/0.png new file mode 100644 index 0000000..f597a27 Binary files /dev/null and b/energy-login/assets/login/gif/0.png differ diff --git a/energy-login/assets/login/gif/1.png b/energy-login/assets/login/gif/1.png new file mode 100644 index 0000000..ae7e40e Binary files /dev/null and b/energy-login/assets/login/gif/1.png differ diff --git a/energy-login/assets/login/gif/10.png b/energy-login/assets/login/gif/10.png new file mode 100644 index 0000000..daacab6 Binary files /dev/null and b/energy-login/assets/login/gif/10.png differ diff --git a/energy-login/assets/login/gif/11.png b/energy-login/assets/login/gif/11.png new file mode 100644 index 0000000..ffb21c4 Binary files /dev/null and b/energy-login/assets/login/gif/11.png differ diff --git a/energy-login/assets/login/gif/12.png b/energy-login/assets/login/gif/12.png new file mode 100644 index 0000000..920562c Binary files /dev/null and b/energy-login/assets/login/gif/12.png differ diff --git a/energy-login/assets/login/gif/13.png b/energy-login/assets/login/gif/13.png new file mode 100644 index 0000000..05836f9 Binary files /dev/null and b/energy-login/assets/login/gif/13.png differ diff --git a/energy-login/assets/login/gif/14.png b/energy-login/assets/login/gif/14.png new file mode 100644 index 0000000..04fe32d Binary files /dev/null and b/energy-login/assets/login/gif/14.png differ diff --git a/energy-login/assets/login/gif/15.png b/energy-login/assets/login/gif/15.png new file mode 100644 index 0000000..bfd4e53 Binary files /dev/null and b/energy-login/assets/login/gif/15.png differ diff --git a/energy-login/assets/login/gif/16.png b/energy-login/assets/login/gif/16.png new file mode 100644 index 0000000..7c8f465 Binary files /dev/null and b/energy-login/assets/login/gif/16.png differ diff --git a/energy-login/assets/login/gif/17.png b/energy-login/assets/login/gif/17.png new file mode 100644 index 0000000..7f14f98 Binary files /dev/null and b/energy-login/assets/login/gif/17.png differ diff --git a/energy-login/assets/login/gif/18.png b/energy-login/assets/login/gif/18.png new file mode 100644 index 0000000..c37d5fd Binary files /dev/null and b/energy-login/assets/login/gif/18.png differ diff --git a/energy-login/assets/login/gif/2.png b/energy-login/assets/login/gif/2.png new file mode 100644 index 0000000..8e27670 Binary files /dev/null and b/energy-login/assets/login/gif/2.png differ diff --git a/energy-login/assets/login/gif/3.png b/energy-login/assets/login/gif/3.png new file mode 100644 index 0000000..d2593b8 Binary files /dev/null and b/energy-login/assets/login/gif/3.png differ diff --git a/energy-login/assets/login/gif/4.png b/energy-login/assets/login/gif/4.png new file mode 100644 index 0000000..61c7feb Binary files /dev/null and b/energy-login/assets/login/gif/4.png differ diff --git a/energy-login/assets/login/gif/5.png b/energy-login/assets/login/gif/5.png new file mode 100644 index 0000000..4979aaf Binary files /dev/null and b/energy-login/assets/login/gif/5.png differ diff --git a/energy-login/assets/login/gif/6.png b/energy-login/assets/login/gif/6.png new file mode 100644 index 0000000..7e2e4b9 Binary files /dev/null and b/energy-login/assets/login/gif/6.png differ diff --git a/energy-login/assets/login/gif/7.png b/energy-login/assets/login/gif/7.png new file mode 100644 index 0000000..cb44a35 Binary files /dev/null and b/energy-login/assets/login/gif/7.png differ diff --git a/energy-login/assets/login/gif/8.png b/energy-login/assets/login/gif/8.png new file mode 100644 index 0000000..e83ef3a Binary files /dev/null and b/energy-login/assets/login/gif/8.png differ diff --git a/energy-login/assets/login/gif/9.png b/energy-login/assets/login/gif/9.png new file mode 100644 index 0000000..1f5837a Binary files /dev/null and b/energy-login/assets/login/gif/9.png differ diff --git a/energy-login/assets/login/login.css b/energy-login/assets/login/login.css new file mode 100644 index 0000000..bf1de13 --- /dev/null +++ b/energy-login/assets/login/login.css @@ -0,0 +1,271 @@ +.login { + position: relative; + width: 100vw; + height: 100vh; + --w-bg: #c9dcf6; + --w-bg-1: #00000004; + overflow: hidden; + + * { + box-sizing: border-box; + border: none; + padding: 0; + margin: 0; + outline: none; + background-color: #0000; + } + + &>div { + position: absolute; + inset: 0; + display: flex; + justify-content: center; + align-items: center; + } + + .login-bg { + background-color: var(--w-bg); + background-image: repeating-linear-gradient(45deg, #0000 0, #0000 .3em, var(--w-bg-1) .6em, #0000 1em, #0000 1.2em), + repeating-linear-gradient(-45deg, #0000 0, #0000 .3em, var(--w-bg-1) .6em, #0000 1em, #0000 1.2em); + + filter: url(#bgFilter); + transform: scale(2); + } + + .login-layout { + + + &>div { + width: 50em; + height: 50em; + position: relative; + display: flex; + justify-content: center; + align-items: center; + + .energy-base { + position: absolute; + inset: 0; + background-image: url(./energy-base.png); + background-repeat: no-repeat; + background-position: 1em 20em; + background-size: calc(713em / 20) auto; + /* filter: brightness(190%); */ + animation: am-login-doing 1.7s infinite alternate-reverse; + } + + .energy-body { + position: absolute; + inset: 0; + background-image: url(./energy-body.png); + background-repeat: no-repeat; + background-position: 7em 5em; + background-size: calc(495em / 20) auto; + } + + .login-frame { + width: 30em; + /* min-height: 30em; */ + background-color: #FFF; + border-radius: 1em; + box-shadow: 0 0 1em rgba(0, 0, 0, 0.1); + padding: 3em; + + h1 { + font-size: 1.7em; + } + } + + + } + } + + .canvas { + width: 10em; + position: absolute; + transform: scaleX(-1); + } + + .login-input { + display: flex; + border-bottom: solid 1px #0002; + align-items: center; + padding: 2em .5em .3em; + width: 100%; + box-sizing: border-box; + transition: all .3s ease-in-out; + + svg { + width: 1.5em; + height: 1.5em; + margin-right: 1em; + + + path { + fill: #0003; + transition: all .3s ease-in-out; + } + } + + &>* { + flex-grow: 0; + flex-shrink: 0; + } + + input { + flex-grow: 1; + flex-shrink: 1; + font-size: 1.1em; + padding: .5em 0em; + color: #0005; + transition: all .3s ease-in-out; + + &::placeholder { + color: #0005; + } + } + + img { + width: 5em; + height: 2em; + cursor: pointer; + } + + &:has(input:focus) { + border-bottom: solid 1px #0004; + + input{ + color: #0009; + } + + path { + fill: #0007; + } + } + } + + .reme { + display: flex; + align-items: center; + margin: .6em 1em; + color: #0008; + + input { + margin-right: .5em; + transform: translateY(.11em) scale(1.3); + } + } + + .login-btn { + user-select: none; + margin-top: 2em; + height: 2.3em; + position: relative; + background-color: #1163fd; + color: #FFF; + font-size: 1.1em; + font-weight: normal; + letter-spacing: 2em; + text-indent: 2em; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + border-radius: .3em; + width: 100%; + transition: all .3s ease-in-out; + cursor: pointer; + + &:not(.loading) { + &:hover { + filter: brightness(120%); + } + + &:active { + filter: brightness(80%); + } + } + + &.loading { + pointer-events: none; + + + &::before { + content: ''; + position: absolute; + inset: 0; + background-color: #0003; + backdrop-filter: blur(.1em); + } + + &::after { + position: absolute; + content: ''; + width: 1em; + height: 1em; + border-radius: 1em; + border: solid .2em #fff; + mask-image: conic-gradient(from 0deg,#0000 0%,#000 75%,#000 83%,#0000 85%); + animation: am-login-loading 1s ease infinite; + } + } + + + + } + +} + +@keyframes am-login-loading { + 0% { + + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + + +@keyframes am-login-doing { + 0% { + + filter: brightness(100%); + } + + 20% { + filter: brightness(110%); + } + + 40% { + + filter: brightness(100%); + } +} + +@property --noise-base { + syntax: ''; + inherits: true; + initial-value: 0; +} + +.noise { + filter: url(#noiseFilter); + --noise-base: 0; + animation: am-noise 5.1s linear infinite; +} + +@keyframes am-noise { + 0% { + --noise-base: 0; + } + + 10% { + --noise-base: 0.1; + } + + 20% { + --noise-base: 0; + } +} \ No newline at end of file diff --git a/energy-login/login.html b/energy-login/login.html new file mode 100644 index 0000000..de5e3b9 --- /dev/null +++ b/energy-login/login.html @@ -0,0 +1,189 @@ + + + + + + + Document + + + + + +
+ + + + + + +
+ + + + \ No newline at end of file diff --git a/energy-login/login.js b/energy-login/login.js new file mode 100644 index 0000000..caf8793 --- /dev/null +++ b/energy-login/login.js @@ -0,0 +1,22 @@ +import { GifPlayer } from './GifPlayer.js'; +window.onload = () => { + + const noise = document.querySelector('.noise'); + const noiseStyle = getComputedStyle(noise); + const noiseFilter = document.querySelector('#noiseFilter').firstElementChild; + + const noisePlayer = () => { + let base = noiseStyle.getPropertyValue('--noise-base'); + noiseFilter.setAttribute('baseFrequency', `0 ${base}`); + requestAnimationFrame(noisePlayer) + } + noisePlayer(); + + let speed = [.75,.5,.35] + + document.querySelectorAll("canvas.canvas").forEach((canvas,i) => { + console.debug(i) + new GifPlayer('./assets/login/gif/{i}.png', 19, canvas, speed[i]); + }) + +} \ No newline at end of file diff --git a/gif/gif/0.png b/gif/gif/0.png new file mode 100644 index 0000000..359a547 Binary files /dev/null and b/gif/gif/0.png differ diff --git a/gif/gif/1.png b/gif/gif/1.png new file mode 100644 index 0000000..df1065d Binary files /dev/null and b/gif/gif/1.png differ diff --git a/gif/gif/10.png b/gif/gif/10.png new file mode 100644 index 0000000..408b327 Binary files /dev/null and b/gif/gif/10.png differ diff --git a/gif/gif/11.png b/gif/gif/11.png new file mode 100644 index 0000000..054ab69 Binary files /dev/null and b/gif/gif/11.png differ diff --git a/gif/gif/12.png b/gif/gif/12.png new file mode 100644 index 0000000..928ffdd Binary files /dev/null and b/gif/gif/12.png differ diff --git a/gif/gif/13.png b/gif/gif/13.png new file mode 100644 index 0000000..1304a5f Binary files /dev/null and b/gif/gif/13.png differ diff --git a/gif/gif/14.png b/gif/gif/14.png new file mode 100644 index 0000000..5a89a6b Binary files /dev/null and b/gif/gif/14.png differ diff --git a/gif/gif/15.png b/gif/gif/15.png new file mode 100644 index 0000000..85a137d Binary files /dev/null and b/gif/gif/15.png differ diff --git a/gif/gif/16.png b/gif/gif/16.png new file mode 100644 index 0000000..5f0f589 Binary files /dev/null and b/gif/gif/16.png differ diff --git a/gif/gif/17.png b/gif/gif/17.png new file mode 100644 index 0000000..15cdc45 Binary files /dev/null and b/gif/gif/17.png differ diff --git a/gif/gif/18.png b/gif/gif/18.png new file mode 100644 index 0000000..b3bd2a5 Binary files /dev/null and b/gif/gif/18.png differ diff --git a/gif/gif/19.png b/gif/gif/19.png new file mode 100644 index 0000000..90e34e6 Binary files /dev/null and b/gif/gif/19.png differ diff --git a/gif/gif/2.png b/gif/gif/2.png new file mode 100644 index 0000000..6d22d71 Binary files /dev/null and b/gif/gif/2.png differ diff --git a/gif/gif/20.png b/gif/gif/20.png new file mode 100644 index 0000000..57f8886 Binary files /dev/null and b/gif/gif/20.png differ diff --git a/gif/gif/21.png b/gif/gif/21.png new file mode 100644 index 0000000..90c5ce7 Binary files /dev/null and b/gif/gif/21.png differ diff --git a/gif/gif/22.png b/gif/gif/22.png new file mode 100644 index 0000000..b97deb8 Binary files /dev/null and b/gif/gif/22.png differ diff --git a/gif/gif/23.png b/gif/gif/23.png new file mode 100644 index 0000000..8c60558 Binary files /dev/null and b/gif/gif/23.png differ diff --git a/gif/gif/24.png b/gif/gif/24.png new file mode 100644 index 0000000..90a46f9 Binary files /dev/null and b/gif/gif/24.png differ diff --git a/gif/gif/25.png b/gif/gif/25.png new file mode 100644 index 0000000..39d166f Binary files /dev/null and b/gif/gif/25.png differ diff --git a/gif/gif/26.png b/gif/gif/26.png new file mode 100644 index 0000000..00176e0 Binary files /dev/null and b/gif/gif/26.png differ diff --git a/gif/gif/27.png b/gif/gif/27.png new file mode 100644 index 0000000..cd906c9 Binary files /dev/null and b/gif/gif/27.png differ diff --git a/gif/gif/28.png b/gif/gif/28.png new file mode 100644 index 0000000..9d67563 Binary files /dev/null and b/gif/gif/28.png differ diff --git a/gif/gif/29.png b/gif/gif/29.png new file mode 100644 index 0000000..1c6f001 Binary files /dev/null and b/gif/gif/29.png differ diff --git a/gif/gif/3.png b/gif/gif/3.png new file mode 100644 index 0000000..13b55f4 Binary files /dev/null and b/gif/gif/3.png differ diff --git a/gif/gif/30.png b/gif/gif/30.png new file mode 100644 index 0000000..872a7ca Binary files /dev/null and b/gif/gif/30.png differ diff --git a/gif/gif/31.png b/gif/gif/31.png new file mode 100644 index 0000000..3627c38 Binary files /dev/null and b/gif/gif/31.png differ diff --git a/gif/gif/32.png b/gif/gif/32.png new file mode 100644 index 0000000..21fbc89 Binary files /dev/null and b/gif/gif/32.png differ diff --git a/gif/gif/33.png b/gif/gif/33.png new file mode 100644 index 0000000..2b0dfa5 Binary files /dev/null and b/gif/gif/33.png differ diff --git a/gif/gif/4.png b/gif/gif/4.png new file mode 100644 index 0000000..0281410 Binary files /dev/null and b/gif/gif/4.png differ diff --git a/gif/gif/5.png b/gif/gif/5.png new file mode 100644 index 0000000..ea37309 Binary files /dev/null and b/gif/gif/5.png differ diff --git a/gif/gif/6.png b/gif/gif/6.png new file mode 100644 index 0000000..04c1cb1 Binary files /dev/null and b/gif/gif/6.png differ diff --git a/gif/gif/7.png b/gif/gif/7.png new file mode 100644 index 0000000..cf709ac Binary files /dev/null and b/gif/gif/7.png differ diff --git a/gif/gif/8.png b/gif/gif/8.png new file mode 100644 index 0000000..7135cdf Binary files /dev/null and b/gif/gif/8.png differ diff --git a/gif/gif/9.png b/gif/gif/9.png new file mode 100644 index 0000000..ccd5fdc Binary files /dev/null and b/gif/gif/9.png differ diff --git a/gif/index.html b/gif/index.html new file mode 100644 index 0000000..047bb68 --- /dev/null +++ b/gif/index.html @@ -0,0 +1,116 @@ + + + + + + + Document + + + +
+ +
+ + + + +
+ +
+ + + + \ No newline at end of file diff --git a/故障波纹/index.html b/故障波纹/index.html new file mode 100644 index 0000000..dda1fb4 --- /dev/null +++ b/故障波纹/index.html @@ -0,0 +1,56 @@ + + + + + + + Document + + + + + + + + + + + + + + + + + \ No newline at end of file