-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
199 lines (168 loc) · 5.44 KB
/
index.html
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RevoU Mini Software Engineering Class</title>
<style>
body {
margin: 0;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.header-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid black;
padding: 16px 24px;
}
.header-wrapper > .menu {
display: flex;
}
.header-wrapper > .menu > button {
background-color: white;
padding: 8px 16px;
border: 1px solid gray;
cursor: pointer;
transition: 0.3s background-color ease-out;
}
.header-wrapper > .menu > button:hover {
background-color: gainsboro;
}
.header-wrapper > .menu > button:first-child {
border-radius: 4px 0 0 4px;
}
.header-wrapper > .menu > button:last-child {
border-radius: 0 4px 4px 0;
}
.header-wrapper > .logo {
width: auto;
height: 40px;
}
.main-content {
padding: 24px;
}
.main-content .form-section {
display: flex;
justify-content: space-evenly;
align-items: start;
}
.main-content .form-section form,
.main-content .form-section div {
width: 100%;
}
.img-slideshow {
width: 100%;
}
@media only screen and (max-width: 600px) {
.header-wrapper {
flex-direction: column;
}
.menu {
width: 100%;
flex-direction: column;
}
.logo {
margin-bottom: 14px;
}
}
</style>
</head>
<body>
<header class="header-wrapper">
<img class="logo" alt="revou-logo" src="./logo.svg" />
<div class="menu">
<button>Homes</button>
<button>My Profile</button>
<button>Portfolio</button>
<button>Message Us</button>
</div>
</header>
<main class="main-content">
<h1>Hi <span id="nama">Ramadhan</span>, Welcome To Website</h1>
<!-- <script>
var name = prompt("Masukan nama kamu");
document.getElementById("nama").innerText = name;
</script> -->
<div>
<img
class="img-slideshow"
src="https://source.unsplash.com/random/1080x400?landscape&sig=1"
/>
<img
class="img-slideshow"
src="https://source.unsplash.com/random/1080x400?landscape&sig=2"
/>
<img
class="img-slideshow"
src="https://source.unsplash.com/random/1080x400?landscape&sig=3"
/>
<button onclick="plusDivs(-1)">Previous</button>
<button onclick="plusDivs(1)">Next</button>
</div>
<script>
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs((slideIndex += n));
}
function showDivs(n) {
var i;
var imgList = document.getElementsByClassName("img-slideshow");
if (n > imgList.length) slideIndex = 1;
else if (n < 1) slideIndex = imgList.length;
for (i = 0; i < imgList.length; i++) {
imgList[i].style.display = "none";
}
imgList[slideIndex - 1].style.display = "block";
}
setInterval(() => {
plusDivs(1);
}, 1000);
</script>
<div class="form-section">
<form name="message-form" onsubmit="return validateForm()">
Nama: <input placeholder="Nama" type="text" name="full-name" />
<br />
Tanggal Lahir:
<input type="date" name="birth-date" />
<br />
Jenis Kelamin:
<input type="radio" id="male" name="gender" value="Laki-laki" />
<label for="male">Laki-laki</label>
<input type="radio" id="female" name="gender" value="Perempuan" />
<label for="female">Perempuan</label>
<br />
Pesan:
<textarea placeholder="Pesan" name="messages"></textarea>
<br />
<input type="submit" value="Submit" />
</form>
<script>
function validateForm() {
var name = document.forms["message-form"]["full-name"].value;
var date = document.forms["message-form"]["birth-date"].value;
var gender = document.forms["message-form"]["gender"].value;
var messages = document.forms["message-form"]["messages"].value;
if (name == "" || date == "" || gender == "" || messages == "") {
alert("Input tidak boleh kosong");
return false;
}
document.getElementById("sender-full-name").innerText = name;
document.getElementById("sender-birth-date").innerText = date;
document.getElementById("sender-gender").innerText = gender;
document.getElementById("sender-messages").innerText = messages;
return false;
}
</script>
<div class="form-output">
<p>Nama: <span id="sender-full-name"></span></p>
<p>Tanggal Lahir: <span id="sender-birth-date"></span></p>
<p>Jenis Kelamin: <span id="sender-gender"></span></p>
<p>Pesan: <span id="sender-messages"></span></p>
</div>
</div>
</main>
</body>
</html>