-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit f0edd8c
Showing
4 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>練習</title> | ||
</head> | ||
<body> | ||
<p>ようこそ<span id="name">テスト</span>さん!</p> | ||
<p>あなたの運勢は<span id="result">大吉</span>です!</p> | ||
<img src="omikuji.png"> | ||
<script type="text/javascript" src="omikuji.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
let username; | ||
let userresult; | ||
|
||
username = prompt("お名前を教えて下さい。"); | ||
if (username == "") { | ||
username = "名無し"; | ||
} | ||
document.getElementById("name").innerHTML = username; | ||
|
||
let rand = Math.floor(Math.random() * 5); | ||
|
||
if (rand == 0) { | ||
userresult = "大吉"; | ||
} | ||
if (rand == 1) { | ||
userresult = "中吉"; | ||
} | ||
if (rand == 2) { | ||
userresult = "小吉"; | ||
} | ||
if (rand == 3) { | ||
userresult = "吉"; | ||
} | ||
if (rand == 4) { | ||
userresult = "凶"; | ||
} | ||
document.getElementById("result").innerHTML = userresult; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
img { | ||
height: 100px; | ||
}#name { | ||
color: blue; | ||
} | ||
|
||
#result { | ||
color: green; | ||
} |