The best source of information is right in the Velo API documentation .
For your issue, you need to see Retrieve Repeater Item Data When Clicked .
As an example, let’s take your gallery1_itemClicked() function. You need to modify it to something like this:
export function gallery1_itemClicked(event) {
let $item = $w.at(event.context); // get repeated item scope selector
$item("#gallery1").next(); // use $item and not $w on this line
}
You should modify text1_click() similarly.