Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
269 changes: 268 additions & 1 deletion css/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,270 @@
body {
margin: 20px;
}
}

/* ================================
Metadata Upload Section Styles
================================ */

#metadata-upload {
margin-bottom: 30px;
}

.upload-section {
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 8px;
padding: 25px;
margin-bottom: 20px;
}

.upload-section h3 {
margin-top: 0;
margin-bottom: 10px;
color: #333;
}

.upload-description {
color: #666;
margin-bottom: 20px;
}

/* Drop Zone Styles */
.upload-area {
border: 2px dashed #ccc;
border-radius: 8px;
padding: 40px 20px;
text-align: center;
background-color: #fff;
transition: all 0.3s ease;
cursor: pointer;
}

.upload-area:hover {
border-color: #0d6efd;
background-color: #f0f7ff;
}

.upload-area.drag-over {
border-color: #0d6efd;
background-color: #e7f1ff;
border-style: solid;
}

.upload-icon {
font-size: 48px;
margin-bottom: 15px;
}

.upload-area p {
margin: 10px 0;
color: #666;
}

.upload-btn {
display: inline-block;
padding: 10px 25px;
background-color: #0d6efd;
color: white;
border-radius: 5px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.2s ease;
}

.upload-btn:hover {
background-color: #0b5ed7;
}

.file-hint {
font-size: 12px;
color: #999;
margin-top: 10px !important;
}

/* File Info Display */
.file-info {
display: flex;
align-items: center;
justify-content: space-between;
background-color: #e7f1ff;
border: 1px solid #0d6efd;
border-radius: 5px;
padding: 10px 15px;
margin-top: 15px;
}

.file-info.hidden {
display: none;
}

#file-name {
color: #0d6efd;
font-weight: 500;
}

.btn-clear {
background: none;
border: none;
color: #dc3545;
cursor: pointer;
font-size: 18px;
padding: 0 5px;
}

.btn-clear:hover {
color: #b02a37;
}

/* Upload Submit Button */
.upload-submit {
margin-top: 15px;
width: 100%;
padding: 12px;
font-size: 16px;
background-color: #198754;
border: none;
color: white;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.2s ease;
}

.upload-submit:hover {
background-color: #157347;
}

.upload-submit:disabled {
background-color: #6c757d;
cursor: not-allowed;
}

.upload-submit.hidden {
display: none;
}

/* Validation Messages */
.validation-messages {
margin-top: 20px;
}

.validation-messages.hidden {
display: none;
}

.validation-error,
.validation-warning,
.validation-success {
border-radius: 5px;
padding: 15px;
margin-bottom: 10px;
}

.validation-error {
background-color: #f8d7da;
border: 1px solid #f5c2c7;
}

.validation-warning {
background-color: #fff3cd;
border: 1px solid #ffecb5;
}

.validation-success {
background-color: #d1e7dd;
border: 1px solid #badbcc;
}

.validation-header {
font-weight: bold;
margin-bottom: 10px;
font-size: 16px;
}

.error-header {
color: #842029;
}

.warning-header {
color: #664d03;
}

.success-header {
color: #0f5132;
}

.error-list,
.warning-list {
margin: 0;
padding-left: 20px;
}

.error-list li {
color: #842029;
margin-bottom: 5px;
}

.warning-list li {
color: #664d03;
margin-bottom: 5px;
}

.validation-success p {
margin: 0;
color: #0f5132;
}

/* ================================
Existing Form Styles
================================ */

#form-header {
margin-bottom: 20px;
}

#form-header h1 {
color: #333;
margin-bottom: 10px;
}

#form-header h2 {
color: #666;
font-weight: normal;
font-size: 18px;
}

#output {
margin-top: 30px;
padding: 20px;
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 8px;
}

#output label {
font-weight: bold;
margin-bottom: 10px;
display: block;
}

#json-result {
font-family: monospace;
font-size: 14px;
margin-bottom: 15px;
}

#output .btn-outline {
margin-right: 10px;
border: 1px solid #0d6efd;
color: #0d6efd;
background-color: white;
padding: 8px 20px;
border-radius: 5px;
cursor: pointer;
transition: all 0.2s ease;
}

#output .btn-outline:hover {
background-color: #0d6efd;
color: white;
}
40 changes: 26 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SDG Project Assessment Form</title>
<!-- USWDS not working -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -->
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> -->
Expand All @@ -25,7 +27,30 @@
<!-- Render the form -->
<script src="js/generateFormComponents.js"></script>
<script src="js/formDataToJson.js"></script>
<script src="js/metadataUpload.js"></script>
</head>
<body>
<div id="form-header"></div>

<!-- Metadata Upload Section -->
<div id="metadata-upload"></div>

<div id="formio"></div>

<div id="output">
<label for="json-result">Your Form Data </label>
<textarea class="form-control" rows="10" id="json-result" readonly></textarea>
<button type="button" class="btn btn-outline" href="#" onclick="copyToClipboard(event)">Copy</button>
<button type="button" class="btn btn-outline" href="#" onclick="downloadFile(event)">Download</button>
<button type="button" class="btn btn-outline" href="#" onclick="emailFile(event)">Email</button>
</div>

<script type="text/javascript">
// Initialize metadata upload component
document.addEventListener('DOMContentLoaded', function() {
initMetadataUpload();
});

createFormComponents()
.then((components) => {
Formio.createForm(document.getElementById("formio"), {
Expand All @@ -50,18 +75,5 @@
console.error("Error creating components:", error);
});
</script>
</head>
<body>
<div id="form-header"></div>

<div id="formio"></div>

<div id="output">
<label for="json-result">Your Form Data </label>
<textarea class="form-control" rows="10" id="json-result" readonly></textarea>
<button type="button" class="btn btn-outline" href="#" onclick="copyToClipboard(event)">Copy</button>
<button type="button" class="btn btn-outline" href="#" onclick="downloadFile(event)">Download</button>
<button type="button" class="btn btn-outline" href="#" onclick="emailFile(event)">Email</button>
</div>
</body>
</html>
Loading