This zone is sleeping right now! ZzzZZzzz

Better not distrub it! ~You go to the petrol station and buy a slushy instead, everything is cool!~

This area will open again in 000.beats!

(Learn about Swatch Time)

Some other zones are awake :^]


Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
May 25, 2026 - @100.97 (what is this?)
Activity rating: Four Stars Posts & Arts: 52/1k.beats Random | Recent Posts | Guild Recents
News: There's a great big indie web tomorrow! :smile: Guild Events: Spring Themed Projects

+  MelonLand Forum
|-+  Materials & Info
| |-+  ♺ ∙ Web Crafting Materials
| | |-+  randomized fortune cookie generator element!


« previous next »
Pages: [1] Print Embed
Author Topic: randomized fortune cookie generator element!  (Read 880 times)
candycanearter07
Hero Member ⚓︎
*****
View Profile WWWArt


i like slimes
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
it's tbhchansey!Goomy, I Choose You!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« on: August 17, 2024 @164.13 » Embed

hiya!

so, i finally implemented my own fortune cookie thing and made it compatible with unix fortune!
for those who dont know, unix fortune database files are just plaintext seperated by newlines and a percent sign
theres a ton out there and i wanted to make them compatible with this so i implemented it to be supported!

a fortune file looks like this:
Code
quote 1
%
quote 2

if you make your own quote file make sure to add a newline between them because its hardcoded to remove the last character to cope with the newline

its super easy to implement too! just add this to your html:
Code
<script src="https://abslimeware.neocities.org/assets/js/unixfortune.js"></script>
<marquee onstart="updateFortune(this, 'path/to/fortunefile')"></marquee>

you can also replace the marquee with any element and replace onstart with onload, since it uses the first argument of the function to target which element to edit

edit: for clarification, updateFortune is just a wrapper to update the element pointed to by the first argument, if you want to immplement your own you can use fetchFortune('path/to/fortunefile') to just get the string
« Last Edit: August 17, 2024 @166.38 by candycanearter07 » Logged

new to oldnet be nice
https://status.cafe/users/candycanearter/badge.png https://abslimeware.neocities.org/assets/images/blinkers/penguins.gif

https://abslimeware.neocities.org/assets/images/blinkers/slimebounce.gif https://card.exophase.com/2/0/268504.png?1727352149

https://i.imgur.com/S1cx8ZZ.pnghttps://i.imgur.com/7ntZZGM.pnghttps://i.imgur.com/xKIpW2A.pnghttps://i.imgur.com/YMPbu9R.png

Artifact Swap: charry zardshoeDS Lover (replacement)Ball Creaturecards all the way down
Zunne
Jr. Member ⚓︎
**
View ProfileArt


Mmm... Hotdogs...
⛺︎ My Room
XMPP: Chat!

Guild Memberships:
Artifacts:
Joined 2024!
« Reply #1 on: November 21, 2024 @681.28 » Embed

what does it look like?
Logged

I wonder why i like ice cream so much?
candycanearter07
Hero Member ⚓︎
*****
View Profile WWWArt


i like slimes
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
it's tbhchansey!Goomy, I Choose You!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« Reply #2 on: November 21, 2024 @938.16 » Embed

Well, currently its broken, but it should just display a random quote, and reload every time the marquee resets. Maybe they changed how the onload() attr worked on firefox? idk
Logged

new to oldnet be nice
https://status.cafe/users/candycanearter/badge.png https://abslimeware.neocities.org/assets/images/blinkers/penguins.gif

https://abslimeware.neocities.org/assets/images/blinkers/slimebounce.gif https://card.exophase.com/2/0/268504.png?1727352149

https://i.imgur.com/S1cx8ZZ.pnghttps://i.imgur.com/7ntZZGM.pnghttps://i.imgur.com/xKIpW2A.pnghttps://i.imgur.com/YMPbu9R.png

Artifact Swap: charry zardshoeDS Lover (replacement)Ball Creaturecards all the way down
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
MelonLand @000

Want to Login or Join ?

Minecraft: Online
Join: craft.melonking.net