init project

master
fuxiaochun 2023-08-10 20:28:28 +08:00
parent aa8c4990c0
commit e9a9cbb57c
7 changed files with 13 additions and 21 deletions

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!-- 临时写死暗黑模式 -->
<html lang="zh-cn" data-theme="dark" class="dark">
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
<title>aigc</title>
</head>
<body>

View File

@ -17,6 +17,7 @@
"lodash-es": "^4.17.21",
"markdown-it": "^13.0.1",
"markdown-it-link-attributes": "^4.0.1",
"md5": "^2.3.0",
"pinia": "^2.1.3",
"resize-observer-polyfill": "^1.5.1",
"swiper": "^10.1.0",

View File

@ -1,21 +1,6 @@
<script setup>
import { RouterView } from 'vue-router'
import { onMounted } from 'vue'
onMounted(() => {
getRem(750, 16)
window.onload = function () {
getRem(750, 16)
}
window.onresize = function () {
getRem(750, 16)
}
})
const getRem = (pwidth, prem) => {
let html = document.documentElement
let oWidth = window.outerWidth ? window.outerWidth : screen.width
html.style.fontSize = (oWidth / pwidth) * prem + 'px'
}
</script>
<template>

View File

@ -0,0 +1 @@
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="JNCC")}({JNCC:function(e,t){!function(e,t){var r,n=e.document,i=n.documentElement,o=n.querySelector('meta[name="viewport"]'),a=n.querySelector('meta[name="flexible"]'),l=0,u=0,d=t.flexible||(t.flexible={});if(o){var c=o.getAttribute("content").match(/initial\-scale=([\d\.]+)/);c&&(u=parseFloat(c[1]),l=parseInt(1/u))}else if(a){var s=a.getAttribute("content");if(s){var p=s.match(/initial\-dpr=([\d\.]+)/),f=s.match(/maximum\-dpr=([\d\.]+)/);p&&(l=parseFloat(p[1]),u=parseFloat((1/l).toFixed(2))),f&&(l=parseFloat(f[1]),u=parseFloat((1/l).toFixed(2)))}}if(!l&&!u){e.navigator.appVersion.match(/android/gi);var m=e.navigator.appVersion.match(/iphone/gi),b=e.devicePixelRatio;u=1/(l=m?b>=3&&(!l||l>=3)?3:b>=2&&(!l||l>=2)?2:1:1)}if(i.setAttribute("data-dpr",l),!o)if((o=n.createElement("meta")).setAttribute("name","viewport"),o.setAttribute("content","initial-scale="+u+", maximum-scale="+u+", minimum-scale="+u+", user-scalable=no"),i.firstElementChild)i.firstElementChild.appendChild(o);else{var v=n.createElement("div");v.appendChild(o),n.write(v.innerHTML)}function y(){var t,r=window.screen.width,n=window.screen.height;r<=n?(r/l>750&&(r*=l),t=r/7.5):(n/l>750&&(n*=l),t=n/7.5),i.style.fontSize=t+"px",d.rem=e.rem=t}e.addEventListener("resize",(function(){clearTimeout(r),r=setTimeout(y,300)}),!1),e.addEventListener("pageshow",(function(e){e.persisted&&(clearTimeout(r),r=setTimeout(y,300))}),!1),"complete"===n.readyState?n.body.style.fontSize=16*l+"px":n.addEventListener("DOMContentLoaded",(function(e){n.body.style.fontSize=16*l+"px"}),!1),y(),d.dpr=e.dpr=l,d.refreshRem=y,d.rem2px=function(e){var t=parseFloat(e)*this.rem;return"string"==typeof e&&e.match(/rem$/)&&(t+="px"),t},d.px2rem=function(e){var t=parseFloat(e)/this.rem;return"string"==typeof e&&e.match(/px$/)&&(t+="rem"),t}}(window,window.lib||(window.lib={}))}});

View File

@ -1,6 +1,7 @@
import "./assets/css/main.css";
import 'virtual:svg-icons-register';
import 'virtual:windi.css'
import './assets/js/rem';
import { createApp } from "vue";
import { createPinia } from "pinia";

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="page">
移动端
</div>
</template>
@ -15,5 +15,10 @@ onMounted(()=>{
</script>
<style lang="scss" scoped>
.page{
width: 7.5rem;
height: 1rem;
background: #CCC;
font-size: .22rem;
}
</style>

View File

@ -44,7 +44,7 @@ export default defineConfig({
}
},
server: {
host: 'localhost',
host: '0.0.0.0',
port: '8080',
open: false,
proxy: {