From 71ab4a120db05e055de864efd09d43e901ef8aaa Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sat, 28 May 2022 05:11:10 -0600 Subject: add support for gdscript for hljs, add wip flappy bird devlog --- static/hl/languages/gdscript.min.js | 7 ++++++- .../g/flappybird_godot/player_sprite_imports.png | Bin 0 -> 14996 bytes .../project_settings_config_properties.png | Bin 0 -> 82164 bytes .../project_settings_debug_gdscript.png | Bin 0 -> 101299 bytes .../project_settings_import_texture.png | Bin 0 -> 51986 bytes .../g/flappybird_godot/project_settings_input_map.png | Bin 0 -> 60055 bytes .../project_settings_layer_names_2d_physics.png | Bin 0 -> 72518 bytes .../project_settings_window_settings.png | Bin 0 -> 103138 bytes .../g/flappybird_godot/resource_dynamic_font.png | Bin 0 -> 42644 bytes .../resource_dynamic_font_directory_structure.png | Bin 0 -> 14388 bytes .../g/flappybird_godot/scene_game_node_setup.png | Bin 0 -> 18743 bytes .../images/g/flappybird_godot/scene_game_viewport.png | Bin 0 -> 26054 bytes .../g/flappybird_godot/scene_player_node_setup.png | Bin 0 -> 13859 bytes .../scene_player_sprite_sheet_importer.png | Bin 0 -> 20748 bytes .../scene_player_spriteframes_window.png | Bin 0 -> 18700 bytes ...ne_player_spriteframes_window_with_sprite_sheet.png | Bin 0 -> 20554 bytes static/images/g/flappybird_godot/scene_ui.png | Bin 0 -> 18175 bytes static/images/g/flappybird_godot/scene_world_tiles.png | Bin 0 -> 9289 bytes .../scene_world_tiles_directory_structure.png | Bin 0 -> 23080 bytes static/images/g/flappybird_godot/sfx_imports.png | Bin 0 -> 15869 bytes .../tile_map_cell_collision_configuration.png | Bin 0 -> 55789 bytes .../g/flappybird_godot/tile_set_available_tiles.png | Bin 0 -> 10944 bytes .../g/flappybird_godot/tile_set_config_window.png | Bin 0 -> 16750 bytes .../g/flappybird_godot/tile_set_new_single_tile.png | Bin 0 -> 39684 bytes .../tile_set_tile_selection_collision.png | Bin 0 -> 32280 bytes .../tile_set_tile_step_snap_options.png | Bin 0 -> 21751 bytes .../g/flappybird_godot/world_tiles_default_tiles.png | Bin 0 -> 52304 bytes static/scripts/hljs_gdscript_class.js | 7 +++++++ static/scripts/theme.js | 9 ++++++--- 29 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 static/images/g/flappybird_godot/player_sprite_imports.png create mode 100755 static/images/g/flappybird_godot/project_settings_config_properties.png create mode 100755 static/images/g/flappybird_godot/project_settings_debug_gdscript.png create mode 100755 static/images/g/flappybird_godot/project_settings_import_texture.png create mode 100755 static/images/g/flappybird_godot/project_settings_input_map.png create mode 100755 static/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png create mode 100755 static/images/g/flappybird_godot/project_settings_window_settings.png create mode 100755 static/images/g/flappybird_godot/resource_dynamic_font.png create mode 100755 static/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png create mode 100755 static/images/g/flappybird_godot/scene_game_node_setup.png create mode 100755 static/images/g/flappybird_godot/scene_game_viewport.png create mode 100755 static/images/g/flappybird_godot/scene_player_node_setup.png create mode 100755 static/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png create mode 100755 static/images/g/flappybird_godot/scene_player_spriteframes_window.png create mode 100755 static/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png create mode 100755 static/images/g/flappybird_godot/scene_ui.png create mode 100755 static/images/g/flappybird_godot/scene_world_tiles.png create mode 100755 static/images/g/flappybird_godot/scene_world_tiles_directory_structure.png create mode 100755 static/images/g/flappybird_godot/sfx_imports.png create mode 100755 static/images/g/flappybird_godot/tile_map_cell_collision_configuration.png create mode 100755 static/images/g/flappybird_godot/tile_set_available_tiles.png create mode 100755 static/images/g/flappybird_godot/tile_set_config_window.png create mode 100755 static/images/g/flappybird_godot/tile_set_new_single_tile.png create mode 100755 static/images/g/flappybird_godot/tile_set_tile_selection_collision.png create mode 100755 static/images/g/flappybird_godot/tile_set_tile_step_snap_options.png create mode 100755 static/images/g/flappybird_godot/world_tiles_default_tiles.png create mode 100644 static/scripts/hljs_gdscript_class.js (limited to 'static') 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 Binary files /dev/null and b/static/images/g/flappybird_godot/player_sprite_imports.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_config_properties.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_debug_gdscript.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_import_texture.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_input_map.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_layer_names_2d_physics.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/project_settings_window_settings.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/resource_dynamic_font.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/resource_dynamic_font_directory_structure.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_game_node_setup.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_game_viewport.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_player_node_setup.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_player_sprite_sheet_importer.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_player_spriteframes_window.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_player_spriteframes_window_with_sprite_sheet.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_ui.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_world_tiles.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/scene_world_tiles_directory_structure.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/sfx_imports.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_map_cell_collision_configuration.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_set_available_tiles.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_set_config_window.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_set_new_single_tile.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_set_tile_selection_collision.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/tile_set_tile_step_snap_options.png 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 Binary files /dev/null and b/static/images/g/flappybird_godot/world_tiles_default_tiles.png 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) -- cgit v1.2.3-70-g09d2