-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
180 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
[ | ||
{ | ||
"title": "《背影》节选", | ||
"author": "朱自清", | ||
"type": "散文", | ||
"length": "long", | ||
"content": "我说道,“爸爸,你走吧。”他望车外看了看,说,“我买几个橘子去。你就在此地,不要走动。”我看那边月台的栅栏外有几个卖东西的等着顾客。走到那边月台,须穿过铁道,须跳下去又爬上去。父亲是一个胖子,走过去自然要费事些。我本来要去的,他不肯,只好让他去。我看见他戴着黑布小帽,穿着黑布大马褂,深青布棉袍,蹒跚地走到铁道边,慢慢探身下去,尚不大难。可是他穿过铁道,要爬上那边月台,就不容易了。他用两手攀着上面,两脚再向上缩;他肥胖的身子向左微倾,显出努力的样子。这时我看见他的背影,我的泪很快地流下来了。我赶紧拭干了泪,怕他看见,也怕别人看见。我再向外看时,他已抱了朱红的橘子望回走了。过铁道时,他先将橘子散放在地上,自己慢慢爬下,再抱起橘子走。到这边时,我赶紧去搀他。他和我走到车上,将橘子一股脑儿放在我的皮大衣上。于是扑扑衣上的泥土,心里很轻松似的,过一会说,“我走了;到那边来信!”我望着他走出去。他走了几步,回过头看见我,说,“进去吧,里边没人。”等他的背影混入来来往往的人里,再找不着了,我便进来坐下,我的眼泪又来了。" | ||
}, | ||
{ | ||
"title": "《我与地坛》节选", | ||
"author": "史铁生", | ||
"type": "散文", | ||
"length": "long", | ||
"content": "如果以一天中的时间来对应四季,当然春天是早晨,夏天是中午,秋天是黄昏,冬天是夜晚。如果以乐器来对应四季,我想春天应该是小号,夏天是定音鼓,秋天是大提琴,冬天是圆号和长笛。要是以这园子里的声响来对应四季呢?那么,春天是祭坛上空漂浮着的鸽子的哨音,夏天是冗长的蝉歌和杨树叶子哗啦啦地对蝉歌的取笑,秋天是古殿檐头的风铃响,冬天是啄木鸟随意而空旷的啄木声。以园中的景物对应四季,春天是一径时而苍白时而黑润的小路,时而明朗时而阴晦的天上摇荡着串串杨花;夏天是一条条耀眼而灼人的石凳,或阴凉而爬满了青苔的石阶,阶下有果皮,阶上有半张被坐皱的报纸;秋天是一座青铜的大钟,在园子的西北角上曾丢弃着一座很大的铜钟,铜钟与这园子一般年纪,浑身挂满绿锈,文字已不清晰;冬天,是林中空地上几只羽毛蓬松的老麻雀。以心绪对应四季呢?春天是卧病的季节,否则人们不易发觉春天的残忍与渴望;夏天,情人们应该在这个季节里失恋,不然就似乎对不起爱情;秋天是从外面买一棵盆花回家的时候,把花搁在阔别了的家中,并且打开窗户把阳光也放进屋里,慢慢回忆慢慢整理一些发过霉的东西;冬天伴着火炉和书,一遍遍坚定不死的决心,写一些并不发出的信。还可以用艺术形式对应四季,这样春天就是一幅画,夏天是一部长篇小说,秋天是一首短歌或诗,冬天是一群雕塑。以梦呢?以梦对应四季呢?春天是树尖上的呼喊,夏天是呼喊中的细雨,秋天是细雨中的土地,冬天是干净的土地上的一只孤零的烟斗。" | ||
}, | ||
{ | ||
"title": "《关雎》", | ||
"author": "佚名", | ||
"type": "诗歌", | ||
"length": "medium", | ||
"content": "关关雎鸠,在河之洲。窈窕淑女,君子好逑。参差荇菜,左右流之。窈窕淑女,寤寐求之。求之不得,寤寐思服。悠哉悠哉,辗转反侧。参差荇菜,左右采之。窈窕淑女,琴瑟友之。参差荇菜,左右芼之。窈窕淑女,钟鼓乐之。" | ||
} | ||
] | ||
{ | ||
"long": [ | ||
{ | ||
"title": "《背影》节选", | ||
"author": "朱自清", | ||
"type": "散文", | ||
"length": "long", | ||
"content": "我说道,“爸爸,你走吧。”他望车外看了看,说,“我买几个橘子去。你就在此地,不要走动。”我看那边月台的栅栏外有几个卖东西的等着顾客。走到那边月台,须穿过铁道,须跳下去又爬上去。父亲是一个胖子,走过去自然要费事些。我本来要去的,他不肯,只好让他去。我看见他戴着黑布小帽,穿着黑布大马褂,深青布棉袍,蹒跚地走到铁道边,慢慢探身下去,尚不大难。可是他穿过铁道,要爬上那边月台,就不容易了。他用两手攀着上面,两脚再向上缩;他肥胖的身子向左微倾,显出努力的样子。这时我看见他的背影,我的泪很快地流下来了。我赶紧拭干了泪,怕他看见,也怕别人看见。我再向外看时,他已抱了朱红的橘子望回走了。过铁道时,他先将橘子散放在地上,自己慢慢爬下,再抱起橘子走。到这边时,我赶紧去搀他。他和我走到车上,将橘子一股脑儿放在我的皮大衣上。于是扑扑衣上的泥土,心里很轻松似的,过一会说,“我走了;到那边来信!”我望着他走出去。他走了几步,回过头看见我,说,“进去吧,里边没人。”等他的背影混入来来往往的人里,再找不着了,我便进来坐下,我的眼泪又来了。" | ||
}, | ||
{ | ||
"title": "《我与地坛》节选", | ||
"author": "史铁生", | ||
"type": "散文", | ||
"length": "long", | ||
"content": "如果以一天中的时间来对应四季,当然春天是早晨,夏天是中午,秋天是黄昏,冬天是夜晚。如果以乐器来对应四季,我想春天应该是小号,夏天是定音鼓,秋天是大提琴,冬天是圆号和长笛。要是以这园子里的声响来对应四季呢?那么,春天是祭坛上空漂浮着的鸽子的哨音,夏天是冗长的蝉歌和杨树叶子哗啦啦地对蝉歌的取笑,秋天是古殿檐头的风铃响,冬天是啄木鸟随意而空旷的啄木声。以园中的景物对应四季,春天是一径时而苍白时而黑润的小路,时而明朗时而阴晦的天上摇荡着串串杨花;夏天是一条条耀眼而灼人的石凳,或阴凉而爬满了青苔的石阶,阶下有果皮,阶上有半张被坐皱的报纸;秋天是一座青铜的大钟,在园子的西北角上曾丢弃着一座很大的铜钟,铜钟与这园子一般年纪,浑身挂满绿锈,文字已不清晰;冬天,是林中空地上几只羽毛蓬松的老麻雀。以心绪对应四季呢?春天是卧病的季节,否则人们不易发觉春天的残忍与渴望;夏天,情人们应该在这个季节里失恋,不然就似乎对不起爱情;秋天是从外面买一棵盆花回家的时候,把花搁在阔别了的家中,并且打开窗户把阳光也放进屋里,慢慢回忆慢慢整理一些发过霉的东西;冬天伴着火炉和书,一遍遍坚定不死的决心,写一些并不发出的信。还可以用艺术形式对应四季,这样春天就是一幅画,夏天是一部长篇小说,秋天是一首短歌或诗,冬天是一群雕塑。以梦呢?以梦对应四季呢?春天是树尖上的呼喊,夏天是呼喊中的细雨,秋天是细雨中的土地,冬天是干净的土地上的一只孤零的烟斗。" | ||
} | ||
], | ||
"medium": [ | ||
|
||
], | ||
"short": [ | ||
{ | ||
"title": "《关雎》", | ||
"author": "佚名", | ||
"type": "诗歌", | ||
"length": "medium", | ||
"content": "关关雎鸠,在河之洲。窈窕淑女,君子好逑。参差荇菜,左右流之。窈窕淑女,寤寐求之。求之不得,寤寐思服。悠哉悠哉,辗转反侧。参差荇菜,左右采之。窈窕淑女,琴瑟友之。参差荇菜,左右芼之。窈窕淑女,钟鼓乐之。" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,75 @@ | ||
<script setup lang="ts"> | ||
import YPinyin from '@/components/Pinyin.vue'; | ||
import { useConfigStore } from '@/store/config'; | ||
import { reactive } from 'vue'; | ||
import flatten from 'lodash/flatten'; | ||
Check failure on line 3 in src/view/QuoteLimit.vue GitHub Actions / build
|
||
// components | ||
import WordInput from '@/components/WordInput.vue'; | ||
// stores | ||
import { storeToRefs } from 'pinia'; | ||
const useConfig = useConfigStore(); | ||
import { useConfigStore } from '@/store/config'; | ||
// files | ||
import Sentence from '@/files/Sentence.json'; | ||
const useConfig = useConfigStore(); | ||
const { currentFont } = storeToRefs(useConfig); | ||
const state = reactive({ | ||
quote: {} as any, | ||
lastIndex: -1 | ||
}); | ||
state.quote = getRandomNonRepeatingElement(Object.values(Sentence)); | ||
function refresh() { | ||
state.quote = getRandomNonRepeatingElement(Object.values(Sentence)); | ||
} | ||
function getRandomNonRepeatingElement(arr: any[]) { | ||
arr = flatten(arr); | ||
if (arr.length === 0) { | ||
return null; | ||
} | ||
if (arr.length === 1) { | ||
return arr[0]; | ||
} | ||
let randomIndex: number = state.lastIndex; | ||
while (randomIndex === state.lastIndex) { | ||
randomIndex = Math.floor(Math.random() * arr.length); | ||
} | ||
state.lastIndex = randomIndex; | ||
return arr[randomIndex]; | ||
} | ||
</script> | ||
<template> | ||
<main :class="'y-font--' + currentFont"> | ||
<y-pinyin words="句子模式"></y-pinyin> | ||
<div class="y-quote-limit__refresh" @click="refresh">随机</div> | ||
|
||
<WordInput :quote="state.quote?.content"></WordInput> | ||
<div class="y-quote-limit__info"> | ||
—— | ||
<span class="y-quote-limit__info-title"> | ||
{{ state.quote?.title }} | ||
</span> | ||
- | ||
<span class="y-quote-limit__info-author"> | ||
{{ state.quote?.author }} | ||
</span> | ||
</div> | ||
</main> | ||
</template> | ||
<style lang="scss"> | ||
.y-quote-limit__refresh { | ||
cursor: pointer; | ||
} | ||
.y-quote-limit__info { | ||
margin-top: 30px; | ||
text-align: right; | ||
color: $gray-02; | ||
} | ||
</style> | ||
Oops, something went wrong.