How can you measure weight and/or mass through distance?
With a spring scale, the distortion of the spring is proportional to how much force it is exerting. If you measure that distortion, you can determine how hard it is pulling or pushing on whatever is attached to it. If it’s supporting the weight of an object, you can determine that object’s weight by measuring how far the spring distorts while supporting it.