Actions

Work Header

Rating:
Archive Warning:
Category:
Fandom:
Additional Tags:
Language:
English
Collections:
Fanfiction Reference Works, A Guide to Coding and Fanworks, Ao3 Skins, HTML & CSS stuffs
Stats:
Published:
2023-05-03
Completed:
2024-09-11
Words:
7,261
Chapters:
5/5
Comments:
30
Kudos:
139
Bookmarks:
122
Hits:
5,787

2023 Discord Theme Workskin

Chapter 5: Notification bars for phones

Notes:

Inspired by a comment, here are some notification bars for phones. This requires the use of the phone div class from the well-known text iMessage skin created by CodenameCarrot and La_Temperanza.

Technically, this isn't really part of the Discord skin anymore, but something that could work for a number of different situations where you would want alerts to pop up in your story.

(See the end of the chapter for more notes.)

Chapter Text

Within a Phone div class, you can have alert bars show up just like on your very own smartphone!

I based these notifications on how notifications appear on my own phone, but they may look a little different on yours.

Dark theme phone alerts:

DiscordUser 16:20

The quick brown fox jumps over the lazy dog.

WhatsAppUser 16:20

And so I cry sometimes when I'm lying in bed just to get it all out what's in my head and I, I am feeling a little peculiar

Light theme phone alerts:

DiscordUser 4:20pm

The quick brown fox jumps over the lazy dog.

WhatsAppUser 4:20pm

And so I cry sometimes when I'm lying in bed just to get it all out what's in my head and I, I am feeling a little peculiar

Now for some added fun, you can even have your character's phone display those annoying alerts from apps!

Night Owl Chest available! 6:30am

Tap to claim your reward now.

DoorDash 20m ago

How was your order? Share your thoughts and get a discount code!

UBER EATS 50m ago

Offer available: Get 10% off an XL mushroom pizza! Only at Mario & Luigi's Pizzeria for a limited time.

 

CSS FOR THE PHONE (From the iMessage texting workskin)

#workskin .phone {
  max-width: 300px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: table;
  margin: auto;
}

 Make sure to have this in a div environment before everything else! And please check out the original text message skin because it is extremely well-implemented and even works with creator's style turned off.

CSS FOR THE NOTIFICATIONS:

#workskin .notifdark {
  border-radius: 20px;
  background: #25242bAA;
  padding: 20px;
  padding-top: 15px;
  width: 300px;
  height: 35px;
  color: #ffffff;
  font-family: sans-serif;
  text-align: left;
  margin-bottom: 6px;
}

#workskin .notiflight {
  border-radius: 20px;
  background: #a29fb950;
  padding: 20px;
  padding-top: 15px;
  width: 300px;
  height: 35px;
  font-family: sans-serif;
  text-align: left;
  margin-bottom: 6px;
}

#workskin .notif-iconbox {
  border-radius: 50%;
  margin-left: 0px;
  float: left;
  height: 30px;
  width: 30px;
  margin-top: 0px;
}

#workskin .appcircle {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
  margin-left: 15px;
  margin-right: 0px;
  margin-top: -20px;
}

#workskin .notifname {
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: bold;
  font-size: 12px;
}

#workskin .notiftime {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  float: right;
}

#workskin .notiftext {
  margin: 0.5em;
  padding: 0;
  padding-left: 1em;
  overflow: hidden;
  max-height: 2.6em;
  line-height: 1.3em;
  text-overflow: ellipsis;
  font-size: 12px;
  margin-top: -5px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

#workskin .notiftitle {
  margin: 0.5em;
  padding: 0;
  padding-left: 1em;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  margin-top: -5px;
}

#workskin img.notificon {
  height: 30px;
  width: 30px;
  border-radius: 50%;
}

#workskin img.img_appcircle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-bottom: 20px;
}

The execution of this is pretty simple, unlike the rest of the Discord skin (which I as the person who had to make it still struggled to implement in places).

For app notifications, follow these steps:

  1. Phone in <div> environment
  2. "notifdark" or "notiflight" in another <div> environment inside the phone one.
  3. "notif-iconbox" in a <p> environment, with the image set to the app's logo. Close the <p> environment.
  4. "notiftitle" in a separate <p> environment. Within this environment, use <span> class "notiftitle" for the app or notification title, and "notiftime" for the time of the alert. Close the <p> environment.
  5. "notiftext" in a separate <p> environment. Put the alert's text inside this environment. Close the <p> environment.
  6.  Close up the div classes from before, unless you want another stacked alert, then leave the phone div class unclosed.

The HTML example:

<div class="phone">
<div class="notifdark">
<p class="notif-iconbox"><img class="notificon" src="https://i.imgur.com/RNEM6SC.png" /></p>
<p class="notiftitle"><span class="notifname">Night Owl Chest available!</span> <span class="notiftime"> 6:30am</span></p>
<p class="notiftext">Tap to claim your reward now.</p>
</div>
<div class="notifdark">
<p class="notif-iconbox"><img class="notificon" src="https://i.imgur.com/QkINx6U.png" /></p>
<p class="notiftitle"><span class="notifname">DoorDash</span> <span class="notiftime"> 20m ago</span></p>
<p class="notiftext">How was your order? Share your thoughts and get a discount code!</p>
</div>
</div>

For message notifications, follow these steps:

  1. Phone in <div> environment
  2. "notifdark" or "notiflight" in another <div> environment inside the phone one.
  3. "notif-iconbox" in a <p> environment, with the image set to the person/character's profile picture.
  4. "notif-appcircle" in a <span> class (NOT another paragraph environment!!), with the image set to the app's logo (i.e. Discord, WhatsApp, Facebook Messenger etc) Now, close the notif-iconbox <p> environment.
  5. "notiftitle" in a separate <p> environment. Within this environment, use <span> class "notiftitle" for the name or username, and "notiftime" for the time of the alert. Close the <p> environment.
  6. "notiftext" in a separate <p> environment. Put the alert's text inside this environment. Close the <p> environment.
  7. Close up the div classes from before, unless you want another stacked alert, then leave the phone div class unclosed.

The HTML example:

<div class="phone">
<div class="notifdark">
<p class="notif-iconbox"><img class="notificon" src="https://i.imgur.com/EJwar9D.png" /> <span class="appcircle"> <img class="img_appcircle" src="https://i.imgur.com/4TFWQVB.png" /> </span></p>
<p class="notiftitle"><span class="notifname">DiscordUser</span> <span class="notiftime"> 16:20</span></p>
<p class="notiftext">The quick brown fox jumps over the lazy dog.</p>
</div>
<div class="notifdark">
<p class="notif-iconbox"><img class="notificon" src="https://i.imgur.com/EJwar9D.png" /> <span class="appcircle"> <img class="img_appcircle" src="https://i.imgur.com/ScXiKiN.png" /> </span></p>
<p class="notiftitle"><span class="notifname">WhatsAppUser</span> <span class="notiftime"> 16:20</span></p>
<p class="notiftext">And so I cry sometimes when I'm lying in bed just to get it all out what's in my head and I, I am feeling a little peculiar</p>
</div>
</div>

 

Notes:

Hope you enjoyed this small addition! Thanks again to MelffyCafe for the suggestion in the comments!

Please note that the implementation as-is still has some hiccups, for example, not all of the webkit tools for CSS works for AO3 workskins, so the text-overflow: ellipsis doesn't actually show up for notiftext. I've emailed AO3 support about this. But this is only a minor aesthetic difference and the overflow text is hidden anyway, which is what we want to happen.