-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
152 lines (92 loc) · 4.38 KB
/
app.js
File metadata and controls
152 lines (92 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
function backGroundColor(){
var quickMsg = confirm("This is a Green website but you can change it to your favorite color :D ");
var favColor;
if (quickMsg == true) {
favColor = prompt("Please choose one (blue,red,yellow,purple,green)");
} else {
alert("You clicked on cancel!");
}
var colorResult='';
if (favColor == "blue") {
colorResult="#36669c";
} else if (favColor == "red") {
colorResult="#9c3636";
} else if (favColor == "yellow") {
colorResult="#c2c441";
} else if (favColor == "purple") {
colorResult="#683991";
} else {
colorResult="#3d9c64";
}
return colorResult;
}
document.body.style.backgroundColor=backGroundColor();
function areaFunc(){
var favPodcast = prompt('Choose an area to listen to their podcast: middleEast - southEastAsia - europe - worldWide ? ')
while (favPodcast !== "middleEast" && favPodcast !== "southEastAsia" && favPodcast !== "europe" && favPodcast !== "worldWide") {
favPodcast = prompt('only choose one of these areas! ');
}
var result='';
if (favPodcast == "worldWide") {
result ='<h3 style="color: white;text-align:center;font-size: 40px;">For a global podcast we suggest you to listen to <a href="#worldwidefm">Worldwide Fm</a></h3>';
} else if (favPodcast == "middleEast") {
result ='<h3 style="color: white;text-align:center;font-size: 40px;">For a podcast from the Middle east we suggest you to listen to <a href="#middleEast">Radio alhara</a></h3>';
} else if (favPodcast == "europe") {
result ='<h3 style="color: white;text-align:center;font-size: 40px;">For a podcast from Europe we suggest you to listen to <a href="#europe">Kiosk radio</a></h3>';
} else if (favPodcast == "southEastAsia") {
result='<h3 style="color: white;text-align:center;font-size: 40px;">For a podcast from Southeast Asia we suggest you to listen to <a href="#asia">Paddygroves</a></h3>';
}
return result;
}
document.write(areaFunc());
// for (var i = 0; i < radio; i++) {
// document.write('<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-radio.svg/1024px-Circle-icons-radio.svg.png" width="200px">');
// }
function songCounter(){
var radio = prompt("How many songs you listen to per day from 1 to 4 ?");
if (radio > 4) {
radio = 4;
}var countResult='';
for (var i = 1; i <= radio; i++) {
countResult +='<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-radio.svg/1024px-Circle-icons-radio.svg.png" width="100px">'+ i;
}
return countResult;
}
document.write(songCounter());
// document.write('<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-radio.svg/1024px-Circle-icons-radio.svg.png" width="100px">'+ i );
// }
// document.write('<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-radio.svg/1024px-Circle-icons-radio.svg.png" width="100px">'+ i );
// }
// var quickMsg=confirm("This is a Green website but you can change it to your favorite color :D ");
// var favColor=prompt("What is your Favorite color?");
// if (quickMsg = true) {
// if (favColor == "blue") {
// document.body.style.backgroundColor = "#36669c";
// } else if(favColor == "red"){
// document.body.style.backgroundColor = "#9c3636";
// } else if (favColor == "yellow"){
// document.body.style.backgroundColor = "#c2c441";
// } else if (favColor == "purple"){
// document.body.style.backgroundColor = "#683991";
// } else {
// alert("You pressed Cancel!");
// }
// }
// var favPodcast = prompt('Do you prefer Electronic music or Funk music ? ')
// while (favPodcast !== "Electronic music" && favPodcast !== "Funk music") {
// favPodcast = prompt('only choose Electronic music or Funk music');
// }
// if (favPodcast == "Electronic music") {
// document.write("<h3>For Electronic music we suggest you to listen to Paddygroves and Kosik radio </h3>");
// } else if (favPodcast == "Funk") {
// document.write("<h3>For Funk music we suggest you to listen to Worldwide fm and Purple planet </h3>");
// } else {
// document.write("<h3>only choose Electronic music or Funk music</h3>");
// }
// var radio = prompt("How many radio you listened to?");
// if (radio > 4){
// radio = 4;
// }
// for (var i = 0; i < radio; i++) {
// document.write('<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-radio.svg/1024px-Circle-icons-radio.svg.png" width="200px">');
// }