summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2022-05-28 05:11:10 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2022-05-28 05:11:10 -0600
commit71ab4a120db05e055de864efd09d43e901ef8aaa (patch)
treee88f579b2f90eae66daefb916126d6949e16d55e /static
parent1c4d6ec6b49e8f80ccc46ee619caf5eba082f1e0 (diff)
add support for gdscript for hljs, add wip flappy bird devlog
Diffstat (limited to 'static')
-rw-r--r--static/hl/languages/gdscript.min.js7
-rwxr-xr-xstatic/images/g/flappybird_godot/player_sprite_imports.pngbin0 -> 14996 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_config_properties.pngbin0 -> 82164 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_debug_gdscript.pngbin0 -> 101299 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_import_texture.pngbin0 -> 51986 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_input_map.pngbin0 -> 60055 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_layer_names_2d_physics.pngbin0 -> 72518 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/project_settings_window_settings.pngbin0 -> 103138 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/resource_dynamic_font.pngbin0 -> 42644 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/resource_dynamic_font_directory_structure.pngbin0 -> 14388 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_game_node_setup.pngbin0 -> 18743 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_game_viewport.pngbin0 -> 26054 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_player_node_setup.pngbin0 -> 13859 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_player_sprite_sheet_importer.pngbin0 -> 20748 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_player_spriteframes_window.pngbin0 -> 18700 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.pngbin0 -> 20554 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_ui.pngbin0 -> 18175 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_world_tiles.pngbin0 -> 9289 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/scene_world_tiles_directory_structure.pngbin0 -> 23080 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/sfx_imports.pngbin0 -> 15869 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_map_cell_collision_configuration.pngbin0 -> 55789 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_set_available_tiles.pngbin0 -> 10944 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_set_config_window.pngbin0 -> 16750 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_set_new_single_tile.pngbin0 -> 39684 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_set_tile_selection_collision.pngbin0 -> 32280 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/tile_set_tile_step_snap_options.pngbin0 -> 21751 bytes
-rwxr-xr-xstatic/images/g/flappybird_godot/world_tiles_default_tiles.pngbin0 -> 52304 bytes
-rw-r--r--static/scripts/hljs_gdscript_class.js7
-rw-r--r--static/scripts/theme.js9
29 files changed, 19 insertions, 4 deletions
diff --git a/static/hl/languages/gdscript.min.js b/static/hl/languages/gdscript.min.js
index 3204130..2c56077 100644
--- a/static/hl/languages/gdscript.min.js
+++ b/static/hl/languages/gdscript.min.js
@@ -1 +1,6 @@
-hljs.registerLanguage("gdscript",function(){"use strict";var e=e||{};function r(e){return{aliases:["godot","gdscript"],keywords:{keyword:"and in not or self void as assert breakpoint class class_name extends is func setget signal tool yield const enum export onready static var break continue if elif else for pass return match while remote sync master puppet remotesync mastersync puppetsync",built_in:"Color8 ColorN abs acos asin atan atan2 bytes2var cartesian2polar ceil char clamp convert cos cosh db2linear decimals dectime deg2rad dict2inst ease exp floor fmod fposmod funcref get_stack hash inst2dict instance_from_id inverse_lerp is_equal_approx is_inf is_instance_valid is_nan is_zero_approx len lerp lerp_angle linear2db load log max min move_toward nearest_po2 ord parse_json polar2cartesian posmod pow preload print_stack push_error push_warning rad2deg rand_range rand_seed randf randi randomize range_lerp round seed sign sin sinh smoothstep sqrt step_decimals stepify str str2var tan tanh to_json type_exists typeof validate_json var2bytes var2str weakref wrapf wrapi bool int float String NodePath Vector2 Rect2 Transform2D Vector3 Rect3 Plane Quat Basis Transform Color RID Object NodePath Dictionary Array PoolByteArray PoolIntArray PoolRealArray PoolStringArray PoolVector2Array PoolVector3Array PoolColorArray",literal:"true false null"},contains:[e.NUMBER_MODE,e.HASH_COMMENT_MODE,{className:"comment",begin:/"""/,end:/"""/},e.QUOTE_STRING_MODE,{variants:[{className:"function",beginKeywords:"func"},{className:"class",beginKeywords:"class"}],end:/:/,contains:[e.UNDERSCORE_TITLE_MODE]}]}}return e.exports=function(e){e.registerLanguage("gdscript",r)},e.exports.definer=r,e.exports.definer||e.exports}()); \ No newline at end of file
+// as found in https://joshanthony.info/2021/07/01/how-to-add-gdscript-syntax-highlighting-to-your-blog/
+hljs.registerLanguage("gdscript",function(){"use strict";var e=e||{};function r(e){return{name:"GDScript",aliases:["godot","gdscript"],keywords:{keyword:"and in not or self void as assert breakpoint class class_name extends is func setget signal tool yield const enum export onready static var break continue if elif else for pass return match while remote sync master puppet remotesync mastersync puppetsync print",built_in:"Color8 ColorN abs acos asin atan atan2 bytes2var cartesian2polar ceil char clamp convert cos cosh db2linear decimals dectime deg2rad dict2inst ease exp floor fmod fposmod funcref get_stack hash inst2dict instance_from_id inverse_lerp is_equal_approx is_inf is_instance_valid is_nan is_zero_approx len lerp lerp_angle linear2db load log max min move_toward nearest_po2 ord parse_json polar2cartesian posmod pow preload print_stack push_error push_warning rad2deg rand_range rand_seed randf randi randomize range_lerp round seed sign sin sinh smoothstep sqrt step_decimals stepify str str2var tan tanh to_json type_exists typeof validate_json var2bytes var2str weakref wrapf wrapi bool int float String NodePath Vector2 Rect2 Transform2D Vector3 Rect3 Plane Quat Basis Transform Color RID Object NodePath Dictionary Array PoolByteArray PoolIntArray PoolRealArray PoolStringArray PoolVector2Array PoolVector3Array PoolColorArray",literal:"true false null"},contains:[e.NUMBER_MODE,e.HASH_COMMENT_MODE,{className:"comment",begin:/"""/,end:/"""/},e.QUOTE_STRING_MODE,{variants:[{className:"function",beginKeywords:"func"},{className:"class",beginKeywords:"class"}],end:/:/,contains:[e.UNDERSCORE_TITLE_MODE]}]}}return e.exports=function(e){e.registerLanguage("gdscript",r)},e.exports.definer=r,e.exports.definer||e.exports}());
+// directtly from the official source (which is ass): https://github.com/highlightjs/highlightjs-gdscript/blob/master/dist/gdscript.min.js
+// hljs.registerLanguage("gdscript",function(){"use strict";var e=e||{};function r(e){return{aliases:["godot","gdscript"],keywords:{keyword:"and in not or self void as assert breakpoint class class_name extends is func setget signal tool yield const enum export onready static var break continue if elif else for pass return match while remote sync master puppet remotesync mastersync puppetsync",built_in:"Color8 ColorN abs acos asin atan atan2 bytes2var cartesian2polar ceil char clamp convert cos cosh db2linear decimals dectime deg2rad dict2inst ease exp floor fmod fposmod funcref get_stack hash inst2dict instance_from_id inverse_lerp is_equal_approx is_inf is_instance_valid is_nan is_zero_approx len lerp lerp_angle linear2db load log max min move_toward nearest_po2 ord parse_json polar2cartesian posmod pow preload print_stack push_error push_warning rad2deg rand_range rand_seed randf randi randomize range_lerp round seed sign sin sinh smoothstep sqrt step_decimals stepify str str2var tan tanh to_json type_exists typeof validate_json var2bytes var2str weakref wrapf wrapi bool int float String NodePath Vector2 Rect2 Transform2D Vector3 Rect3 Plane Quat Basis Transform Color RID Object NodePath Dictionary Array PoolByteArray PoolIntArray PoolRealArray PoolStringArray PoolVector2Array PoolVector3Array PoolColorArray",literal:"true false null"},contains:[e.NUMBER_MODE,e.HASH_COMMENT_MODE,{className:"comment",begin:/"""/,end:/"""/},e.QUOTE_STRING_MODE,{variants:[{className:"function",beginKeywords:"func"},{className:"class",beginKeywords:"class"}],end:/:/,contains:[e.UNDERSCORE_TITLE_MODE]}]}}return e.exports=function(e){e.registerLanguage("gdscript",r)},e.exports.definer=r,e.exports.definer||e.exports}());
+// from a PR from the official source: https://github.com/highlightjs/highlightjs-gdscript/blob/fd74cbdb125a849d1f17f218703c64aa92c9360c/dist/gdscript.min.js
+// function GDScript(e){return{aliases:["godot","gdscript"],keywords:{keyword:"and in not or self void as assert breakpoint class class_name extends is func setget signal tool yield const enum export onready static var break continue if elif else for pass return match while remote sync master puppet remotesync mastersync puppetsync",built_in:"Color8 ColorN abs acos asin atan atan2 bytes2var cartesian2polar ceil char clamp convert cos cosh db2linear decimals dectime deg2rad dict2inst ease exp floor fmod fposmod funcref get_stack hash inst2dict instance_from_id inverse_lerp is_equal_approx is_inf is_instance_valid is_nan is_zero_approx len lerp lerp_angle linear2db load log max min move_toward nearest_po2 ord parse_json polar2cartesian posmod pow preload print_stack push_error push_warning rad2deg rand_range rand_seed randf randi randomize range_lerp round seed sign sin sinh smoothstep sqrt step_decimals stepify str str2var tan tanh to_json type_exists typeof validate_json var2bytes var2str weakref wrapf wrapi bool int float String NodePath Vector2 Rect2 Transform2D Vector3 Rect3 Plane Quat Basis Transform Color RID Object NodePath Dictionary Array PoolByteArray PoolIntArray PoolRealArray PoolStringArray PoolVector2Array PoolVector3Array PoolColorArray",literal:"true false null"},contains:[e.NUMBER_MODE,e.HASH_COMMENT_MODE,{className:"comment",begin:/"""/,end:/"""/},e.QUOTE_STRING_MODE,{variants:[{className:"function",beginKeywords:"func"},{className:"class",beginKeywords:"class"}],end:/:/,contains:[e.UNDERSCORE_TITLE_MODE]}]}}module.exports=GDScript; \ No newline at end of file
diff --git a/static/images/g/flappybird_godot/player_sprite_imports.png b/static/images/g/flappybird_godot/player_sprite_imports.png
new file mode 100755
index 0000000..27fa37f
--- /dev/null
+++ b/static/images/g/flappybird_godot/player_sprite_imports.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_config_properties.png b/static/images/g/flappybird_godot/project_settings_config_properties.png
new file mode 100755
index 0000000..2e74a4c
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_config_properties.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_debug_gdscript.png b/static/images/g/flappybird_godot/project_settings_debug_gdscript.png
new file mode 100755
index 0000000..1005ba6
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_debug_gdscript.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_import_texture.png b/static/images/g/flappybird_godot/project_settings_import_texture.png
new file mode 100755
index 0000000..60462d0
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_import_texture.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_input_map.png b/static/images/g/flappybird_godot/project_settings_input_map.png
new file mode 100755
index 0000000..9272a53
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_input_map.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png b/static/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png
new file mode 100755
index 0000000..3eb6f12
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/project_settings_window_settings.png b/static/images/g/flappybird_godot/project_settings_window_settings.png
new file mode 100755
index 0000000..41a7c66
--- /dev/null
+++ b/static/images/g/flappybird_godot/project_settings_window_settings.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/resource_dynamic_font.png b/static/images/g/flappybird_godot/resource_dynamic_font.png
new file mode 100755
index 0000000..b14a308
--- /dev/null
+++ b/static/images/g/flappybird_godot/resource_dynamic_font.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png b/static/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png
new file mode 100755
index 0000000..889637e
--- /dev/null
+++ b/static/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_game_node_setup.png b/static/images/g/flappybird_godot/scene_game_node_setup.png
new file mode 100755
index 0000000..c9e2eb4
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_game_node_setup.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_game_viewport.png b/static/images/g/flappybird_godot/scene_game_viewport.png
new file mode 100755
index 0000000..5348959
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_game_viewport.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_player_node_setup.png b/static/images/g/flappybird_godot/scene_player_node_setup.png
new file mode 100755
index 0000000..97079df
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_player_node_setup.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png b/static/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png
new file mode 100755
index 0000000..d37d961
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_player_spriteframes_window.png b/static/images/g/flappybird_godot/scene_player_spriteframes_window.png
new file mode 100755
index 0000000..0bb2dc9
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_player_spriteframes_window.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png b/static/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png
new file mode 100755
index 0000000..a06876e
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_ui.png b/static/images/g/flappybird_godot/scene_ui.png
new file mode 100755
index 0000000..0cc71f1
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_ui.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_world_tiles.png b/static/images/g/flappybird_godot/scene_world_tiles.png
new file mode 100755
index 0000000..196569e
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_world_tiles.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/scene_world_tiles_directory_structure.png b/static/images/g/flappybird_godot/scene_world_tiles_directory_structure.png
new file mode 100755
index 0000000..1e0d649
--- /dev/null
+++ b/static/images/g/flappybird_godot/scene_world_tiles_directory_structure.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/sfx_imports.png b/static/images/g/flappybird_godot/sfx_imports.png
new file mode 100755
index 0000000..5a8df56
--- /dev/null
+++ b/static/images/g/flappybird_godot/sfx_imports.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_map_cell_collision_configuration.png b/static/images/g/flappybird_godot/tile_map_cell_collision_configuration.png
new file mode 100755
index 0000000..0994261
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_map_cell_collision_configuration.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_set_available_tiles.png b/static/images/g/flappybird_godot/tile_set_available_tiles.png
new file mode 100755
index 0000000..654a797
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_set_available_tiles.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_set_config_window.png b/static/images/g/flappybird_godot/tile_set_config_window.png
new file mode 100755
index 0000000..b68459e
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_set_config_window.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_set_new_single_tile.png b/static/images/g/flappybird_godot/tile_set_new_single_tile.png
new file mode 100755
index 0000000..225170b
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_set_new_single_tile.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_set_tile_selection_collision.png b/static/images/g/flappybird_godot/tile_set_tile_selection_collision.png
new file mode 100755
index 0000000..6653335
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_set_tile_selection_collision.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/tile_set_tile_step_snap_options.png b/static/images/g/flappybird_godot/tile_set_tile_step_snap_options.png
new file mode 100755
index 0000000..92ab21b
--- /dev/null
+++ b/static/images/g/flappybird_godot/tile_set_tile_step_snap_options.png
Binary files differ
diff --git a/static/images/g/flappybird_godot/world_tiles_default_tiles.png b/static/images/g/flappybird_godot/world_tiles_default_tiles.png
new file mode 100755
index 0000000..a7523fd
--- /dev/null
+++ b/static/images/g/flappybird_godot/world_tiles_default_tiles.png
Binary files differ
diff --git a/static/scripts/hljs_gdscript_class.js b/static/scripts/hljs_gdscript_class.js
new file mode 100644
index 0000000..3feb099
--- /dev/null
+++ b/static/scripts/hljs_gdscript_class.js
@@ -0,0 +1,7 @@
+// this is a dirty solution as I wasn't able to add actual gdscript functionality as described
+// in the hljs documentation... I'm too dumb I guess
+// no longer required, i'm directly using what i found here: https://joshanthony.info/2021/07/01/how-to-add-gdscript-syntax-highlighting-to-your-blog/
+document.addEventListener("DOMContentLoaded", function(event) {
+ let a = document.getElementsByClassName("language-gdscript");
+ [...a].forEach(x => x.className = "hljs gdscript");
+}) \ No newline at end of file
diff --git a/static/scripts/theme.js b/static/scripts/theme.js
index 9036698..a107101 100644
--- a/static/scripts/theme.js
+++ b/static/scripts/theme.js
@@ -1,7 +1,10 @@
-// refactored code for a better solution found in https://medium.com/@haxzie/dark-and-light-theme-switcher-using-css-variables-and-pure-javascript-zocada-dd0059d72fa2
+// refactored code for a better solution found in:
+// https://medium.com/@haxzie/dark-and-light-theme-switcher-using-css-variables-and-pure-javascript-zocada-dd0059d72fa2
var local_storage = window.localStorage;
-window.onload = () => {
+// changed window.onload to document.addEventListener, as suggested here:
+// https://stackoverflow.com/a/800010
+document.addEventListener("DOMContentLoaded", function(event) {
let theme = local_storage.getItem('theme');
if(theme == null){
@@ -15,7 +18,7 @@ window.onload = () => {
setTheme('theme-light');
}
}
-}
+})
function setTheme(themeName){
local_storage.setItem('theme', themeName)