목차
바닐라 JS로 크롬 앱 만들기 (1)
: Create Chrome App with Vanilla JS → cavjs
6.0(과제로 미리 시청완료)
6.1 Background
- html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Momentum App</title>
<!-- <link rel="stylesheet" href="css/style.css"> -->
</head>
<body>
<form class="hidden" id="login-form">
<input required maxlength="15" type="text" placeholder="what is yout name?">
<button>Log In</button>
<a href="http://nomadcoders.co">Go to courses</a>
</form>
<h1 id="greeting" class="hidden"></h1>
<h2 id="clock">00:00:00</h2>
<div id="quote">
<span></span>
<span></span>
</div>
<!-- <img src="img/0.jpg" alt=""> -->
<script src="js/clock.js"></script>
<script src="js/greetings.js"></script>
<script src="js/quotes.js"></script>
<script src="js/background.js"></script>
</body>
</html>
-javascript
const images=["0.jpg","1.jpg","2.jpg"];
const chosenImage = images[Math.floor(Math.random()*images.length)];
// console.log(images);
const bgImage =document.createElement("img");
// console.log(bgImage);
bgImage.src = `img/${chosenImage}`;
// console.log(bgImage);
document.body.appendChild(bgImage);
6.2 Recap
-
'📝 배우고 익히기 + > 바닐라 JS로 크롬 앱 만들기' 카테고리의 다른 글
[바크앱] 10: 7.0-8.2 (1) | 2023.09.15 |
---|---|
[바크앱] 8: 5.0-5.3 (1) | 2023.09.14 |
[바크앱] 7: 4.0-4.7/6.0(과제강의) (1) | 2023.09.12 |
[바크앱] 5: 2.13 -2.15 , 3.6 - 3.8 (0) | 2023.09.09 |
[바크앱] 4: 3.0 - 3.5 (1) | 2023.09.08 |