Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
190c05918b | ||
|
|
42c244573c | ||
|
|
21f74b3c48 | ||
|
|
5fa5944dff | ||
|
|
1af9e36fc0 | ||
|
|
65fea75825 | ||
|
|
5e97da4731 | ||
|
|
78fa350ced | ||
|
|
11283f6f94 | ||
|
|
e9b4d3ac38 | ||
|
|
7fe1f95d9d | ||
|
|
86b565dfa9 | ||
|
|
41bdc3346f | ||
|
|
7a52b024dd | ||
|
|
10073b3a07 | ||
|
|
778594652c | ||
|
|
b00b52cba8 | ||
|
|
ab7f4e20f1 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Set node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
- name: Install
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
- name: Set node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
- name: Install
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [lts/*]
|
||||
os: [ubuntu-latest]
|
||||
fail-fast: false
|
||||
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -17,10 +17,10 @@ jobs:
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
# after pnpm
|
||||
- name: Use Node.js 16
|
||||
- name: Use Node.js LTS
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: lts/*
|
||||
registry-url: https://registry.npmjs.org/
|
||||
cache: pnpm
|
||||
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,3 +17,4 @@ dist
|
||||
.nuxt
|
||||
.env
|
||||
.idea/
|
||||
.vercel
|
||||
|
||||
2
.npmrc
2
.npmrc
@@ -1,3 +1,5 @@
|
||||
shamefully-hoist=true
|
||||
strict-peer-dependencies=false
|
||||
shell-emulator=true
|
||||
auto-install-peers=false
|
||||
ignore-workspace-root-check=true
|
||||
|
||||
48
.vscode/settings.json
vendored
48
.vscode/settings.json
vendored
@@ -19,8 +19,6 @@
|
||||
"*.css": "postcss"
|
||||
},
|
||||
|
||||
// Enable the ESlint flat config support
|
||||
"eslint.experimental.useFlatConfig": true,
|
||||
// Disable the default formatter, use eslint instead
|
||||
"prettier.enable": false,
|
||||
"editor.formatOnSave": false,
|
||||
@@ -31,43 +29,17 @@
|
||||
},
|
||||
// Silent the stylistic rules in you IDE, but still auto fix them
|
||||
"eslint.rules.customizations": [
|
||||
{
|
||||
"rule": "style/*",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-indent",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-spacing",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-spaces",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-order",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-dangle",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*-newline",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*quotes",
|
||||
"severity": "off"
|
||||
},
|
||||
{
|
||||
"rule": "*semi",
|
||||
"severity": "off"
|
||||
}
|
||||
{ "rule": "style/*", "severity": "off" },
|
||||
{ "rule": "*-indent", "severity": "off" },
|
||||
{ "rule": "*-spacing", "severity": "off" },
|
||||
{ "rule": "*-spaces", "severity": "off" },
|
||||
{ "rule": "*-order", "severity": "off" },
|
||||
{ "rule": "*-dangle", "severity": "off" },
|
||||
{ "rule": "*-newline", "severity": "off" },
|
||||
{ "rule": "*quotes", "severity": "off" },
|
||||
{ "rule": "*semi", "severity": "off" }
|
||||
],
|
||||
|
||||
// Enable eslint for all supported languages
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
### 网页版本
|
||||
|
||||
- 网站链接:[cook.yunyoujun.cn](https://cook.yunyoujun.cn)
|
||||
- 备用:[cook.yyj.moe](https://cook.yyj.moe)
|
||||
- 开发版:[cook.yunle.app](https://cook.yunle.app)
|
||||
- 网站链接(Cloudflare):[cook.yunyoujun.cn](https://cook.yunyoujun.cn)
|
||||
- 国内加速(腾讯云):[cook.yunle.fun](https://cook.yunle.fun)
|
||||
- 备用(Netlify):[cook.yyj.moe](https://cook.yyj.moe)
|
||||
- 开发版(Vercel):[cook.yunle.app](https://cook.yunle.app)
|
||||
|
||||
### 小程序版本
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { installPrompt } from './utils/pwa'
|
||||
import { useIndexedDB } from '~/composables/db'
|
||||
import { appName } from '~/constants'
|
||||
import { installPrompt } from './utils/pwa'
|
||||
|
||||
// https://nuxt.com/docs/api/composables/use-head
|
||||
useHead({
|
||||
@@ -8,7 +8,10 @@ const props = defineProps({
|
||||
const rStore = useRecipeStore()
|
||||
const { displayedRecipe } = storeToRefs(rStore)
|
||||
|
||||
const showBasketBtn = computed(async () => {
|
||||
/**
|
||||
* Show basket button if there are recipes in the basket
|
||||
*/
|
||||
const showBasketBtn = computed(() => {
|
||||
return displayedRecipe.value.length !== rStore.recipesLength && props.isVisible
|
||||
})
|
||||
</script>
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { storeToRefs } from 'pinia'
|
||||
import type { StuffItem } from '~/types'
|
||||
import { meat, staple, tools, vegetable } from '~/data/food'
|
||||
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useEmojiAnimation } from '~/composables/animation'
|
||||
|
||||
import { meat, staple, tools, vegetable } from '~/data/food'
|
||||
|
||||
const rStore = useRecipeStore()
|
||||
const { curTool } = storeToRefs(rStore)
|
||||
const curStuff = computed(() => rStore.selectedStuff)
|
||||
@@ -25,7 +25,7 @@ const filteredRecipes = computedAsync(async () => {
|
||||
|
||||
<template>
|
||||
<YlfIconButton
|
||||
absolute right-3 top-5
|
||||
absolute right-4 top-4
|
||||
class="icon-btn hover:text-yellow-400 !outline-none"
|
||||
text-xl
|
||||
title="切换" @click="openModal"
|
||||
@@ -89,9 +89,9 @@ const filteredRecipes = computedAsync(async () => {
|
||||
@click="keyword = ''"
|
||||
/>
|
||||
</div>
|
||||
<div op="70" ml-2 inline-flex cursor-pointer text-base @click="closeModal">
|
||||
<button op="70" ml-2 inline-flex cursor-pointer text-base @click="closeModal">
|
||||
取消
|
||||
</div>
|
||||
</button>
|
||||
</DialogTitle>
|
||||
<div flex="~ col grow" overflow="auto" class="mt-2" text-xs>
|
||||
<DishTag v-for="item, i in filteredRecipes" :key="i" :dish="item" />
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import VueAboutMe from 'vue-about-me'
|
||||
import { VueAboutMe } from 'vue-about-me'
|
||||
import 'vue-about-me/style.css'
|
||||
|
||||
const color = useColorMode()
|
||||
29
app/components/help/HelpAbout.vue
Normal file
29
app/components/help/HelpAbout.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<FAQItem :default-open="true" title="关于">
|
||||
<div text-left>
|
||||
<ul>
|
||||
<li>
|
||||
它诞生于 2022 年 4 月,时值疫情风控期间,希望能帮助期间的伙伴根据现有食材寻找到合适的菜谱。故原名「隔离食用手册」。
|
||||
</li>
|
||||
<li>
|
||||
如今那个时期已离我们远去,故去掉「隔离」二字。但也很高兴能在这里继续与你相遇,希望它能继续发光发热,在日常生活中帮助到大家。
|
||||
</li>
|
||||
<li>
|
||||
<div class="inline-flex items-center justify-center">
|
||||
代码仓库:<a class="inline-flex items-center justify-center" href="https://github.com/YunYouJun/cook" target="_blank">
|
||||
<div m="r-1" i-ri-github-line inline-flex />YunYouJun/cook</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="inline-flex items-center justify-center">
|
||||
菜谱视频来源:
|
||||
<a class="inline-flex items-center text-sm text-blue-600 dark:text-blue-400" href="https://docs.qq.com/sheet/DQk1vdkhFV0twQVNS" target="_blank">
|
||||
<div m="r-1" i-ri-bilibili-line inline-flex />
|
||||
<span class="inline-flex">隔离食用手册大全</span>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</FAQItem>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import pkg from '~/package.json'
|
||||
import pkg from '~/../package.json'
|
||||
|
||||
const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7)
|
||||
const now = import.meta.env.VITE_APP_BUILD_TIME
|
||||
11
app/components/tags/DateTag.vue
Normal file
11
app/components/tags/DateTag.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div
|
||||
class="tagSize pureTag rounded"
|
||||
p="x-2"
|
||||
border="~ yellow-200 dark:yellow-800"
|
||||
bg="yellow-300 opacity-20"
|
||||
text="yellow-800 dark:yellow-200"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import type { DbRecipeItem } from '~/utils/db'
|
||||
import { tools } from '~/data/food'
|
||||
import type { RecipeItem } from '~/types'
|
||||
import { getEmojisFromStuff } from '~/utils'
|
||||
import type { DbRecipeItem } from '~/utils/db'
|
||||
import { recipeHistories } from '~/composables/store/history'
|
||||
import { tools } from '~/data/food'
|
||||
import { getEmojisFromStuff } from '~/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
dish: RecipeItem | DbRecipeItem
|
||||
@@ -5,12 +5,12 @@ defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
<button
|
||||
class="meat-tag rounded tag" p="x-2"
|
||||
border="~ red-200 dark:red-800"
|
||||
:bg="active ? 'red-500 opacity-90' : 'red-300 opacity-20'"
|
||||
:text="active ? 'red-100' : 'red-800 dark:red-200'"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -5,11 +5,11 @@ defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
<button
|
||||
class="rounded tag" p="x-2" border="~ yellow-200 dark:yellow-800"
|
||||
:bg="active ? 'yellow-500 dark:yellow-600 opacity-100' : 'yellow-300 opacity-20'"
|
||||
:text="active ? 'yellow-100' : 'yellow-800 dark:yellow-200'"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -5,12 +5,12 @@ defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
<button
|
||||
class="rounded tag" p="x-2"
|
||||
border="~ stone-200 dark:stone-600"
|
||||
:bg="active ? 'stone-600 opacity-100' : 'stone-300 opacity-5'"
|
||||
:text="active ? 'stone-100' : 'stone-800 dark:stone-200'"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -5,12 +5,12 @@ defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
<button
|
||||
class="vegetable-tag rounded tag" p="x-2"
|
||||
border="~ green-200 dark:green-800"
|
||||
:bg="active ? 'green-600 opacity-90' : 'green-300 opacity-20'"
|
||||
:text="active ? 'green-100' : 'green-800 dark:green-200'"
|
||||
>
|
||||
<slot />
|
||||
</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isClient } from '@vueuse/core'
|
||||
import type { Ref } from 'vue'
|
||||
import { isClient } from '@vueuse/core'
|
||||
|
||||
export function useEmojiAnimation(recipeBtn: Ref<HTMLButtonElement | undefined>) {
|
||||
const { x, y } = usePointer()
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { lastDbUpdated, namespace } from '~/constants'
|
||||
import { db, initDb } from '~/utils/db'
|
||||
|
||||
export function useIndexedDB() {
|
||||
const dbUpdated = useStorage(`${namespace}:lastDbUpdated`, lastDbUpdated)
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { DbRecipeItem } from '~/utils/db'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { namespace } from '~/constants'
|
||||
import type { DbRecipeItem } from '~/utils/db'
|
||||
|
||||
/**
|
||||
* 随机几道菜
|
||||
@@ -1,8 +1,8 @@
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { defaultSettings } from '../../utils/settings'
|
||||
import { namespace } from '../../constants'
|
||||
import { defaultSettings } from '../../utils/settings'
|
||||
|
||||
export const useAppStore = defineStore('app', () => {
|
||||
const deferredPrompt = ref<Event | any>()
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { RecipeItem } from '~/types'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { namespace } from '~/constants'
|
||||
import type { RecipeItem } from '~/types'
|
||||
|
||||
export interface RecipeHistoryItem {
|
||||
recipe: RecipeItem
|
||||
@@ -1,10 +1,10 @@
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import type { RecipeItem, StuffItem } from '~/types'
|
||||
import { useGtm } from '@gtm-support/vue-gtm'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { db } from '../../utils/db'
|
||||
import { useAppStore } from './app'
|
||||
import type { RecipeItem, StuffItem } from '~/types'
|
||||
|
||||
const namespace = 'cook'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import process from 'node:process'
|
||||
import type { ModuleOptions } from '@vite-pwa/nuxt'
|
||||
import process from 'node:process'
|
||||
import { appDescription, appName } from '../constants/index'
|
||||
|
||||
const scope = '/'
|
||||
1
app/data/recipe.json
Normal file
1
app/data/recipe.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<main class="cook-main text-center text-gray-700 dark:text-gray-200" p="t-8 b-$cook-bottom-menu-height">
|
||||
<slot />
|
||||
<DarkToggle absolute left-3 top-5 />
|
||||
<DarkToggle absolute left-4 top-4 />
|
||||
<SearchRecipe />
|
||||
<TheBottomMenu fixed bottom-0 left-0 right-0 />
|
||||
</main>
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { defaultCookbook } from '~/utils'
|
||||
|
||||
definePageMeta({
|
||||
layout: 'child',
|
||||
title: '自定义菜谱',
|
||||
141
app/pages/help.vue
Normal file
141
app/pages/help.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="w-full">
|
||||
<CommonHeader>
|
||||
帮助
|
||||
</CommonHeader>
|
||||
|
||||
<InstallPwa />
|
||||
|
||||
<FeedbackActions />
|
||||
|
||||
<div class="mx-auto max-w-md w-full rounded-2xl p-2" text-left>
|
||||
<FAQItem title="未来计划?">
|
||||
计划增加新功能,如自定义菜谱,与使用其他用户分享的菜谱。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="什么是模式?">
|
||||
<ul>
|
||||
<li><b>模糊匹配</b>:展示所有含当前选中任意食材的菜谱</li>
|
||||
<li><b>精准匹配</b>:展示所有含当前选中所有食材的菜谱</li>
|
||||
<li><b>生存模式</b>:展示当前选中食材即可制作的所有菜谱</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="如何快速清空所选食材和工具?">
|
||||
<div inline-flex items-center justify-center>
|
||||
点击顶部 <div i-mdi-pot-steam-outline mx-1 inline-block /> 图标即可。
|
||||
</div>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="是否有微信小程序?">
|
||||
因不可抗力(小程序因跳转 B 站视频而被判定为导流违规)下架。
|
||||
将不再提供小程序版本。
|
||||
<br>
|
||||
<br>
|
||||
搜索微信公众号<b>「云游君」</b>并发送<b>「做菜」</b>,也可以快速找到本网站。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="是否有 APP?">
|
||||
<b>暂时没有开发 APP 的计划。</b>
|
||||
<br>
|
||||
但我们正在优化 <b>PWA</b> 的体验,以便您可以直接将本站添加到桌面,并享受<b>类似 APP 的体验</b>。
|
||||
<br>
|
||||
你可以使用浏览器打开,点击上方的<b>「安装到桌面」</b>或在菜单中点击<b>「添加到主屏幕」</b>。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="未来是否会收费?">
|
||||
该项目将以免费开源的形式运营。
|
||||
<br>
|
||||
您可以考虑赞助本项目,以支持我们的开发。
|
||||
我会将其投入在周边的服务器、域名、CDN 等费用上。
|
||||
<ul mt-1>
|
||||
<li>
|
||||
<a href="https://afdian.net/a/yunyoujun" target="_blank">爱发电赞助</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://sponsors.yunyoujun.cn/" target="_blank">我要直接打钱!</a>
|
||||
</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="页面无法点击、资源加载失败?">
|
||||
<blockquote>
|
||||
试试「无痕模式」是否正常?
|
||||
</blockquote>
|
||||
<br>
|
||||
<ol>
|
||||
<li>
|
||||
<b>清除 Cookie</b>
|
||||
<ol>
|
||||
<li>
|
||||
点击浏览器网址前方的 🔒 图标
|
||||
</li>
|
||||
<li>
|
||||
点击「Cookie」并清除
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
<b>强制刷新缓存</b>
|
||||
<ul>
|
||||
<li>Windows: <code>Ctrl + F5</code></li>
|
||||
<li>macOS: <code>Cmd + Shift + R</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
</FAQItem>
|
||||
|
||||
<hr h="1" my="4" bg-black>
|
||||
|
||||
<HelpAbout />
|
||||
|
||||
<FAQItem title="关于我">
|
||||
<div text-left>
|
||||
我的个人微信公众号「云游君」,会分享一些生活和写的<a href="https://sponsors.yunyoujun.cn/projects" target="_blank">
|
||||
小玩具们
|
||||
</a>。
|
||||
|
||||
<a inline-flex py-4 href="https://cdn.yunyoujun.cn/img/about/white-qrcode-and-search.jpg" target="_blank">
|
||||
<img src="https://cdn.yunyoujun.cn/img/about/white-qrcode-and-search.jpg">
|
||||
</a>
|
||||
</div>
|
||||
<AboutMe />
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="致谢">
|
||||
<p>
|
||||
感谢以下小伙伴为本项目提供的数据支持和 QA !
|
||||
</p>
|
||||
|
||||
<ul mt-2 text-left text-sm>
|
||||
<li>
|
||||
<a href="https://weibo.com/runny" target="_blank">Runny</a>
|
||||
</li>
|
||||
<li>
|
||||
麒麟
|
||||
</li>
|
||||
<li>
|
||||
晴方啾
|
||||
</li>
|
||||
<li>
|
||||
课代表阿伟
|
||||
</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="赞助者们">
|
||||
<div>
|
||||
感谢至今以来所有的<a href="https://afdian.net/a/yunyoujun" class="text-purple" target="_blank">赞助者</a>们,你们的支持是我持续维护和开发新项目的动力!
|
||||
</div>
|
||||
<div pt-2>
|
||||
<a href="https://sponsors.yunyoujun.cn" target="_blank">
|
||||
<img src="https://sponsors.yunyoujun.cn/sponsors.svg">
|
||||
</a>
|
||||
</div>
|
||||
</FAQItem>
|
||||
</div>
|
||||
</div>
|
||||
<BaseFooter mt-4 />
|
||||
</div>
|
||||
</template>
|
||||
24
app/pages/index.vue
Normal file
24
app/pages/index.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<script lang="ts" setup>
|
||||
const rStore = useRecipeStore()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div text-4xl>
|
||||
<button
|
||||
class="cursor-pointer transition active:text-green-800 hover:(text-green-600)"
|
||||
title="重置"
|
||||
@click="rStore.reset"
|
||||
>
|
||||
<div v-if="rStore.selectedStuff.length" i-mdi-pot-steam-outline />
|
||||
<div v-else i-mdi-pot-mix-outline />
|
||||
</button>
|
||||
</div>
|
||||
<p text="sm" m="b-4">
|
||||
好的,今天我们来做菜!
|
||||
</p>
|
||||
|
||||
<ChooseFood />
|
||||
<SimpleCopyright />
|
||||
</div>
|
||||
</template>
|
||||
@@ -16,21 +16,21 @@ function clearAllHistory() {
|
||||
|
||||
<template>
|
||||
<div pt-2>
|
||||
<div
|
||||
<button
|
||||
text="blue-900 dark:blue-200"
|
||||
bg="blue-300 op-20 hover:(blue-800 op-20) dark:hover:(blue-200 op-20)"
|
||||
class="inline-flex items-center justify-center border border-transparent rounded-md px-4 py-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500"
|
||||
@click="clearAllHistory"
|
||||
>
|
||||
<div i-ri-eraser-line />
|
||||
<span i-ri-eraser-line />
|
||||
<span class="ml-1">清空记录</span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<div flex="~ col">
|
||||
<div v-for="history in recipeHistories" :key="history.recipe.name" mt-2>
|
||||
<StapleTag :active="false">
|
||||
<DateTag>
|
||||
{{ dayjs(history.time).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</StapleTag>
|
||||
</DateTag>
|
||||
<DishTag :dish="history.recipe" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,7 +26,5 @@
|
||||
// cook custom
|
||||
:root {
|
||||
--cook-bottom-menu-padding-bottom: 20px;
|
||||
--cook-bottom-menu-height: calc(
|
||||
64px + var(--cook-bottom-menu-padding-bottom)
|
||||
);
|
||||
--cook-bottom-menu-height: calc(64px + var(--cook-bottom-menu-padding-bottom));
|
||||
}
|
||||
@@ -58,7 +58,8 @@ hr {
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.tag {
|
||||
.tag,
|
||||
.tagSize {
|
||||
margin: 4px;
|
||||
padding: 2px 4px;
|
||||
// border: 1px solid var(--c-text);
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Table } from 'dexie'
|
||||
import Dexie from 'dexie'
|
||||
|
||||
import type { RecipeItem } from '~/types'
|
||||
|
||||
import Dexie from 'dexie'
|
||||
|
||||
export interface DbRecipeItem extends RecipeItem {
|
||||
id?: number
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { meat, staple, vegetable } from '~/data/food'
|
||||
|
||||
export * from './cookbook'
|
||||
|
||||
const foodItems = [...vegetable, ...meat, ...staple]
|
||||
const foodEmojiMap = new Map()
|
||||
foodItems.forEach((item) => {
|
||||
@@ -1,8 +1,17 @@
|
||||
// @ts-check
|
||||
import antfu from '@antfu/eslint-config'
|
||||
import nuxt from './.nuxt/eslint.config.mjs'
|
||||
|
||||
export default antfu(
|
||||
export default nuxt(
|
||||
antfu(
|
||||
{
|
||||
unocss: true,
|
||||
formatters: true,
|
||||
},
|
||||
{
|
||||
ignores: [
|
||||
'app/data/*.json',
|
||||
],
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import process from 'node:process'
|
||||
import { pwa } from './config/pwa'
|
||||
import { appDescription } from './constants/index'
|
||||
import { pwa } from './app/config/pwa'
|
||||
import { appDescription } from './app/constants/index'
|
||||
|
||||
Object.assign(process.env, {
|
||||
VITE_COMMIT_REF: process.env.CF_PAGES_COMMIT_SHA || '',
|
||||
@@ -9,29 +9,50 @@ Object.assign(process.env, {
|
||||
// add build time to env
|
||||
import.meta.env.VITE_APP_BUILD_TIME = new Date().getTime().toString()
|
||||
export default defineNuxtConfig({
|
||||
ssr: false,
|
||||
|
||||
modules: [
|
||||
'@vueuse/nuxt',
|
||||
'@unocss/nuxt',
|
||||
'@pinia/nuxt',
|
||||
|
||||
'@nuxt/test-utils/module',
|
||||
'@nuxtjs/color-mode',
|
||||
'@vite-pwa/nuxt',
|
||||
'@nuxt/eslint',
|
||||
'@nuxt/test-utils/module',
|
||||
|
||||
'@zadigetvoltaire/nuxt-gtm',
|
||||
|
||||
'@yunlefun/vue/nuxt',
|
||||
|
||||
// fix QQ in iOS, Done
|
||||
// See https://github.com/unjs/ofetch/pull/366
|
||||
// 'nuxt-fix-ofetch',
|
||||
],
|
||||
ssr: false,
|
||||
|
||||
components: [
|
||||
{ path: '~/components', pathPrefix: false },
|
||||
],
|
||||
|
||||
experimental: {
|
||||
// when using generate, payload js assets included in sw precache manifest
|
||||
// but missing on offline, disabling extraction it until fixed
|
||||
payloadExtraction: false,
|
||||
// inlineSSRStyles: false,
|
||||
renderJsonPayloads: true,
|
||||
typedPages: true,
|
||||
devtools: {
|
||||
enabled: true,
|
||||
},
|
||||
|
||||
app: {
|
||||
head: {
|
||||
viewport: 'width=device-width,initial-scale=1',
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
|
||||
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
|
||||
],
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no' },
|
||||
{ name: 'description', content: appDescription },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
{ name: 'theme-color', media: '(prefers-color-scheme: light)', content: 'white' },
|
||||
{ name: 'theme-color', media: '(prefers-color-scheme: dark)', content: '#222222' },
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
css: [
|
||||
@@ -44,6 +65,25 @@ export default defineNuxtConfig({
|
||||
classSuffix: '',
|
||||
},
|
||||
|
||||
future: {
|
||||
compatibilityVersion: 4,
|
||||
},
|
||||
|
||||
features: {
|
||||
// For UnoCSS
|
||||
inlineStyles: false,
|
||||
},
|
||||
|
||||
experimental: {
|
||||
// when using generate, payload js assets included in sw precache manifest
|
||||
// but missing on offline, disabling extraction it until fixed
|
||||
payloadExtraction: false,
|
||||
renderJsonPayloads: true,
|
||||
typedPages: true,
|
||||
},
|
||||
|
||||
compatibilityDate: '2024-08-14',
|
||||
|
||||
nitro: {
|
||||
esbuild: {
|
||||
options: {
|
||||
@@ -57,32 +97,18 @@ export default defineNuxtConfig({
|
||||
},
|
||||
},
|
||||
|
||||
app: {
|
||||
head: {
|
||||
viewport: 'width=device-width,initial-scale=1',
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
|
||||
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
|
||||
],
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no' },
|
||||
{ name: 'description', content: appDescription },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
],
|
||||
eslint: {
|
||||
config: {
|
||||
standalone: false,
|
||||
nuxt: {
|
||||
sortConfigKeys: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
components: [
|
||||
{ path: '~/components', pathPrefix: false },
|
||||
],
|
||||
|
||||
gtm: {
|
||||
id: 'GTM-5FJSV46',
|
||||
},
|
||||
|
||||
pwa,
|
||||
|
||||
devtools: {
|
||||
enabled: true,
|
||||
},
|
||||
})
|
||||
|
||||
100
package.json
100
package.json
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"type": "module",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.4",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@8.14.3",
|
||||
"packageManager": "pnpm@9.15.4",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run convert && nuxt build",
|
||||
"build:static": "npm run convert && nuxt generate",
|
||||
"convert": "tsx scripts/convert.ts",
|
||||
"convert": "pnpm -C scripts run convert",
|
||||
"dev": "nuxt dev --host",
|
||||
"dev:pwa": "VITE_PLUGIN_PWA=true nuxi dev",
|
||||
"generate": "nuxt generate",
|
||||
@@ -24,49 +24,61 @@
|
||||
"typecheck": "vue-tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"dayjs": "^1.11.10",
|
||||
"vue-about-me": "^1.2.7"
|
||||
"dayjs": "^1.11.13",
|
||||
"vue-about-me": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^2.6.3",
|
||||
"@headlessui/vue": "^1.7.17",
|
||||
"@iconify-json/carbon": "^1.1.28",
|
||||
"@iconify-json/fe": "^1.1.10",
|
||||
"@iconify-json/gg": "^1.1.9",
|
||||
"@iconify-json/ic": "^1.1.17",
|
||||
"@iconify-json/mdi": "^1.1.64",
|
||||
"@iconify-json/ri": "^1.1.19",
|
||||
"@iconify-json/twemoji": "^1.1.15",
|
||||
"@nuxt/devtools": "^1.0.8",
|
||||
"@nuxt/test-utils": "^3.10.0",
|
||||
"@nuxtjs/color-mode": "^3.3.2",
|
||||
"@pinia/nuxt": "^0.5.1",
|
||||
"@pinia/testing": "^0.1.3",
|
||||
"@unocss/eslint-config": "^0.58.4",
|
||||
"@unocss/nuxt": "^0.58.4",
|
||||
"@vite-pwa/nuxt": "^0.4.0",
|
||||
"@vue/test-utils": "^2.4.4",
|
||||
"@vueuse/nuxt": "^10.7.2",
|
||||
"@yunlefun/vue": "^0.0.9",
|
||||
"@antfu/eslint-config": "^3.16.0",
|
||||
"@headlessui/vue": "^1.7.23",
|
||||
"@iconify-json/carbon": "^1.2.5",
|
||||
"@iconify-json/fe": "^1.2.2",
|
||||
"@iconify-json/gg": "^1.2.2",
|
||||
"@iconify-json/ic": "^1.2.2",
|
||||
"@iconify-json/mdi": "^1.2.3",
|
||||
"@iconify-json/ri": "^1.2.5",
|
||||
"@iconify-json/twemoji": "^1.2.2",
|
||||
"@nuxt/devtools": "^1.7.0",
|
||||
"@nuxt/eslint": "^0.7.5",
|
||||
"@nuxt/test-utils": "^3.15.4",
|
||||
"@nuxtjs/color-mode": "^3.5.2",
|
||||
"@pinia/nuxt": "^0.9.0",
|
||||
"@pinia/testing": "^0.1.7",
|
||||
"@unocss/eslint-config": "^65.4.3",
|
||||
"@unocss/nuxt": "^65.4.3",
|
||||
"@vite-pwa/nuxt": "^0.10.6",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vueuse/nuxt": "^12.5.0",
|
||||
"@yunlefun/vue": "^0.1.1",
|
||||
"@zadigetvoltaire/nuxt-gtm": "^0.0.13",
|
||||
"bumpp": "^9.3.0",
|
||||
"consola": "^3.2.3",
|
||||
"dexie": "^3.2.4",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-format": "^0.1.0",
|
||||
"fake-indexeddb": "^5.0.2",
|
||||
"happy-dom": "^13.3.1",
|
||||
"jsdom": "^24.0.0",
|
||||
"nuxt": "^3.9.3",
|
||||
"nuxt-vitest": "^0.11.5",
|
||||
"pinia": "^2.1.7",
|
||||
"sass": "^1.70.0",
|
||||
"serve": "^14.2.1",
|
||||
"star-markdown-css": "^0.4.2",
|
||||
"tsx": "^4.7.0",
|
||||
"typescript": "^5.3.3",
|
||||
"unocss": "^0.58.4",
|
||||
"vitest": "^1.2.2",
|
||||
"vue-tsc": "^1.8.27"
|
||||
"bumpp": "^9.10.2",
|
||||
"consola": "^3.4.0",
|
||||
"dexie": "^4.0.11",
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-plugin-format": "^1.0.1",
|
||||
"fake-indexeddb": "^6.0.0",
|
||||
"jsdom": "^26.0.0",
|
||||
"lint-staged": "^15.4.2",
|
||||
"nuxt": "^3.15.2",
|
||||
"pinia": "^2.3.1",
|
||||
"sass": "^1.83.4",
|
||||
"serve": "^14.2.4",
|
||||
"simple-git-hooks": "^2.11.1",
|
||||
"star-markdown-css": "^0.5.3",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "5.7.2",
|
||||
"unocss": "^65.4.3",
|
||||
"vitest": "^3.0.4",
|
||||
"vue-tsc": "^2.2.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"unplugin": "^2.1.2",
|
||||
"vite": "^6.0.11",
|
||||
"vite-plugin-inspect": "^10.1.0"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"pre-commit": "pnpm lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "eslint --fix"
|
||||
}
|
||||
}
|
||||
|
||||
165
pages/help.vue
165
pages/help.vue
@@ -1,165 +0,0 @@
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<CommonHeader>
|
||||
帮助
|
||||
</CommonHeader>
|
||||
|
||||
<InstallPwa />
|
||||
|
||||
<FeedbackActions />
|
||||
|
||||
<div class="mx-auto max-w-md w-full rounded-2xl p-2" text-left>
|
||||
<FAQItem title="未来计划?">
|
||||
计划增加新功能,如自定义菜谱,与使用其他用户分享的菜谱。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="什么是模式?">
|
||||
<ul>
|
||||
<li><b>模糊匹配</b>:展示所有含当前选中任意食材的菜谱</li>
|
||||
<li><b>精准匹配</b>:展示所有含当前选中所有食材的菜谱</li>
|
||||
<li><b>生存模式</b>:展示当前选中食材即可制作的所有菜谱</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="如何快速清空所选食材和工具?">
|
||||
<div inline-flex items-center justify-center>
|
||||
点击顶部 <div i-mdi-pot-steam-outline mx-1 inline-block /> 图标即可。
|
||||
</div>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="是否有微信小程序?">
|
||||
因不可抗力(小程序因跳转 B 站视频而被判定为导流违规)下架。
|
||||
将不再提供小程序版本。
|
||||
<br>
|
||||
<br>
|
||||
搜索微信公众号<b>「云游君」</b>并发送<b>「做菜」</b>,也可以快速找到本网站。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="是否有 APP?">
|
||||
<b>暂时没有开发 APP 的计划。</b>
|
||||
<br>
|
||||
但我们正在优化 <b>PWA</b> 的体验,以便您可以直接将本站添加到桌面,并享受<b>类似 APP 的体验</b>。
|
||||
<br>
|
||||
你可以使用浏览器打开,点击上方的<b>「安装到桌面」</b>或在菜单中点击<b>「添加到主屏幕」</b>。
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="未来是否会收费?">
|
||||
该项目将以免费开源的形式运营。
|
||||
<br>
|
||||
您可以考虑赞助本项目,以支持我们的开发。
|
||||
我会将其投入在周边的服务器、域名、CDN 等费用上。
|
||||
<ul mt-1>
|
||||
<li>
|
||||
<a href="https://afdian.net/a/yunyoujun" target="_blank">爱发电赞助</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://sponsors.yunyoujun.cn/" target="_blank">我要直接打钱!</a>
|
||||
</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="页面无法点击、资源加载失败?">
|
||||
<blockquote>
|
||||
试试「无痕模式」是否正常?
|
||||
</blockquote>
|
||||
<br>
|
||||
<ol>
|
||||
<li>
|
||||
<b>清除 Cookie</b>
|
||||
<ol>
|
||||
<li>
|
||||
点击浏览器网址前方的 🔒 图标
|
||||
</li>
|
||||
<li>
|
||||
点击「Cookie」并清除
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
<b>强制刷新缓存</b>
|
||||
<ul>
|
||||
<li>Windows: <code>Ctrl + F5</code></li>
|
||||
<li>macOS: <code>Cmd + Shift + R</code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
</FAQItem>
|
||||
|
||||
<hr h="1" my="4" bg-black>
|
||||
|
||||
<FAQItem :default-open="true" title="关于">
|
||||
<div text-left>
|
||||
<ul>
|
||||
<li>
|
||||
它诞生于 2022 年 4 月,时值疫情风控期间,希望能帮助期间的伙伴根据现有食材寻找到合适的菜谱。故原名「隔离食用手册」。
|
||||
</li>
|
||||
<li>
|
||||
如今那个时期已离我们远去,故去掉「隔离」二字。但也很高兴能在这里继续与你相遇,希望它能继续发光发热,在日常生活中帮助到大家。
|
||||
</li>
|
||||
<li>
|
||||
<div class="inline-flex items-center justify-center">
|
||||
代码仓库:<a class="inline-flex items-center justify-center" href="https://github.com/YunYouJun/cook" target="_blank">
|
||||
<div m="r-1" i-ri-github-line inline-flex />YunYouJun/cook</a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="inline-flex items-center justify-center">
|
||||
菜谱视频来源:
|
||||
<a class="inline-flex items-center text-sm text-blue-600 dark:text-blue-400" href="https://docs.qq.com/sheet/DQk1vdkhFV0twQVNS" target="_blank">
|
||||
<div m="r-1" i-ri-bilibili-line inline-flex />
|
||||
<span class="inline-flex">隔离食用手册大全</span>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="关于我">
|
||||
<div text-left>
|
||||
我的个人微信公众号「云游君」,会分享一些生活和写的<a href="https://sponsors.yunyoujun.cn/projects" target="_blank">
|
||||
小玩具们
|
||||
</a>。
|
||||
|
||||
<a inline-flex py-4 href="https://cdn.yunyoujun.cn/img/about/white-qrcode-and-search.jpg" target="_blank">
|
||||
<img src="https://cdn.yunyoujun.cn/img/about/white-qrcode-and-search.jpg">
|
||||
</a>
|
||||
</div>
|
||||
<AboutMe />
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="致谢">
|
||||
<p>
|
||||
感谢以下小伙伴为本项目提供的数据支持和 QA !
|
||||
</p>
|
||||
|
||||
<ul mt-2 text-left text-sm>
|
||||
<li>
|
||||
<a href="https://weibo.com/runny" target="_blank">Runny</a>
|
||||
</li>
|
||||
<li>
|
||||
麒麟
|
||||
</li>
|
||||
<li>
|
||||
晴方啾
|
||||
</li>
|
||||
<li>
|
||||
课代表阿伟
|
||||
</li>
|
||||
</ul>
|
||||
</FAQItem>
|
||||
|
||||
<FAQItem title="赞助者们">
|
||||
<div>
|
||||
感谢至今以来所有的<a href="https://afdian.net/a/yunyoujun" class="text-purple" target="_blank">赞助者</a>们,你们的支持是我持续维护和开发新项目的动力!
|
||||
</div>
|
||||
<div pt-2>
|
||||
<a href="https://sponsors.yunyoujun.cn" target="_blank">
|
||||
<img src="https://sponsors.yunyoujun.cn/sponsors.svg">
|
||||
</a>
|
||||
</div>
|
||||
</FAQItem>
|
||||
</div>
|
||||
</div>
|
||||
<BaseFooter mt-4 />
|
||||
</template>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user