Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha260 authored Oct 9, 2024
1 parent 5bc75ff commit 21b7f0d
Show file tree
Hide file tree
Showing 5 changed files with 747 additions and 0 deletions.
99 changes: 99 additions & 0 deletions dark-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* Base styles */
body {
background-color: #a69999;
color: #000000;
font-family: sans-serif;
margin: 0;
padding: 0;
}

h1 {
font-size: 1.2em;
color: #000000;
}

/* Choose section */
#choose {
width: 100%;
text-align: right;
background-color: #696565;
margin: 0 0 1em;
padding: 1em;
}

#choose label {
color: #aaa;
}

#choose.big {
border: 1px solid #555;
padding: 2em 0;
text-align: center;
font-size: 1.2em;
}

#choose.big #source {
font-size: 1.5em;
color: #eee;
}

#chooseOption .row {
border-bottom: 1px dotted #444;
padding: 0.5em 0;
}

#chooseOption input,
#chooseOption select {
font-size: 0.9em;
color: #ddd;
}

/* View mode styles */
body.view #chooseOption {
display: none;
}

body.view h1 {
float: left;
font-size: 1em;
margin: 0.1em 0.5em;
color: #eee;
}

/* Print styles */
@media print {
.noprint {
display: none;
}

body {
margin: 1.5cm;
padding: 0;
background-color: #fff;
color: #000;
}

#f div.desc {
border: 1px solid #ddd !important;
margin: 0 0 0.5em !important;
padding: 0.3em !important;
font-size: 0.9em;
background-color: #eee;
}

#f div.info {
display: none;
}

#f {
page-break-inside: avoid;
}

svg {
height: 900px;
}

@page {
margin: 0;
}
}
45 changes: 45 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dark-theme.css">
<title>Flowgorithm file viewer</title>
<meta charset="utf-8">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="script.js?016"></script>
<script>
var config = {};
var xml;
function loadFile() {
var file = $('#source').get(0).files[0];
var reader = new FileReader();
reader.addEventListener("load", function() {
xml = reader.result;
config.groupInput = true; // Default grouping
config.aH = 12; // Default arrow length
config.aT = 7; // Default arrow tip size
config.itMode = 2; // Default pre-conditional iteration style (Flowgorithm)
config.viewDesc = true; // Default print description
config.labelTrue = "True"; // Default True label
config.labelFalse = "False"; // Default False label
drawFlowchartFromSource(xml, '#f', config);
$('#choose').removeClass('big');
$('body').addClass('view');
$('title').text($('#f div.title').text());
}, false);
if (file) {
reader.readAsText(file);
}
}
</script>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/canvg@3/dist/browser/canvg.min.js"></script>
<h1 class="noprint">Flowgorithm file viewer</h1>
<div id="choose" class="big noprint">
<label for="source">Select .fprg file</label>
<input type="file" onchange="loadFile()" id="source" accept=".fprg">
</div>
<div id="chooseOption" class="noprint" style="display: none;"> </div>
<div id="f"></div>
</body>
</html>
2 changes: 2 additions & 0 deletions lib/jquery-3.3.1.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/jquery-3.5.0.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 21b7f0d

Please sign in to comment.