A "controlling" man stabbed his ex-girlfriend and her new partner to death outside the shop where they worked, a court heard.
Andrew Saunders, 21, previously pleaded guilty to killing Matalan employees Zoe Morgan, 21, and Lee Simmons, 33.
The couple were found dead close to the fashion chain's store in Queen Street in Cardiff city centre on September 28.
At the start of his sentencing hearing today, Philip Bennetts QC, prosecuting, told Cardiff Crown Court that Morgan and Saunders had previously been in a relationship.
"Shortly before 6 in the morning Zoe Morgan and her partner, Lee Simmons, were standing outside their place of work, Matalan in Queen Street in Cardiff, when the defendant attacked Mr Simmons, stabbing him repeatedly with a knife," Bennett said.
"Zoe Morgan ran but the defendant caught up with her outside Boots where he repeatedly stabbed her.
"Zoe Morgan and Lee Simmons subsequently died as a result of their injuries."
Morgan and Saunders were together from June 2014 until July 2016, when she ended the relationship.
"Mark Morgan, her father, stated it was obvious from very early on in the relationship that Andy was very controlling to Zoe," Bennett said.
On one occasion, Morgan told her father that Saunders had "grabbed her around the throat" during an argument, the prosecutor added.
She began dating Simmons, who she met while working at Matalan, in July 2016.
When Morgan told Saunders their relationship was over, he accused her of cheating on him, adding: "You are definitely chatting to someone else. I will kill whoever it is."
The court heard Saunders began searching for revenge online and, days later, sent Morgan a photograph of the back of her house.
He told Morgan that he had contacted Simmons on Facebook, telling him that he would kill him and "smash his ****ing head in".
In further messages on the social networking site, Saunders was abusive to his ex-girlfriend but told her "I love you still as I just do".
Bennett said that in the weeks leading up to the murders, Saunders searched on Google for "the easiest way to kill a person", "how many years for killing a person", "16 steps to kill someone and not get caught" and "how long do murderers serve in prison".
Saunders also searched for guns and how to make pipe bombs, the court heard.
On September 20, Saunders purchased two knives and latex gloves from Morrisons. These were later used in the attack, Bennett said.
The court heard Saunders attempted to identify Simmons' car registration and discovered his full address, repeatedly looking at his Facebook profile.
On September 21, Saunders searched online for: "is it as easy to slice someone's throat as they make it look in movies and TV shows".
He also looked for "how to blow up a car without being caught" and "how can a car be rigged to explode when started".
Saunders visited Queen Street in the early hours of September 26, where he appeared agitated and asked a woman for a cigarette.
The following day, he purchased an air rifle and 500 pellets from a shop in Cardiff.
In the early hours of September 28, he searched online for "motivation for killing", "motivation for revenge" and "revenge motivational video".
"His final web searches were 'how to slice a neck' and 'how to smoke a cigar'," Bennett told the court.
Saunders left a letter at his home, suggesting that he was intending to take his own life.
"You know you are messed up when you think like I do," he wrote.
"Thinking of shooting up Cardiff every day for months and years is pretty dark.
"I think Isis is the good guys most of the time and that is just messed up. No one will forget me."
Saunders left his home at 4.41am and was seen standing by phone boxes near Matalan at 5.30am.
Saunders, with his hood up, was seen walking towards Matalan where Morgan and Simmons were waiting.
He took an eight-inch knife from his rucksack and began attacking Simmons, who was saying "please", "help, help, help" and "stop, stop".
"Zoe Morgan tried to pull the defendant off Mr Simmons," Bennett said.
Saunders told her to get off before warning her: "'I'm coming for you next'. At this point Mr Simmons struggled to his knees," Bennett said.
"The defendant punched him. Mr Simmons collapsed to the floor and did not move from that point.
"Zoe Morgan started screaming and she ran away." Saunders took a second knife, measuring about 25cm, from his rucksack and ran after Morgan.
After fatally stabbing her, Saunders walked "casually" up to Simmons and picked up the knife by him.
"The police and paramedics attended the scene," Bennett said. "There was a search for the defendant. He could not be found."
At 6.17am Saunders texted his father: "Thanks for being a pathetic, useless father. Just killed two people. Cheers."
His sister called emergency services, reporting that Saunders had arrived home with blood on him and had a gun, saying that he had killed Morgan and Simmons.
At 6.30am Saunders posted "F***" on Facebook, later adding: "Product of society."
Police arrested Saunders, who told them: "I'm sorry, you know sometimes you just snap," before asking "are they both dead?".
In custody, Saunders asked: "Are they both dead? I just want to know for peace of mind."
A post-mortem examination found Mr Simmons and Miss Morgan both suffered eight stab wounds.