-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (104 loc) · 3.42 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kevin's avVIK</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 20px;
text-align: center;
}
h1 {
color: #333;
}
form {
margin-bottom: 30px;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
display: inline-block;
margin-left: auto;
margin-right: auto;
}
input, textarea, select, button {
font-size: 16px;
margin: 10px 0;
padding: 10px;
width: 100%;
max-width: 400px;
box-sizing: border-box;
}
button {
background-color: #007BFF;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.avvik-list {
margin-top: 20px;
text-align: left;
display: inline-block;
max-width: 500px;
width: 100%;
}
.avvik-item {
background: #fff;
padding: 15px;
margin-bottom: 10px;
border-radius: 6px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<h1>Kevins avVIK(er)</h1>
<form id="avvikForm">
<input type="text" id="name" placeholder="Navn" required>
<textarea id="description" placeholder="Hva skjedde?" required></textarea>
<select id="category">
<option value="Tafsing">Tafsing</option>
<option value="Sutring">Grining</option>
<option value="Hærverk">Ødela noe</option>
<option value="Annet">Annet</option>
</select>
<button type="submit">Registrer Avvik</button>
</form>
<div class="avvik-list" id="avvikList">
<h2>Registrerte avvik:</h2>
</div>
<script>
const avvikForm = document.getElementById('avvikForm');
const avvikList = document.getElementById('avvikList');
avvikForm.addEventListener('submit', function(event) {
event.preventDefault();
// Get form values
const name = document.getElementById('name').value;
const description = document.getElementById('description').value;
const category = document.getElementById('category').value;
const date = new Date().toLocaleDateString();
// Create avvik item
const avvikItem = document.createElement('div');
avvikItem.className = 'avvik-item';
avvikItem.innerHTML = `
<strong>Name:</strong> ${name}<br>
<strong>Description:</strong> ${description}<br>
<strong>Category:</strong> ${category}<br>
<strong>Date:</strong> ${date}
`;
// Add item to the list
avvikList.appendChild(avvikItem);
// Clear form
avvikForm.reset();
});
</script>
</body>
</html>