Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
csv-viewer-online committed Dec 4, 2024
0 parents commit 63482bf
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CSV Viewer Online
### [https://csv-viewer-online.github.io/](https://csv-viewer-online.github.io/)

### Used plugins:

- [PapaParse](https://github.com/mholt/PapaParse) for parsing CSV
- [handsontable](https://github.com/handsontable/handsontable) for showing the parsed data as a spreadsheet
32 changes: 32 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const input = document.getElementById('input-file')
const handsontableContainer = document.getElementById('handsontable-container')

input.onchange = function () {
const file = this.files[0]
const reader = new FileReader()

reader.onload = function (e) {
const csv = e.target.result
const data = Papa.parse(csv, {
header: true,
skipEmptyLines: true
})

// reset container
handsontableContainer.innerHTML = ''
handsontableContainer.className = ''
document.querySelector('input').remove()
document.querySelector('.sponsors').remove()

Handsontable(handsontableContainer, {
data: data.data,
rowHeaders: true,
colHeaders: data.meta.fields,
columnSorting: true,
width: '100%',
licenseKey: 'non-commercial-and-evaluation',
})
}

file && reader.readAsText(file)
}
Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!doctype html>
<head>
<title>CSV Viewer Online</title>
<link rel="icon" href="favicon.png">
<link rel="stylesheet" href="./styles.css">
<meta name="description" content="Super SIMPLE viewer for CSV files">
</head>

<body>
<div class="sponsors">
<a
href="https://tabootwin.com?utm_source=csv-viewer-online"
class="sponsor"
target="_blank"
rel="noopener"
aria-label="TabooTwin AI Girlfriend"
>
<img src="./tabootwin.png" width="300" height="100" alt="TabooTwin AI Girlfriend">
</a>
<div>
<a href="mailto:csv-viewer-online@tianon.mailer.me?subject=Advertising on CSV Viewer" class="place-your-ad-here">
Place YOUR AD HERE <br> 6.8k visitors monthly, $15/month
</a>
</div>
</div>

<input type="file" id="input-file" accept=".csv">

<div id="handsontable-container"></div>

<script src="https://cdn.jsdelivr.net/npm/handsontable@13/dist/handsontable.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/papaparse@5"></script>
<script src="./app.js?1"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@13/dist/handsontable.full.min.css">

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NVLYJXZFK6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-NVLYJXZFK6');
</script>
</body>
64 changes: 64 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
html, body {
height: 100%;
margin: 0;
}

* {
box-sizing: border-box;
}

body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

#handsontable-container.handsontable {
height: 100%;
}

.sponsors {
position: fixed;
top: 20px;
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 20px;
}

.sponsors a {
margin: 0 30px;
display: inline-flex;
flex-direction: column;
border-radius: 5px;
text-decoration: none;
max-width: calc(300px + 2*20px + 2*3px);
}

.sponsors a:hover {
text-decoration: underline;
}

.sponsors a span {
font-size: 14px;
margin-bottom: 18px;
text-align: center;
}

.sponsors div {
width: 100%;
text-align: center;
}

.place-your-ad-here {
display: inline-block;
border: 3px solid #126BCF;
border-radius: 5px;
color: #126BCF;
font-weight: bold;
padding: 10px 25px;
text-align: center;
line-height: 1.5;
}
Binary file added tabootwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 63482bf

Please sign in to comment.