Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
Fix css copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Canetti committed Mar 4, 2021
1 parent c85370a commit fdd360b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dist/parse.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 21 additions & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var timelineContent = '';

// Enable parse after file uploaded
$("#file").on("change", function () {
if($(this).val()) {
if ($(this).val()) {
$('#create').prop('disabled', false);
}
});
Expand Down Expand Up @@ -70,31 +70,34 @@ function parseFile(url, callBack) {
});
}

// Read file contents
function readLocalFile(file) {
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function () {
if (rawFile.readyState === 4) {
if (rawFile.status === 200 || rawFile.status == 0) {
var timelinescss = rawFile.responseText;
}
}
}
rawFile.send(null);
}

// Create ZIP and download
var downloadbtn = document.getElementById('download');
downloadbtn.addEventListener('click', getZIP);

function getZIP() {
var zip = new JSZip();
var timelinescss;

// Read file contents
function readLocalFile(file) {
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function () {
if (rawFile.readyState === 4) {
if (rawFile.status === 200 || rawFile.status == 0) {
timelinescss = rawFile.responseText;
}
}
}
rawFile.send(null);
}

// // Generate and populate scss directory
var scss = zip.folder("scss");
// Read _timeline.scss
readLocalFile("src/partials/_timeline.scss");
console.log(timelinescss)

// Generate and populate scss directory
var scss = zip.folder("scss");
console.log(timelinescss);
scss.file("_timeline.scss", timelinescss);

// Create html file
Expand Down

0 comments on commit fdd360b

Please sign in to comment.