A primary school and care home have teamed up to bring "joy across generations".