diff --git a/htdocs/index.php b/htdocs/index.php index e3d7691..7f727a4 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -131,5 +131,6 @@ + diff --git a/htdocs/js/text-direction-switch.js b/htdocs/js/text-direction-switch.js new file mode 100644 index 0000000..4e3332d --- /dev/null +++ b/htdocs/js/text-direction-switch.js @@ -0,0 +1,16 @@ +const eTextDirectionSwitches = document.querySelectorAll(".text-direction-switch"); +const eTextDirectionTargets = document.querySelectorAll(".text-direction-target"); + +document.addEventListener("DOMContentLoaded", () => { + eTextDirectionSwitches.forEach(eSwitch => { + eSwitch.onclick = function() { + eTextDirectionTargets.forEach(eTarget => { + if(eTarget.style.direction === "rtl") { + eTarget.style.direction = 'ltr'; + } else { + eTarget.style.direction = 'rtl'; + } + }); + }; + }); +}); diff --git a/htdocs/parts/text_alignment.php b/htdocs/parts/text_alignment.php index 74c527b..67cfcc7 100644 --- a/htdocs/parts/text_alignment.php +++ b/htdocs/parts/text_alignment.php @@ -20,27 +20,27 @@ if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {

Left

-

Left

+

Left

t-left

Center

-

Centered

+

Centered

t-center

Right

-

Right

+

Right

t-right

Start

-

Start

+

Start

t-start

End

-

End

+

End

t-end @@ -50,5 +50,6 @@ if(basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) { - + +