freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/front-end-libraries-projects/build-a-random-quote-machin...

39 lines
3.8 KiB
Markdown
Raw Normal View History

---
id: bd7158d8c442eddfaeb5bd13
title: Build a Random Quote Machine
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 建立一个随机报价机
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/qRZeGZ" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/qRZeGZ</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSSBootstrapSASSReactRedux和jQuery的任意组合来完成此项目。您应该使用前端框架例如React因为本节是关于学习前端框架的。不建议使用上面未列出的其他技术使用它们的风险由您自行承担。我们正在寻求支持其他前端框架如Angular和Vue但目前不支持它们。我们将接受并尝试修复所有使用建议的技术堆栈的问题报告。快乐的编码 <strong>用户故事1</strong>我可以看到一个包含相应<code>id=&quot;quote-box&quot;</code>的包装元素。 <strong>用户故事2</strong><code>#quote-box</code> ,我可以看到一个具有相应<code>id=&quot;text&quot;</code>的元素。 <strong>用户故事3</strong><code>#quote-box</code> ,我可以看到一个具有相应<code>id=&quot;author&quot;</code>的元素。 <strong>用户故事4</strong><code>#quote-box</code> ,我可以看到一个具有相应<code>id=&quot;new-quote&quot;</code>的可点击元素。 <strong>用户故事5</strong><code>#quote-box</code> ,我可以看到一个可点击的<codea< code="">具有相应<code>id=&quot;tweet-quote&quot;</code>元素。 <strong>用户故事6</strong>首次加载时,我的报价机器会在元素中显示一个<code>id=&quot;text&quot;</code>的随机引号。 <strong>用户故事7</strong>首次加载时,我的报价机器在<code>id=&quot;author&quot;</code>的元素中显示随机引用的作者。 <strong>用户故事8</strong>当单击<code>#new-quote</code>按钮时,我的报价机应该获取一个新报价并将其显示在<code>#text</code>元素中。 <strong>用户故事9</strong>当单击<code>#new-quote</code>按钮并将其显示在<code>#author</code>元素中时,我的报价机器应该获取新报价的作者。 <strong>用户故事10</strong>我可以点击<code>#tweet-quote</code> <code>a</code>元素来<code>#tweet-quote</code> 。这<code>a</code>元素应包括<code>&quot;twitter.com/intent/tweet&quot;</code>路径在它的<code>href</code>属性鸣叫当前报价。 <strong>用户故事11</strong> <code>#quote-box</code>包装器元素应该水平居中。请使用浏览器的缩放级别100和页面最大化运行测试。您可以通过分叉<a href="http://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后将URL提交给您的工作通过所有测试的项目。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514" target="_blank">Read-Search-Ask</a>方法。 </codea<></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests: []
```
</section>
## Challenge Seed
<section id='challengeSeed'>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>