first commit
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="preview-container">
|
||||
<div class="text-center mb-2">
|
||||
<h2>{{ title || "文档预览" }}</h2>
|
||||
<p style="color: var(--text-muted); margin-top: 0.5rem;">当前展示前 2 页。</p>
|
||||
</div>
|
||||
|
||||
<!-- The PDF Viewer for the first two pages -->
|
||||
<div class="pdf-render-wrapper">
|
||||
<VuePdfEmbed
|
||||
v-if="url"
|
||||
:source="url"
|
||||
class="pdf-viewer"
|
||||
@rendered="onRendered"
|
||||
/>
|
||||
<div v-if="!rendered" class="loading-state text-center" style="padding: 3rem;">
|
||||
正在安全地解析文档...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- The Blurred Placeholder (Only shown after PDF renders) -->
|
||||
<div v-if="rendered" class="blur-placeholder pointer" @click="showModal = true">
|
||||
<div class="blur-content text-center">
|
||||
<h3 style="font-size: 1.8rem; margin-bottom: 0.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.8);">完整文档已被锁定</h3>
|
||||
<p style="text-shadow: 0 1px 5px rgba(0,0,0,0.8); margin-bottom: 1.5rem;">请联系我们获取完整文档。</p>
|
||||
<button class="btn btn-accent" style="font-size: 1.1rem; padding: 1rem 2rem;">立即联系我们</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal with Iframe -->
|
||||
<div v-if="showModal" class="modal-overlay" @click.self="showModal = false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<span class="modal-title">获取完整文档</span>
|
||||
<button class="modal-close" @click="showModal = false">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<iframe
|
||||
src="https://www.beiyuxing.live/form-only/"
|
||||
class="modal-iframe"
|
||||
title="联系表单"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import VuePdfEmbed from 'vue-pdf-embed';
|
||||
|
||||
const props = defineProps({
|
||||
url: String,
|
||||
title: String
|
||||
});
|
||||
|
||||
const showModal = ref(false);
|
||||
const rendered = ref(false);
|
||||
|
||||
const onRendered = () => {
|
||||
rendered.value = true;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.preview-container {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.pdf-render-wrapper {
|
||||
background: white; /* PDF viewer should have a white background so text is readable */
|
||||
border-radius: 8px 8px 0 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.pdf-viewer {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Forcing canvas elements to look nice */
|
||||
:deep(.vue-pdf-embed canvas) {
|
||||
margin-bottom: 10px;
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.blur-placeholder {
|
||||
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(15,23,42,0.8) 100%);
|
||||
position: relative;
|
||||
height: 400px;
|
||||
border-radius: 0 0 16px 16px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
||||
margin-top: -20px; /* pull up slightly to overlap with the pdf */
|
||||
z-index: 10;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.blur-placeholder::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
background-image:
|
||||
repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(0,0,0,0.05) 20px, rgba(0,0,0,0.05) 40px),
|
||||
repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0,0,0,0.05) 20px, rgba(0,0,0,0.05) 40px);
|
||||
backdrop-filter: blur(8px);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.blur-placeholder:hover {
|
||||
transform: translateY(5px);
|
||||
}
|
||||
|
||||
.blur-content {
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,93 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import viteLogo from '../assets/vite.svg'
|
||||
import heroImg from '../assets/hero.png'
|
||||
import vueLogo from '../assets/vue.svg'
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section id="center">
|
||||
<div class="hero">
|
||||
<img :src="heroImg" class="base" width="170" height="179" alt="" />
|
||||
<img :src="vueLogo" class="framework" alt="Vue logo" />
|
||||
<img :src="viteLogo" class="vite" alt="Vite logo" />
|
||||
</div>
|
||||
<div>
|
||||
<h1>Get started</h1>
|
||||
<p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p>
|
||||
</div>
|
||||
<button class="counter" @click="count++">Count is {{ count }}</button>
|
||||
</section>
|
||||
|
||||
<div class="ticks"></div>
|
||||
|
||||
<section id="next-steps">
|
||||
<div id="docs">
|
||||
<svg class="icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#documentation-icon"></use>
|
||||
</svg>
|
||||
<h2>Documentation</h2>
|
||||
<p>Your questions, answered</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://vite.dev/" target="_blank">
|
||||
<img class="logo" :src="viteLogo" alt="" />
|
||||
Explore Vite
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://vuejs.org/" target="_blank">
|
||||
<img class="button-icon" :src="vueLogo" alt="" />
|
||||
Learn more
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="social">
|
||||
<svg class="icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#social-icon"></use>
|
||||
</svg>
|
||||
<h2>Connect with us</h2>
|
||||
<p>Join the Vite community</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/vitejs/vite" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#github-icon"></use>
|
||||
</svg>
|
||||
GitHub
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://chat.vite.dev/" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#discord-icon"></use>
|
||||
</svg>
|
||||
Discord
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://x.com/vite_js" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#x-icon"></use>
|
||||
</svg>
|
||||
X.com
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://bsky.app/profile/vite.dev" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#bluesky-icon"></use>
|
||||
</svg>
|
||||
Bluesky
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="ticks"></div>
|
||||
<section id="spacer"></section>
|
||||
</template>
|
||||
Reference in New Issue
Block a user