官术网_书友最值得收藏!

  • JavaScript by Example
  • Dani Akash S
  • 317字
  • 2021-07-02 18:39:09

Initial project setup

Create a new folder for our Meme Creator application. Open up the folder in VSCode or any other text editor you are using for this project. Navigate to the folder in your terminal and run npm init. Just as we did in the previous chapter, fill in all the details asked for in the terminal, then hit Enter on Windows or return on Mac, and you will have your package.json file in the project root.

From the code files you downloaded for this book, open up the starter files folder for Chapter 2. You will see an index.html file. Copy and paste it into your new project folder. That's all for the starter files provided with this chapter, because there is not going to be a default CSS file. We are going to build the UI from scratch!

Create the files and folders we are going to use in this chapter. The folder structure should be as follows:

.
├── index.html
├── package.json
└── src
├── css
│ └── styles.css
└── js
├── general.js
└── memes.js

For now, leave the JS files empty. We are going to work on the styles.css file. Open up index.html in your browser (try using the http-server package we installed globally in the previous chapter). You should see an awkward looking page with some default Bootstrap styles applied using Bootstrap's classes. We are going to turn that page into a Meme Creator app, which looks as follows:

This web app is also going to be responsive. So, on your mobile devices, it should look as follows:

That blank box is going to be our canvas, which will preview the memes created with this app. Now that you have an idea of how the application will look, we'll start working on our styles.css file.

主站蜘蛛池模板: 砀山县| 梁平县| 曲水县| 江华| 漠河县| 出国| 曲沃县| 镇沅| 高台县| 汕尾市| 通许县| 丹江口市| 泰州市| 库伦旗| 玉田县| 乌兰县| 富平县| 英吉沙县| 新民市| 岫岩| 兴安县| 宁晋县| 民勤县| 辉南县| 沙雅县| 洛南县| 广昌县| 兴安盟| 桃源县| 中西区| 陆川县| 平遥县| 广河县| 灯塔市| 凯里市| 黎城县| 杭州市| 襄汾县| 高雄市| 黑山县| 黔西|