Dynamic glass based on reversible metal electrodeposition