-
-
-
-
-
-
+
+
+
+
@@ -17,11 +14,10 @@ import BigHeader from "../components/layout/Header.vue";
import Main from "../components/layout/Main.vue";
import LeftSide from "./LeftSide.vue";
import RightSide from "./RightSide.vue";
-import Slider from "../utils/slider.vue";
export default {
name: "HomeView",
- components: { BigHeader, Main, LeftSide, RightSide, Slider },
+ components: { BigHeader, Main, LeftSide, RightSide },
props: {},
data() {
return {
@@ -37,17 +33,47 @@ export default {
};
},
},
+ mounted() {
+ const slider = document.createElement('div')
+ slider.id = 'slider'
+ slider.classList.add('slider')
+ const ranger = document.createElement('input')
+ ranger.type = 'range'
+ ranger.value = 100
+ ranger.addEventListener('input', this.handleSlide)
+ slider.appendChild(ranger)
+ document.body.appendChild(slider)
+
+ // this.$watch('value', val => {
+ // ranger.value = val
+ // })
+
+ document.addEventListener("keydown", (e) => {
+ if (e.shiftKey && e.key === "L") {
+ document.getElementById("slider").classList.toggle("show");
+ }
+ });
+ document.getElementById("slider").addEventListener("mouseleave", () => {
+ setTimeout(() => {
+ document.getElementById("slider").classList.remove("show");
+ }, 200);
+ });
+ },
+ methods: {
+ handleSlide(e) {
+ this.value = e.target.value
+ window.scroll(0, 0)
+ },
+ },
};
-