Skip to content

Commit

Permalink
feat: add mobile check
Browse files Browse the repository at this point in the history
  • Loading branch information
zyronon committed Apr 5, 2024
1 parent 945b463 commit ebd1c8c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ Vercel: [http://dy.ttentau.top/](http://dy.ttentau.top/) (中国推荐访问这

Netlify: [https://douyins.netlify.app/](https://douyins.netlify.app/) (中国以外地区推荐访问这个)

Android Apk: https://github.com/zyronon/douyin/releases

**注意**`PC` 必须将浏览器切到手机模式,先按 `F12` 调出控制台,再按 `Ctrl+Shift+M`才能正常预览

**注意**:手机请用 [Via 浏览器](https://viayoo.com/zh-cn/) 或 Chrome 浏览器预览。其它浏览器可能会强制将视频全屏,导致无法正常显示


## 免责声明

本项目仅适用于学习和研究,不得用于商业使用
Expand Down
46 changes: 46 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
</keep-alive>
</transition>
</router-view>
<div v-if="!isMobile" class="guide">
<Icon icon="mynaui:danger-triangle" />
<div class="txt">
<h2>切换至手机模式才可正常使用</h2>
<h3>1. 按 F12 调出控制台</h3>
<h3>2. 按 Ctrl+Shift+M,或点击下面图标</h3>
</div>
<img src="@/assets/img/guide.png" alt="" />
</div>
<Call />
</template>
<script>
Expand All @@ -17,9 +26,17 @@ import { mapActions, mapState } from 'pinia'
import routes from './router/routes'
import Call from './components/Call'
import { useBaseStore } from '@/store/pinia'
import { onMounted, ref } from 'vue'
export default {
name: 'App',
setup() {
const isMobile = ref(/Mobi|Android|iPhone/i.test(navigator.userAgent))
onMounted(() => {
console.log('asdf', isMobile.value)
})
return { isMobile }
},
components: {
Call
},
Expand Down Expand Up @@ -96,6 +113,35 @@ export default {
height: 100%;
width: 100%;
position: relative;
font-size: 14rem;
color: white;
}
.guide {
background: var(--active-main-bg);
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border-radius: 16rem;
overflow: hidden;
text-align: center;
svg {
margin-top: 10rem;
font-size: 40rem;
color: red;
}
.txt {
text-align: left;
padding: 0 24rem;
}
img {
display: block;
width: 350rem;
}
}
.go-enter-from {
Expand Down
Binary file added src/assets/img/guide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ebd1c8c

Please sign in to comment.