Initial commit
This commit is contained in:
17
index.html
Normal file
17
index.html
Normal file
@ -0,0 +1,17 @@
|
||||
!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>VCard Viewer</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>VCard Viewer</h1>
|
||||
<input type="file" id="vcardFile" accept=".vcf">
|
||||
<div id="vcardContent">
|
||||
<!-- VCard content will be displayed here -->
|
||||
</div>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
14
script.js
Normal file
14
script.js
Normal file
@ -0,0 +1,14 @@
|
||||
document.getElementById('vcardFile').addEventListener('change', function(event) {
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
const content = e.target.result;
|
||||
const vcardContentDiv = document.getElementById('vcardContent');
|
||||
// For now, just display the raw content.
|
||||
// We can implement more sophisticated parsing later.
|
||||
vcardContentDiv.textContent = content;
|
||||
};
|
||||
reader.readAsText(file);
|
||||
}
|
||||
});
|
||||
23
style.css
Normal file
23
style.css
Normal file
@ -0,0 +1,23 @@
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
margin: 20px;
|
||||
background-color: #f4f4f4;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
input[type="file"] {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#vcardContent {
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
padding: 15px;
|
||||
min-height: 100px;
|
||||
white-space: pre-wrap; /* Preserve line breaks and spaces */
|
||||
word-wrap: break-word; /* Break long lines */
|
||||
}
|
||||
Reference in New Issue
Block a user