Skip to content

Commit

Permalink
fix savedata malfunction
Browse files Browse the repository at this point in the history
  • Loading branch information
face-hh committed Mar 19, 2024
1 parent 5a6ae35 commit 9a29e5a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Scripts/file_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func _on_file_dialog_file_selected(path: String) -> void:
%Intro.hide()

func inject_lua() -> void:
DirAccess.make_dir_absolute("user://themes")
DirAccess.make_dir_absolute("user://langs")

var themes = DirAccess.open("res://Lua/Themes").get_files()
var plugins = DirAccess.open("res://Lua/Plugins").get_files()

Expand Down
57 changes: 57 additions & 0 deletions Tools/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export function animate(animationName, animationDuration, fontSizeIncrease) {
const container = document.querySelector('.container');

// Check if container exists
if (!container) {
console.error("Couldn't find container. Thrown by Cheugy");
return;
}

const elements = Array.from(container.querySelectorAll('h1, p'));
const styleElement = document.createElement('style');
document.head.appendChild(styleElement);
const stylesheet = styleElement.sheet;

const keyframes = `
@keyframes ${animationName} {
0%, 100% {
font-size: calc(initial + 1em);
}
50% {
font-size: ${fontSizeIncrease}em;
}
}
`;

// Insert the keyframes into the stylesheet
stylesheet.insertRule(keyframes, stylesheet.cssRules.length);

elements.forEach(element => {
const words = element.textContent.split(' ');
const randomIndex = Math.floor(Math.random() * words.length);
const originalWord = words[randomIndex];

const animatedWord = `
<span
class="text-element"
style="animation: ${animationName} ${animationDuration}s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;"
>${originalWord}</span>
`;

words[randomIndex] = animatedWord;
element.innerHTML = words.join(' ');

const animatedElement = element.querySelector('.text-element');

// Check if animatedElement exists
if (!animatedElement) {
console.error("Couldn't find animated element. Thrown by Cheugy");
return;
}

animatedElement.addEventListener('animationend', () => {
words[randomIndex] = originalWord;
element.innerHTML = words.join(' ');
});
});
}
Binary file added output.ogv
Binary file not shown.
5 changes: 5 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"Hello"
function face() {
var hello = 3
hello
}

0 comments on commit 9a29e5a

Please sign in to comment.