diff --git a/src/api/Axios.js b/src/api/Axios.js index d7617b3..22243e4 100644 --- a/src/api/Axios.js +++ b/src/api/Axios.js @@ -26,8 +26,8 @@ service.interceptors.response.use( (response) => { return response.data || {}; }, (error) => { - Toast('网络繁忙') - console.log('请求错误:', error.message); + // Toast('网络繁忙') + // console.log('请求错误:', error.message); return Promise.reject(error); }); diff --git a/src/api/index.js b/src/api/index.js index 65088de..7f9054a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -35,7 +35,7 @@ export function subAnswer(data, authorization) { } // 抽奖 -export function draw(data, authorization) { +export function drawApi(data, authorization) { return http.post("/h5/activity/draw", data, true, diff --git a/src/assets/font/HYYakuHei-85W.ttf b/src/assets/font/HYYakuHei-85W.ttf new file mode 100644 index 0000000..0bb162c Binary files /dev/null and b/src/assets/font/HYYakuHei-85W.ttf differ diff --git a/src/assets/font/fzcy.ttf b/src/assets/font/fzcy.ttf new file mode 100644 index 0000000..dbabeed Binary files /dev/null and b/src/assets/font/fzcy.ttf differ diff --git a/src/assets/font/fzzy.ttf b/src/assets/font/fzzy.ttf new file mode 100644 index 0000000..f03a55a Binary files /dev/null and b/src/assets/font/fzzy.ttf differ diff --git a/src/assets/images/result/bg-1.jpg b/src/assets/images/result/bg-1.jpg index 0b3e116..1d3198e 100644 Binary files a/src/assets/images/result/bg-1.jpg and b/src/assets/images/result/bg-1.jpg differ diff --git a/src/assets/images/result/bg-2.jpg b/src/assets/images/result/bg-2.jpg index 6934554..6079681 100644 Binary files a/src/assets/images/result/bg-2.jpg and b/src/assets/images/result/bg-2.jpg differ diff --git a/src/assets/images/result/bg-3.jpg b/src/assets/images/result/bg-3.jpg index bba7017..4d13f25 100644 Binary files a/src/assets/images/result/bg-3.jpg and b/src/assets/images/result/bg-3.jpg differ diff --git a/src/assets/images/result/bg-4.jpg b/src/assets/images/result/bg-4.jpg index bba7017..081f270 100644 Binary files a/src/assets/images/result/bg-4.jpg and b/src/assets/images/result/bg-4.jpg differ diff --git a/src/assets/images/result/cls-btn.png b/src/assets/images/result/cls-btn.png new file mode 100644 index 0000000..e478b09 Binary files /dev/null and b/src/assets/images/result/cls-btn.png differ diff --git a/src/assets/images/result/create-btn.png b/src/assets/images/result/create-btn.png new file mode 100644 index 0000000..7fbcd7a Binary files /dev/null and b/src/assets/images/result/create-btn.png differ diff --git a/src/assets/images/result/go-draw-btn.png b/src/assets/images/result/go-draw-btn.png new file mode 100644 index 0000000..67fd45d Binary files /dev/null and b/src/assets/images/result/go-draw-btn.png differ diff --git a/src/assets/images/result/go-share-btn.png b/src/assets/images/result/go-share-btn.png new file mode 100644 index 0000000..2b13357 Binary files /dev/null and b/src/assets/images/result/go-share-btn.png differ diff --git a/src/assets/images/result/poster-bg-1.jpg b/src/assets/images/result/poster-bg-1.jpg new file mode 100644 index 0000000..5c41775 Binary files /dev/null and b/src/assets/images/result/poster-bg-1.jpg differ diff --git a/src/assets/images/result/poster-bg-2.jpg b/src/assets/images/result/poster-bg-2.jpg new file mode 100644 index 0000000..8c05976 Binary files /dev/null and b/src/assets/images/result/poster-bg-2.jpg differ diff --git a/src/assets/images/result/poster-bg-3.jpg b/src/assets/images/result/poster-bg-3.jpg new file mode 100644 index 0000000..7b4dc26 Binary files /dev/null and b/src/assets/images/result/poster-bg-3.jpg differ diff --git a/src/assets/images/result/poster-bg-4.jpg b/src/assets/images/result/poster-bg-4.jpg new file mode 100644 index 0000000..7b3402c Binary files /dev/null and b/src/assets/images/result/poster-bg-4.jpg differ diff --git a/src/assets/images/result/product-1.png b/src/assets/images/result/product-1.png new file mode 100644 index 0000000..0b6299a Binary files /dev/null and b/src/assets/images/result/product-1.png differ diff --git a/src/assets/images/result/select-arrow.png b/src/assets/images/result/select-arrow.png new file mode 100644 index 0000000..ce5102d Binary files /dev/null and b/src/assets/images/result/select-arrow.png differ diff --git a/src/assets/images/result/select-tips.png b/src/assets/images/result/select-tips.png new file mode 100644 index 0000000..500dd43 Binary files /dev/null and b/src/assets/images/result/select-tips.png differ diff --git a/src/assets/images/result/theme-1.png b/src/assets/images/result/theme-1.png new file mode 100644 index 0000000..bd431e9 Binary files /dev/null and b/src/assets/images/result/theme-1.png differ diff --git a/src/assets/images/result/theme-2.png b/src/assets/images/result/theme-2.png new file mode 100644 index 0000000..a113baf Binary files /dev/null and b/src/assets/images/result/theme-2.png differ diff --git a/src/assets/images/result/theme-3.png b/src/assets/images/result/theme-3.png new file mode 100644 index 0000000..e2d0521 Binary files /dev/null and b/src/assets/images/result/theme-3.png differ diff --git a/src/assets/images/result/theme-4.png b/src/assets/images/result/theme-4.png new file mode 100644 index 0000000..dfe1962 Binary files /dev/null and b/src/assets/images/result/theme-4.png differ diff --git a/src/assets/images/rule/arrow.png b/src/assets/images/rule/arrow.png new file mode 100644 index 0000000..9619845 Binary files /dev/null and b/src/assets/images/rule/arrow.png differ diff --git a/src/assets/images/rule/caidai.png b/src/assets/images/rule/caidai.png new file mode 100644 index 0000000..0107643 Binary files /dev/null and b/src/assets/images/rule/caidai.png differ diff --git a/src/assets/images/rule/cls-btn.png b/src/assets/images/rule/cls-btn.png new file mode 100644 index 0000000..d8bf229 Binary files /dev/null and b/src/assets/images/rule/cls-btn.png differ diff --git a/src/assets/images/rule/rule-box.png b/src/assets/images/rule/rule-box.png new file mode 100644 index 0000000..c50fead Binary files /dev/null and b/src/assets/images/rule/rule-box.png differ diff --git a/src/components/Draw.vue b/src/components/Draw.vue index bde8ac9..bd5dd3a 100644 --- a/src/components/Draw.vue +++ b/src/components/Draw.vue @@ -4,7 +4,7 @@ import { addPoint, debounceTap } from '@/plugins' import { Toast } from "vant"; import { Clipboard } from "v-clipboard"; import { useMainStore } from "@/store"; -// import { drawApi } from '@/api' +import { drawApi } from '@/api' // 页面配置初始化 @@ -28,27 +28,34 @@ const drawFn = (event) => { }) gsap.fromTo(e, { rotation: '-30' }, { rotation: '+30', repeat: -1, yoyo: true, ease: 'none', duration: 0.3 }) - // const res = await drawApi({}) - const res = await draw({},userStore.token) - - if(res.code == 0){ - // isDrawn后端判断有没有中将 - hasPrize.value = res.data.isDrawn == 1 ? true : false // true 中奖 || false 未中奖 - - if(res.data.isDrawn == 1){ - hasPrize.value = true - }else{ + try { + const res = await drawApi({}, userStore.token) + if (res.code == 0) { + // isDrawn后端判断有没有中奖 + hasPrize.value = res.data.isDrawn == 1 ? true : false // true 中奖 || false 未中奖 + // if (res.data.isDrawn == 1) { + // hasPrize.value = true + // } else { + // hasPrize.value = false + // } + } else { + hasPrize.value = false // true 中奖 || false 未中奖 } - }else{ - hasPrize.value = false // true 中奖 || false 未中奖 + + } catch (e) { + console.log('有才有无'); + hasPrize.value = false } - showResult.value = true - console.log("showResult:", showResult.value); - Toast.clear() - gsap.from('.result-container', { duration: 0.5, scale: 0.7, autoAlpha: 0 }) - gsap.killTweensOf('.draw-light,.draw') + userStore.updateDraw() + setTimeout(() => { + Toast.clear() + showResult.value = true + gsap.from('.result-container', { duration: 0.5, scale: 0.7, autoAlpha: 0 }) + gsap.killTweensOf('.draw-light,.draw') + }, 1000) + // setTimeout(() => { // hasPrize.value = false // true 中奖 || false 未中奖 diff --git a/src/components/Index.vue b/src/components/Index.vue index b17f826..7790d06 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -1,20 +1,19 @@ @@ -88,7 +202,7 @@ const createPoster = (event) => { background-color: azure; .result-bg { - @include pos(750px, 100%, 0px, 50%); + @include pos(750px, 1624px, 0px, 50%); transform: translateY(-50%); pointer-events: none; @@ -98,25 +212,195 @@ const createPoster = (event) => { } .result-container { - @include pos(750px, 100%, 0px, 50%); + @include pos(750px, 1624px, 0px, 50%); transform: translateY(-50%); - .bg-tab { - width: 90%; + .page-theme-1 { + color: #d3473a; + animation: color 1s; + } + + .page-theme-2 { + color: #fb7700; + animation: color 1s; + + } + + .page-theme-3 { + color: #4172d8; + animation: color 1s; + + } + + .page-theme-4 { + color: #eb5c37; + animation: color 1s; + + } + + .mbti-title { + @include pos(480px, 120px, 90px, 418px); + font-size: 80px; + font-family: "HYYaKuHei"; + text-align: center; + text-shadow: 3.109px 2.517px 4px rgba(215, 70, 56, 0.47); + text-stroke: 1px #ffffff; + -webkit-text-stroke: 1px #ffffff; + // -webkit-transform: matrix(2.63538838101382, -0.15627262233171, 0.15650043026188, 2.63155221026798, 0, 0); + font-weight: bolder; + transform: rotate(-4deg); display: flex; - flex-direction: row; + + span {} + + } + + .mbti-des-box { + @include pos(517px, 90px, 110px, 547px); + display: flex; + flex-direction: column; justify-content: space-around; + font-family: 'fzzy'; - .li { - @include box(80px, 80px); - background-color: aquamarine; - @include flexCen(); - } - - .active { - background: #bc0000; + .des { + color: #af6f49; + font-size: 30px; + transform: rotate(-4deg); } } + + .mbti-blessings-box { + @include pos(500px, 140px, 130px, 720px); + display: flex; + flex-direction: column; + justify-content: space-between; + font-family: 'fzcy'; + + .blessings { + font-size: 50px; + transform: rotate(-4deg); + text-shadow: 0px -1px 0px rgba(255, 255, 255, 0.004); + } + } + + .mbti-product { + @include pos(475px, 140px, 134px, 948px); + font-family: 'fzcy'; + + .product { + font-size: 45px; + transform: rotate(-3deg); + text-shadow: 0px -1px 0px rgba(255, 255, 255, 0.004); + } + + .produc-img { + @include box(469px, 102px); + margin-left: 10px; + + img { + width: 100%; + } + } + } + + .theme-tab { + @include pos(487px, 240px, 161px, 1108px); + + .theme-select-tips { + @include pos(250px, 21px, 118.5px, 0px); + @include bg_pos("result/select-tips.png"); + } + + .theme-list { + @include pos(483px, 116px, 2.5px, 36px); + display: flex; + flex-direction: row; + justify-content: space-around; + + .active { + border-style: solid; + border-width: 8px; + border-color: rgb(255, 70, 76); + border-radius: 20px; + } + + .theme-li { + @include box(97px, 98px); + position: relative; + } + + .theme-li-1 { + @include bg_pos("result/theme-1.png"); + } + + .theme-li-2 { + @include bg_pos("result/theme-2.png"); + } + + .theme-li-3 { + @include bg_pos("result/theme-3.png"); + } + + .theme-li-4 { + @include bg_pos("result/theme-4.png"); + } + + .selected { + @include bg_pos("result/select-arrow.png"); + @include pos(15px, 8px, 60px, 120px); + + } + } + + .create-btn { + @include pos(258px, 69px, 126px, 159px); + @include bg_pos("result/create-btn.png"); + } + + } + + } } + +.posterPop { + @include fixed(); + @include flexCen(); + background-color: rgba($color: #000000, $alpha: 0.54); + visibility: hidden; + + .cls-btn { + @include box(41px, 41px); + @include bg_pos("result/cls-btn.png"); + } + + .poster-box { + @include box(495px, 990px); + overflow: hidden; + border: 2px solid #dbbb90; + border-radius: 20px; + + #poster { + @include box(100%, 100%); + } + } + + .btn-box { + @include box(489px, 76px); + display: flex; + justify-content: space-between; + margin-top: 20px; + + .go-draw { + @include box(226px, 76px); + @include bg_pos("result/go-draw-btn.png"); + } + + .go-share { + @include box(226px, 76px); + @include bg_pos("result/go-share-btn.png"); + } + } + +} \ No newline at end of file diff --git a/src/components/Rule.vue b/src/components/Rule.vue index 83c4a82..9f10bfd 100644 --- a/src/components/Rule.vue +++ b/src/components/Rule.vue @@ -4,11 +4,58 @@ import { debounceTap } from '@/plugins' // 页面配置初始化 const emit = defineEmits(["RulePage"]); +const hide = (event) => { + debounceTap(event.target, () => { + emit('RulePage', { action: 'hide' }) + }) +} + @@ -17,5 +64,54 @@ const emit = defineEmits(["RulePage"]); @include fixed(); @include flexCen(); background-color: rgba($color: #000000, $alpha: 0.7); + + .rule-container { + position: relative; + @include box(492px, 712px); + + .content { + + .rule-content { + @include box(490px, 709px); + @include bg_pos('rule/rule-box.png'); + position: relative; + + .rule-text-area { + @include pos(405px, 523px, 41px, 101px); + // background-color: #000000; + overflow: hidden; + overflow-y: scroll; + + .part { + font-family: 'fzcy'; + color: #ac4d31; + font-size: 20px; + line-height: 30px; + margin-top: 30px; + text-align: justify; + padding: 0 10px; + } + } + + } + + .rule-arrow { + @include pos(38px, 23px, 224px, 641px); + @include bg_pos('rule/arrow.png'); + } + + .rule-cls-btn { + @include pos(48px, 48px, 441px, -76px); + @include bg_pos('rule/cls-btn.png'); + } + } + + .rule-caidai { + @include pos(135px, 185px, 357px, 557px); + @include bg_pos('rule/caidai.png'); + pointer-events: none; + } + } + } \ No newline at end of file diff --git a/src/data/index.js b/src/data/index.js index c5734d1..4913d9b 100644 --- a/src/data/index.js +++ b/src/data/index.js @@ -208,62 +208,99 @@ export const data = [ export const mbtiList = [ { type: 'INTJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'INTP', - spe: '富有创造力的发明家,对知识有着止不住的渴望', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ENTJ', - spe: '大胆,富有想象力且', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ENTP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'INFJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'INFP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ENFJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ENFP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ISTJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ISFJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ESTJ', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, { type: 'ISTP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', - }, - { - type: 'ISFP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', - }, - { - type: 'ESTP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', - }, - { - type: 'ESFP', - spe: '富有想象力和战略性的思想家,一切皆在计划之中', + job: '建筑师', + des: ['富有想象力和战略性的思想家,', '一切皆在计划之中'], + blessings: ['江南几度梅花发', '福瘦双全有钱花'], + product: '启航一年定开1号', + productPic: new URL('../assets/images/result/product-1.png', import.meta.url).href, }, + ] \ No newline at end of file diff --git a/src/page/Home/App.vue b/src/page/Home/App.vue index a3833da..9f2a4f5 100644 --- a/src/page/Home/App.vue +++ b/src/page/Home/App.vue @@ -1,10 +1,11 @@ @@ -17,6 +18,7 @@ import Question from "@/components/Question"; import MyPrize from "@/components/MyPrize"; import Draw from "@/components/Draw"; import Result from "@/components/Result"; +import Rule from "@/components/Rule"; import { createBGM, getQueryString } from "@/plugins"; import { authorize, getUserInfo } from '@/api' import { Toast } from "vant"; @@ -43,6 +45,10 @@ const indexFn = (item) => { if (item.action == "start") { showQuestion.value = true; } + + if (item.action == "showRule") { + showRule.value = true; + } }; const showQuestion = ref(false); @@ -76,6 +82,18 @@ const resultFn = (item) => { if (item.action == "hide") { showResult.value = false; } + if (item.action == "showDraw") { + showDraw.value = true; + } +}; + + +const showRule = ref(false); +const ruleFn = (item) => { + if (item.action == "hide") { + showRule.value = false; + } + }; onMounted(() => { diff --git a/src/plugins/index.js b/src/plugins/index.js index 71ddbd2..74cd490 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -433,7 +433,7 @@ export function mostValue(arr) { // 海报生成 -export function posterCreate(option, imageArr) { +export function posterCreate(option, imageArr, textArr, theme) { let posterUrl = '' const { width, height } = option Toast.loading({ @@ -441,12 +441,13 @@ export function posterCreate(option, imageArr) { duration: 0, forbidClick: true }) + console.log('theme', theme); let mycanvas = document.createElement('canvas') // 创建一个canvas画布元素 let ctx = mycanvas.getContext('2d') mycanvas.width = width; //设置canvas的宽 mycanvas.height = height; //设置canvas的高 - + console.log('imgs:', imageArr); //Promise对象加载资源 let loader_p = []; imageArr.map((item) => { @@ -469,6 +470,39 @@ export function posterCreate(option, imageArr) { ctx.drawImage(item, imageArr[index].pos.x, imageArr[index].pos.y, imageArr[index].pos.w, imageArr[index].pos.h); //原生canvas的绘制图片方法,直接百度搜索 `js drawImage`查看方法的参数 }) + // 画签文 + ctx.rotate(-4 * (Math.PI / 180)); + ctx.textAlign = 'start'; //type2 + ctx.textBaseline = 'top' + textArr.map((item, index) => { + const { x, y } = textArr[index].style.pos + ctx.font = textArr[index].style.font; // normal bold + + // title绘制描边 + if (index == 0) { + ctx.lineWidth = 5 + ctx.strokeStyle = 'white' + ctx.strokeText(textArr[index].content, x, y); + } + + + ctx.fillStyle = textArr[index].style.color ? textArr[index].style.color : theme; //原生canvas的绘制文字方法,属性类似css,确定好文字颜色、粗细、字号、字体、对齐方式 + ctx.fillText(textArr[index].content, x, y); //绘制文字 + }) + + // let mbtiLogo = 'MBTI MBTI MBTI' + // let radius = 75 + // var angleStep = ((3 / 4) * Math.PI) / mbtiLogo.length; + // for (var i = 0; i < mbtiLogo.length; i++) { + // var angle = i * angleStep + Math.PI / 250; + // var x = 375 + Math.cos(angle) * radius; + // var y = 775 + Math.sin(angle) * radius; + // ctx.font = 'normal 30px HYYakuHei'; + // ctx.fillStyle = theme + // ctx.fillText(mbtiLogo[i], x, y); + // } + + //海报绘制完 ,转成图片对象 return mycanvas.toDataURL('image/jpeg', 1); }) @@ -476,7 +510,11 @@ export function posterCreate(option, imageArr) { //返回的图片地址,就是最后海报的地址,可以放在DOM显示 let posterImg = document.querySelector('#poster') posterImg.src = baseURL - setTimeout(() => Toast.success({ message: '已成功' }), 500) + setTimeout(() => { + Toast.success({ message: '生成成功!' }) + gsap.to('.posterPop', { duration: 0.5, autoAlpha: 1 }) + + }, 500) }) return posterUrl diff --git a/src/store/index.js b/src/store/index.js index d6aa0af..b5cd85b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -4,8 +4,10 @@ import { defineStore } from "pinia" export const useMainStore = defineStore("counter", { state: () => { return { + hasDraw: true, //是否有抽奖机会 token: 'INFJ', - MBTI: '', //测试结果 + MBTI: 'INTJ', //测试结果 + hasPrize: true, //是否有奖品 prizeCode: 'DKS18', //兑换码 prizeMoney: '8.88', //金额 drawKey: '', @@ -27,6 +29,9 @@ export const useMainStore = defineStore("counter", { }, updateDrawKey(key) { this.drawKey = key + }, + updateDraw(value) { + this.hasDraw = false } }, }) diff --git a/src/styles/global.scss b/src/styles/global.scss index e6781bf..abf1834 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -1,9 +1,67 @@ @charset "utf-8"; -// @import url('@/assets/font/AlimamaShuHeiTi.ttf'); +/*-------------------- + 默认设置 + -------------------*/ +* { + padding: 0; + margin: 0; + box-sizing: border-box; + -webkit-box-sizing: border-box; + // -webkit-user-select: none; + // -moz-user-select: none; + /*touch-action: none; */ + // -webkit-transform: translate3d(0, 0, 0); + // -moz-transform: translate3d(0, 0, 0); + // -ms-transform: translate3d(0, 0, 0); + // transform: translate3d(0, 0, 0); +} + +*:not(input, textarea) { + -webkit-user-select: none; + -moz-user-select: none; + //-webkit-touch-callout:none; + //user-select: none; + //-webkit-user-select: none; +} + +html { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-tap-highlight: rgba(0, 0, 0, 0); + -webkit-text-size-adjust: none; + overflow: -moz-scrollbars-vertical; + width: 100%; + height: 100%; + font-size: 100px; +} + +body { + position: relative; + width: 100%; + height: 100%; + margin: 0 auto; + font: normal 12px / auto "Helvetica Neue", Helvetica, "Micorsoft YaHei", Arial, + sans-serif; + /* -webkit-user-select: none;*/ +} @font-face { - font-family: 'alimama'; - src: url(@/assets/font/AlimamaShuHeiTi.ttf) format('truetype'); + font-family: "alimama"; + src: url(@/assets/font/AlimamaShuHeiTi.ttf) format("truetype"); +} + +@font-face { + font-family: "HYYakuHei"; + src: url(@/assets/font/HYYakuHei-85W.ttf) format("truetype"); +} + +@font-face { + font-family: "fzcy"; + src: url(@/assets/font/fzcy.ttf) format("truetype"); +} + +@font-face { + font-family: "fzzy"; + src: url(@/assets/font/fzzy.ttf) format("truetype"); } * { @@ -57,4 +115,4 @@ flex-direction: column; align-items: center; justify-content: center; -} \ No newline at end of file +}