What have you always wanted to do in a welcome message?


#22

You can’t link to that font as dafont.com goes to a lot of effort to prevent hot linking. Your best bet is to download the font, unzip the file, and then stick it in a Github repo. You can then use something like rawgit.com to embed the font in your welcome message.


#23

Took me a bit to get around to it - but I added a menu like the Message Bot uses. There’s a new preset for it :slight_smile:

KP7 now has a guide for the icons - after that it’s just setting the width to 100% and the padding to 0.5em or so. Welcome Message Icons


#24

I really want to be able to remotely edit the headers for all the welcome messages i have created.
ie. being able to read from a github pages text file and automatically insert it into the head, or a div, of my welcome messages.


#25

That’s actually pretty easy :wink:

Example: Getting the style page I use for the WM Fiddle

fetch('https://bibliofile.github.io/Welcome-Message-Fiddle/dist/style.css')
  .then(r => r.text())
  .then(alert)

Example: Inserting the css into a new style element

<script>
fetch('https://bibliofile.github.io/Welcome-Message-Fiddle/dist/style.css')
  .then(r => r.text())
  .then(css => {
    document.head.appendChild(document.createElement('style')).innerHTML = css
  })
</script>

Unfortunately, fetch is only supported with new browsers, so iOS 8 for example won’t work. (Really, anything under 10.3) Thankfully, a simple polyfill fixes this. Add it before your script to get stuff.

<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js"></script>

#26

i already know how to insert css (plus there’s a easier way to do it -
<link rel="stylesheet" href="https://derpmarine168.github.io/blockheads/Standard.css" />)

but what i want is to be able to make uniform the header of all my pages.
for example, i want to be able to insert
https://derpmarine168.github.io/blockheads/notices.txt
into a p tag with the id notices.

and inset this:

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://derpmarine168.github.io/blockheads/Standard.css" /> 

into the bottom of my head element, or inside a div.

or if i was building a website, being able to insert the header or footer from another master document.


#27

I can do that for you


#28

I just used that as an example, inserting your notice also pretty easy. WM Fiddle

<p id="notices">Loading...</p>

<script>
  fetch('https://derpmarine168.github.io/blockheads/notices.txt')
  	.then(function (r) { return r.text() })
    .then(function (notice) {
      document.getElementById('notices').textContent = notice
  	})
</script>

Inserting this is really easy… there are a few ways you could do it. This is probably the simplest:

<script>
document.head.innerHTML += '<meta name="viewport" content="width=device-width, initial-scale=1.0">\n
<link rel="stylesheet" href="https://derpmarine168.github.io/blockheads/Standard.css" /> '
</script>

#29

Thanks so mutch! There are a million and one applications for this.


#30

If possible could you make these buttons go on the image instead of below and possibly text on the image at the same time and the buttons a tad bit round. Including the show more info button.


Could you possibly do this massive request?
edit: this has already been done.


#31

put this in the style for the buttons:

position: relative;
    left: 3px;
    top: 3px;

change the px up until the buttons overlay.
sorry if i’m not that helpful, but i can’t do more unless you send me your code.


#32

i can admin you and clone the code if you wish and make you admin to do your work.


#33

ok
il join.
edit: send me a invite please, as i cant find it on the server list.


#34

i lifted the whitelist and set it to search for you. any players that try to join except for you and the admins will be kicked


#35

oh thanks!
but it’s still not coming up
found it


#36

no problem


#37

is there a way to change the title tags with a similar script to the second example? and does that actually affect the title of the welcome message?


#38

Is it possible that I could do a slideshow without affecting the image size or the contents within?


#39

Sorry about that, I must have missed this in the rush of threads yesterday.

You can change the title tags, but it won’t change the title displayed in the popup.

<script>
document.head.querySelector('title').textContent = "Hello"
</script>

This should be fairly easy to do - can you send the HTML structure you use? Might slightly change how the script needs to work.


#40

thanks. that’s what i tried, was wondering if i was wrong. :glasses:


#42

Whole welcome message or image, button and text?