Skip to content

Commit

Permalink
search
Browse files Browse the repository at this point in the history
  • Loading branch information
evolsoulx committed Dec 6, 2023
1 parent cdb49ec commit 6cc7d0f
Show file tree
Hide file tree
Showing 15 changed files with 399 additions and 5 deletions.
31 changes: 31 additions & 0 deletions dysprosalt/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSV Reader Tool</title>
<!-- Reference to FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<!-- Reference to your Stylesheet -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>CSV Reader Tool</h1>
</header>
<main>
<input type="file" id="csvFileInput" accept=".csv">
<div id="validationStatus"></div> <!-- Area to display validation status -->
<div id="dataTable"></div> <!-- Container for the data table -->
</main>
<footer>
<p>CSV Reader Tool © 2023</p>
</footer>
<!-- Reference to jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Reference to PapaParse -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<!-- Reference to your JavaScript File -->
<script src="scripts.js"></script>
</body>
</html>
117 changes: 117 additions & 0 deletions dysprosalt/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
let jsonData = []; // Global variable to hold the JSON data
let testout;

var numTiers = 0;


document.getElementById('csvFileInput').addEventListener('change', (event) => {
const file = event.target.files[0];
Papa.parse(file, {
header: true, // Treat the first row as headers
complete: function(results) {
jsonData = results.data; // Convert CSV data to JSON
console.log(jsonData);
displayTable(jsonData);
validateData(jsonData);
generateDynamicDropdown(jsonData);

}
});
});



function displayTable(data) {
const table = document.createElement('table');
const thead = document.createElement('thead');
const tbody = document.createElement('tbody');

// Create table header
const headerRow = document.createElement('tr');
if (data.length > 0) {
Object.keys(data[0]).forEach(header => {
const th = document.createElement('th');
th.textContent = header;
headerRow.appendChild(th);
});
}
thead.appendChild(headerRow);

// Create table body
data.forEach((row, rowIndex) => {
const tr = document.createElement('tr');
Object.values(row).forEach(cell => {
const td = document.createElement('td');
td.textContent = cell;
tr.appendChild(td);
});
tbody.appendChild(tr);

// Highlight the row if it is invalid
if (!isRowValid(row)) {
tr.style.backgroundColor = 'red'; // Highlight the entire row
}
});

table.appendChild(thead);
table.appendChild(tbody);
document.getElementById('dataTable').innerHTML = ''; // Clear any previous data
document.getElementById('dataTable').appendChild(table);
}

function isRowValid(row) {
// Count populated cells in a row object
let populatedCells = 0;
Object.values(row).forEach(cell => {
if (cell.trim() !== '') {
populatedCells++;
}
});

// Check if more than two cells are populated in the row
return populatedCells <= 2;
}

function validateData(data) {
let isValidFile = true;
data.slice(1).forEach(row => {
if (!isRowValid(row)) {
isValidFile = false;
}
});

const statusElement = document.getElementById('validationStatus');
numTiers = Object.keys(jsonData[0]).length;
statusElement.textContent = isValidFile ? 'File is a valid '+parseInt(numTiers/2)+' tiered dynamic dropdown.' : 'File is invalid. Please check highlighted rows.';
statusElement.style.color = isValidFile ? 'green' : 'red';
}



function generateDynamicDropdown(data) {
// Example: Assume each row in the data has a 'category' and 'subcategory' field
let categories = {};
testout = data;
console.log("data: "+data)
data.forEach(row => {
if (row.category && row.subcategory) {
if (!categories[row.category]) {
categories[row.category] = [];
}
categories[row.category].push(row.subcategory);
}
});

// Now create a dropdown menu based on categories
let dropdown = '<select id="categorySelect">';
for (let category in categories) {
dropdown += `<optgroup label="${category}">`;
categories[category].forEach(subcategory => {
dropdown += `<option value="${subcategory}">${subcategory}</option>`;
});
dropdown += '</optgroup>';
}
dropdown += '</select>';

document.getElementById('dataTable').insertAdjacentHTML('afterend', dropdown);
}
14 changes: 14 additions & 0 deletions dysprosalt/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Add your CSS styles here */
body {
font-family: Arial, sans-serif;
}

header, footer {
text-align: center;
padding: 1em;
background-color: #f4f4f4;
}

main {
margin: 2em;
}
2 changes: 2 additions & 0 deletions godot/GodotMiniProjects/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
2 changes: 2 additions & 0 deletions godot/GodotMiniProjects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/
6 changes: 6 additions & 0 deletions godot/GodotMiniProjects/BalloonPopper/Balloon.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends Area3D

var clicksToPop : int = 3
var sizeIncrease : float = 0.2
var scoreValue : int = 1

59 changes: 59 additions & 0 deletions godot/GodotMiniProjects/BalloonPopper/BalloonPopper.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[gd_scene load_steps=8 format=3 uid="uid://dk17utktif2gs"]

[ext_resource type="Script" path="res://BalloonPopper/Balloon.gd" id="1_iyw13"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7ghci"]
albedo_color = Color(1, 0, 0, 1)
metallic = 0.85
metallic_specular = 0.24
metallic_texture_channel = 3
roughness = 0.2
rim_enabled = true
rim = 0.78
rim_tint = 0.8
clearcoat_enabled = true

[sub_resource type="SphereMesh" id="SphereMesh_k4erw"]

[sub_resource type="SphereShape3D" id="SphereShape3D_tfo1q"]

[sub_resource type="PrismMesh" id="PrismMesh_ne1ja"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v2q1e"]
albedo_color = Color(0.431373, 0.215686, 0, 1)

[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_lkiha"]
material = SubResource("StandardMaterial3D_v2q1e")
shape = 0
size = 0.05

[node name="Main" type="Node3D"]
transform = Transform3D(0.988477, 0, 0, 0, 0.988477, 0, 0, 0, 0.988477, 0, 0, 0)

[node name="Balloon" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0447183, 0)
script = ExtResource("1_iyw13")

[node name="sphereMesh" type="MeshInstance3D" parent="Balloon"]
transform = Transform3D(-0.997577, -0.0119507, -0.0685306, -0.0133845, 0.9997, 0.0205016, 0.0682651, 0.0213691, -0.997438, 0.00279832, 5.96046e-08, -0.00688982)
material_override = SubResource("StandardMaterial3D_7ghci")
mesh = SubResource("SphereMesh_k4erw")

[node name="sphereCollision" type="CollisionShape3D" parent="Balloon"]
shape = SubResource("SphereShape3D_tfo1q")

[node name="bottomMesh" type="MeshInstance3D" parent="Balloon"]
transform = Transform3D(0.213792, 0, 0, 0, 0.221636, 0, 0, 0, 0.116729, 0, -0.541416, 0)
material_override = SubResource("StandardMaterial3D_7ghci")
mesh = SubResource("PrismMesh_ne1ja")

[node name="MeshInstance3D" type="MeshInstance3D" parent="Balloon"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.935999, 0)
mesh = SubResource("RibbonTrailMesh_lkiha")

[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.9683, 0.249789, 0, -0.249789, 0.9683, 0, 1.15235, 3.89011)
fov = 86.7705

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.832902, 0.172366, -0.525894, 0, 0.950261, 0.311456, 0.553421, -0.259412, 0.791474, -4.72276, 3.28655, 9.76698)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://dmjcg37mrlljl"]

[resource]
albedo_color = Color(1, 0, 0, 1)
metallic = 0.85
metallic_specular = 0.24
metallic_texture_channel = 3
roughness = 0.2
rim_enabled = true
rim = 0.78
rim_tint = 0.8
clearcoat_enabled = true
1 change: 1 addition & 0 deletions godot/GodotMiniProjects/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions godot/GodotMiniProjects/icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cb2ofvijox614"
path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
12 changes: 12 additions & 0 deletions godot/GodotMiniProjects/new_standard_material_3d.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://dmjcg37mrlljl"]

[resource]
albedo_color = Color(1, 0, 0, 1)
metallic = 0.85
metallic_specular = 0.24
metallic_texture_channel = 3
roughness = 0.2
rim_enabled = true
rim = 0.78
rim_tint = 0.8
clearcoat_enabled = true
15 changes: 15 additions & 0 deletions godot/GodotMiniProjects/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=5

[application]

config/name="GodotMiniProjects"
config/features=PackedStringArray("4.1", "Forward Plus")
config/icon="res://icon.svg"
33 changes: 32 additions & 1 deletion nspsearch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,44 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nsp search</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Sanctuary Search:</h1>
<label for="seasonSelect">Season:</label>
<select id="seasonSelect" name="season">
<option value="Select One"></option>
<option value="S3">3</option>
<option value="S4">4</option>
<option value="S5">5</option>
<option value="S6">6</option>
<option value="S7">7</option>
<option value="S8">8</option>
<option value="S9">9</option>
<option value="S10">10</option>
<option value="S11">11</option>
<option value="S12">12</option>
<option value="S13">13</option>
<option value="S14">14</option>
<option value="S15">15</option>
<option value="S16">16</option>
<option value="S17">17</option>
<option value="S18">18</option>
<option value="S19">19</option>
<option value="20">20</option>
</select>

<!-- Episode Selector -->
<label for="episodeSelect">Episode:</label>
<select disabled="true" id="episodeSelect" name="episode">
<option value="">IN DEV</option>
</select>

<div id="results"></div>




<script src="js.js"></script>
</body>
</html>l
</html>
Loading

0 comments on commit 6cc7d0f

Please sign in to comment.