Linear Falloff
A blender geometry nodes group that attenuates an operator along an arbitrary axis.
You can input an axis for the falloff to work along. You can also specify the range across which the falloff acts, or use the automatic range functions which matches the range to the size of the selected geometry. There are options for reversing, clamping and mirroring the falloff to get the effect you are looking for. There isn't functionality for a non-linear falloff but you can open up the node group and insert a float curve node, should you wish.
To import a node group into blender, simply file-append the blender file onto your existing blender file. Navigate to the 'NodeTree' folder and select the 'Linear Falloff' node group. It will then be available in the groups section when adding new nodes to your geometry nodes tree.
A blender file