|
|
@@ -1,22 +1,116 @@
|
|
|
<template>
|
|
|
<v-app>
|
|
|
<v-main>
|
|
|
- <div style="margin: 0 auto;height: 60px;width: auto;text-align: center">
|
|
|
- <router-link to="Info">跳转Info</router-link>
|
|
|
- <br>
|
|
|
- <router-link to="/">跳转Home</router-link>
|
|
|
- </div>
|
|
|
<router-view/>
|
|
|
</v-main>
|
|
|
</v-app>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import {ref} from "vue";
|
|
|
|
|
|
-let isHome = ref(true)
|
|
|
-function toHome() {
|
|
|
- isHome.value = !isHome.value
|
|
|
- return isHome?'':'Info'
|
|
|
+var elementsByTagName = document.getElementsByTagName('body')[0]
|
|
|
+
|
|
|
+elementsByTagName.addEventListener('click', function (e) {
|
|
|
+ clickEffect(e)
|
|
|
+})
|
|
|
+
|
|
|
+function clickEffect(e) {
|
|
|
+ let x = e.clientX
|
|
|
+ let y = e.clientY
|
|
|
+ for (let i = 0; i < 5; i++) {
|
|
|
+ spanEffect(x, y, 100 * i + 1, 1500)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+let si = setInterval(function () {
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ spanEffect(Math.random() * window.innerWidth, Math.random() * window.innerHeight, 0, 1500)
|
|
|
+ }
|
|
|
+}, 100)
|
|
|
+
|
|
|
+
|
|
|
+function createSpanElement(x: number, y: number, text: string, textColor = '') {
|
|
|
+ let span = document.createElement('span')
|
|
|
+ span.style.left = x + 'px'
|
|
|
+ span.style.top = y + 'px'
|
|
|
+ span.textContent = text
|
|
|
+ if (textColor != '') {
|
|
|
+ span.style.color = textColor
|
|
|
+ }
|
|
|
+ span.classList.add('click-on-effects-span')
|
|
|
+ return span
|
|
|
+}
|
|
|
+
|
|
|
+function createShadowElement(x, y) {
|
|
|
+ let div = document.createElement('div')
|
|
|
+ div.style.width = '20px'
|
|
|
+ div.style.height = '20px'
|
|
|
+ div.style.left = (x - 10) + 'px'
|
|
|
+ div.style.top = (y - 10) + 'px'
|
|
|
+ div.style.boxShadow = 'rgba(0, 0, 0, 0.5) 0 0 5px,inset rgba(0, 0, 0, 0.5) 0 0 5px'
|
|
|
+ div.classList.add('click-on-effects-div')
|
|
|
+ return div
|
|
|
+}
|
|
|
+
|
|
|
+function shadowEffect(x, y, startTime, endTime) {
|
|
|
+ let div = createShadowElement(x, y)
|
|
|
+ elementsByTagName.appendChild(div)
|
|
|
+ setTimeout(function () {
|
|
|
+ div.style.width = '75px'
|
|
|
+ div.style.height = '75px'
|
|
|
+ div.style.left = (x - (75 / 2)) + 'px'
|
|
|
+ div.style.top = (y - (75 / 2)) + 'px'
|
|
|
+ div.style.color = "transparent"
|
|
|
+ div.style.boxShadow = 'rgba(0, 0, 0, 0.1) 0 0 5px,inset rgba(0, 0, 0, 0.1) 0 0 5px'
|
|
|
+ }, startTime)
|
|
|
+ setTimeout(function () {
|
|
|
+ elementsByTagName.removeChild(div)
|
|
|
+ }, endTime)
|
|
|
}
|
|
|
+
|
|
|
+function spanEffect(x, y, startTime, endTime) {
|
|
|
+ //随机数
|
|
|
+ let r = Math.floor(Math.random() * 255)
|
|
|
+ let g = Math.floor(Math.random() * 255)
|
|
|
+ let b = Math.floor(Math.random() * 255)
|
|
|
+ let span = createSpanElement(x, y, '智商 -1', 'rgba(' + r + ',' + g + ',' + b + ', 0.5)')
|
|
|
+
|
|
|
+ elementsByTagName.appendChild(span)
|
|
|
+ setTimeout(function () {
|
|
|
+ span.style.top = (y - 75) + 'px'
|
|
|
+ span.style.color = "transparent"
|
|
|
+ }, startTime)
|
|
|
+ setTimeout(function () {
|
|
|
+ elementsByTagName.removeChild(span)
|
|
|
+ }, endTime)
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
+<style lang="scss">
|
|
|
+.click-on-effects-span {
|
|
|
+ display: flex;
|
|
|
+ position: fixed;
|
|
|
+ white-space: nowrap;
|
|
|
+ //position: absolute;
|
|
|
+ border-radius: 50%;
|
|
|
+ color: rgba(0, 0, 0, 0.5);
|
|
|
+ background-color: transparent;
|
|
|
+ z-index: 9999;
|
|
|
+ user-select: none;
|
|
|
+ transition: top 1s ease-in-out, color 1s ease-in-out;
|
|
|
+ transform: translate(-50%, -75%);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.click-on-effects-div {
|
|
|
+ position: fixed;
|
|
|
+ color: transparent;
|
|
|
+ background-color: transparent;
|
|
|
+ transition: all 0.3s ease-in-out;
|
|
|
+ border-radius: 50px;
|
|
|
+ box-shadow: rgba(0, 0, 0, 0.7) 0 0 5px, inset rgba(0, 0, 0, 0.7) 0 0 5px;
|
|
|
+ z-index: 9999;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style scoped lang="scss">
|
|
|
+</style>
|