|
@@ -0,0 +1,146 @@
|
|
|
+<template>
|
|
|
+ <Teleport to="body">
|
|
|
+ <ul class="nav">
|
|
|
+ <li data-menuanchor="section1" class="active" @click="handleSlideTo(1)">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <h3>首页</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li data-menuanchor="section3" @click="handleSlideTo(3)">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <h3>开篇</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ <li @click="handleSlideTo(4)">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <p>第一章</p>
|
|
|
+ <h3>玉生华夏</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ <li @click="handleSlideTo(22)">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <p>第二章</p>
|
|
|
+ <h3>玉成中国</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ <li num="42">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <p>第三章</p>
|
|
|
+ <h3>玉美神州</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+
|
|
|
+ <li num="53">
|
|
|
+ <i></i>
|
|
|
+ <div class="title">
|
|
|
+ <h3>尾篇</h3>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </Teleport>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import { computed, onMounted, watch, watchEffect } from "vue";
|
|
|
+const props = defineProps({
|
|
|
+ fullpage: Object,
|
|
|
+});
|
|
|
+const current = computed(() => props.fullpage.api.tActiveSection());
|
|
|
+defineOptions({
|
|
|
+ name: "nav-guide",
|
|
|
+});
|
|
|
+onMounted(() => {
|
|
|
+ watchEffect(() => {
|
|
|
+ if (props.fullpage) {
|
|
|
+ console.log("props.fullpage", props.fullpage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+});
|
|
|
+
|
|
|
+const handleSlideTo = (index) => {
|
|
|
+ if (props.fullpage) {
|
|
|
+ console.log("index", index);
|
|
|
+ props.fullpage.api.moveTo(index);
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+.nav {
|
|
|
+ position: fixed;
|
|
|
+ left: 1rem;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ display: block;
|
|
|
+ // z-index: 1000;
|
|
|
+ li {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-bottom: 10vh;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ width: 1px;
|
|
|
+ top: 0.5rem;
|
|
|
+ height: 13vh;
|
|
|
+ background-color: #7b6f54;
|
|
|
+ }
|
|
|
+ i {
|
|
|
+ position: relative;
|
|
|
+ width: 1.25rem;
|
|
|
+ height: 1.25rem;
|
|
|
+ z-index: 1;
|
|
|
+ cursor: pointer;
|
|
|
+ &::after {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ width: 0.75rem;
|
|
|
+ height: 0.75rem;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #423c2e;
|
|
|
+ border: 1px solid #7b6f54;
|
|
|
+ box-sizing: border-box;
|
|
|
+ box-shadow: 0 0 0px 2px #000;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ transition: all 0.6s;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ position: absolute;
|
|
|
+ color: #d09d68;
|
|
|
+ opacity: 0;
|
|
|
+ visibility: hidden;
|
|
|
+ left: 0;
|
|
|
+ padding-left: 1rem;
|
|
|
+ width: 8em;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ transition: all 0.6s;
|
|
|
+ h3 {
|
|
|
+ font-family: "syst-bold";
|
|
|
+ font-size: 1.25rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover,
|
|
|
+ &.active {
|
|
|
+ .title {
|
|
|
+ opacity: 1;
|
|
|
+ visibility: visible;
|
|
|
+ padding-left: 2rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|