Actions

Work Header

Rating:
Archive Warning:
Category:
Fandom:
Additional Tags:
Language:
English
Stats:
Published:
2023-12-17
Words:
806
Chapters:
1/1
Comments:
17
Kudos:
50
Bookmarks:
27
Hits:
1,565

How to Make Honkai: Star Rail Chat Logs

Summary:

A tutorial on how to mimic the chats in Honkai: Star Rail.

Notes:

(See the end of the work for notes.)

Work Text:

Direct message

Dan Heng
For anything related to the data bank, come find me.
Dan Heng
Found an old Express communication log in the data bank, and one of the categories is Dad Jokes.
Stelle
But why

Group chat

The Astral Express Family Stelle
Found a strange item...
Dan Heng
Relic.

March 7th
Relic

March 7th

Himeko
Relics

Welt
It's a Relic.

Stelle

Instructions

In your AO3 profile, go to 'Skins', then 'My Work Skins'. Create a new work skin if you aren't already using one for your work. In the CSS box, copy and paste the following:

      
#workskin .chatbox {
  width: 600px;
  font-family: "Bahnschrift", sans-serif;
  font-weight: bold;
  margin: auto;
  background-color: #D4D4D6;
  border-radius: 0px 20px 0px 0px;
  display: table;
}

#workskin .header {
  width: 600px;
  border-bottom: 2px solid #B8B8B8;
  text-align: left;
  border-radius: 0px 20px 0px 0px;
  color: #000000;
  padding-bottom: 5px;
  padding-left: 20px;
  padding-right: 0.5em;
  font-size: 18px;
  display: table;
}

#workskin .messagebody {
  display: table;
  padding-bottom: 1em;
}

#workskin .status {
  color: #707070;
  font-size: 14px;
}

#workskin .textname {
  color: #6B6B6B;
  float: left;
}

#workskin .textbox {
  float: left;
  margin: 0 0 0.5em;
  position: relative;
  max-width: 75%;
  padding: 0.5em;
}

#workskin .text {
  float: left;
  color: #000000;
  padding: 0.65em;
  border-radius: 0 1em 1em 1em;
  background: #EBEBEB;
}

#workskin .icon {
  max-width: 50px;
  float: left;
  border-radius: 50px;
  position: relative;
  margin-left: 20px;
  margin-right: 5px;
  margin-top: 15px;
  clear: both;
}

#workskin .replybox {
  float: right;
  margin: 0 0 0.5em;
  position: relative;
  max-width: 75%;
  padding: 0.5em;
}

#workskin .reply {
  color: #000000;
  margin: 0 0 0 0;
  float: right;
  border-radius: 1em 0 1em 1em;
  padding: 0.65em;
  background: #D4BA8B;
}

#workskin .replyname {
  color: #6B6B6B;
  float: right;
}

#workskin .replyicon {
  max-width: 50px;
  float: right;
  clear: both;
  border-radius: 50%;
  position: relative;
  margin-left: 5px;
  margin-right: 20px;
  margin-top: 15px;
}

#workskin .textimg {
  width: 30%;
}

#workskin .replyimg {
  width: 30%;
  float: right;
}
      
    

The code for the direct message looks like this:


<div class="chatbox">

<p class="messagebody">
<span class="header">Dan Heng<br />
<span class="status">For anything related to the data bank, come find me.</span></span>

<img class="icon" src="https://i.ibb.co/d5tXBhK/floydeel.jpg" />
<span class="textbox">
<span class="textname">Dan Heng</span><br />
<span class="text">Found an old Express communication log in the data bank, and one of the categories is Dad Jokes.</span></span>

<img class="replyicon" src="https://i.ibb.co/YTM1VZJ/Mostro-Lounge-icon.png" />
<span class="replybox">
<span class="replyname">Stelle</span><br />
<span class="reply">But why</span></span><br />
</p></div>

And the code for the group chat looks like this:


<div class="chatbox">

<p class="messagebody">
<span class="header">The Astral Express Family</span>

<img class="replyicon" src="https://i.ibb.co/YTM1VZJ/Mostro-Lounge-icon.png" />
<span class="replybox">
<span class="replyname">Stelle</span><br />
<span class="reply">Found a strange item...</span></span>

<img class="icon" src="https://i.ibb.co/d5tXBhK/floydeel.jpg" />
<span class="textbox">


<span class="textname">Dan Heng</span><br />
<span class="text">Relic.</span></span><br />

<img class="icon" src="https://i.ibb.co/fQ4sGb7/jadeshroom.png" />
<span class="textbox">
<span class="textname">March 7th</span><br />
<span class="text">Relic</span></span><br />

<img class="icon" src="https://i.ibb.co/fQ4sGb7/jadeshroom.png" />
<span class="textbox">
<span class="textname">March 7th</span><br />
<img class="textimg" src="https://play-lh.googleusercontent.com/1XS6XlOPJm2mXgbIA-hwnxU2opJF2ZAub8ALAVIudWipx85fS7_KcOT6nFcBHILLQho" /></span><br />

<img class="icon" src="https://i.ibb.co/M1xFWTq/octahat.png" />
<span class="textbox">
<span class="textname">Himeko</span><br />
<span class="text">Relics</span></span><br />

<img class="icon" src="hhttps://i.ibb.co/kmtG44w/starrogue.png" />
<span class="textbox">
<span class="textname">Welt</span><br />
<span class="text">It's a Relic.</span></span><br />
</p></div>

<imgclass="replyicon" src="https://i.ibb.co/YTM1VZJ/Mostro-Lounge-icon.png" />
<span class="replybox">
<span class="replyname">Stelle</span><br />
<img class="replyimg" src="https://upload-os-bbs.hoyolab.com/upload/2023/05/07/19225684/5d0d52f4a0ee30f65bc8eb66af85944f_436016556669249473.png" /></span><br />

Essentially, every chat box will be in a ''chatbox'' div, which controls the font and makes it centralised.

Right at the top of the ''messagebody'' element is the ''header'' element, which contains the name of the chat and optionally, the ''status''/bio of the person.

After that, every message is wrapped in a ''textbox'' (other people) or ''replybox'' (you). This might not be the most efficient method, but I was unable to come up with another way that would allow each person's icon to be aligned with the name and text.

The ''textimg'' image class should work for images sent by 'you' as well.

I am using images that I've already cropped for my fics here; You'll have to upload and link your own. Do note that the template will become strange if the images are not a square.

This format doesn't account for people using screen readers or turning off the creator's style, but you could probably use something similar to the reader and hide classes here.

It may not display that well on mobile.

Notes:

I'm probably never going to use this template myself, but it was done for a friend of mine

I hope others can get some use out of this too. Please lmk if you have any feedback/suggestions! I'm no professional so there are probably some suspicious coding practices here and there HAHAH

Edit 28/12/2023: Changed max-width and min-width in chatbox and header classes. Hopefully it won't display weirdly for shorter /onesided texts anymore.

Edit 14/7/2024: Something about trying to fix the header on mobile, but it still didn't work completely. Also all my images broke after discord changed the way their image links are, so I had to fix that too lol
Also added replyimg class, which is most definitely inefficient but until I fully understand how to make an entire division float right (and stay there!!) we can just roll with this (thanks to melancholyclover for pointing this out)

References:
Image version of the HSR chat template
This collection of work skins
Social Media Work Skin Template: Whatsapp

Extra:
• In June 2024, a chat generator website was launched. It is a lot closer to the actual game aesthetically, from what I can see