Home Events! Entrance Everyone Wiki Search Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
December 03, 2024 - @765.87 (what is this?)
Forum activity rating: Two Stars Posts: 24/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts    Start New Topic
News: :eyes: ~ Inconvenience is counterculture ~ :eyes:

+  MelonLand Forum
|-+  World Wild Web
| |-+  ♺ ∙ Web Crafting Materials
| | |-+  Easy-to-Edit GIF Toggle Button!


« previous next »
Pages: [1] Print
Author Topic: Easy-to-Edit GIF Toggle Button!  (Read 500 times)
zzzzz
Casual Poster ⚓︎
*


oops! i dont know what im doing

⛺︎ My Room
StatusCafe: ooops
iMood: ooops

View Profile WWW

Joined 2024!
« on: May 14, 2024 @69.05 »

After much help and more headache, I finally ironed out the GIF toggle button I was working on :ozwomp:
I know there's a few scripts for this around already, but ngl, I was STRUGGLING to get any of those to work, so I figured another one wouldn't hurt to have floating around.

The button:
- has 2 classes of images coded in; one class toggles between display:none/display:inline-block, the other toggles between blurred/unblurred
- also has 2 classes for the button that change on click, so hide/show can have different looks easily
- switches the text on click in a very simple way, keeping your HTML from getting messy and confusing (im easily confused, can you tell :tnt:)

Please let me know if you see any improvements to add, otherwise I hope some people find it useful~

You can find it on codepen here!

Logged

:evil: feeding the inner gremlin like they warned me not to :omg:
cavitycollector
Newbie ⚓︎
*


he/him // autistic webnoob

⛺︎ My Room
StatusCafe: cavitycollector
iMood: cavitycollector

View Profile WWW

Joined 2024!
« Reply #1 on: May 14, 2024 @89.10 »

this is great! i'd say the choice of class names is a bit confusing, "blur" being the end state of y and "flash" being the beginning state of x. i would either name y blur and x hide, or y nonFlashGif and x flashGif. for example, my site uses the class names "importantGif" for gifs that will continue to be displayed but turned safe, and "unimportantGif" for ones that will be hidden!

also its best to have the default state (what itll look like when you load up the page) as the safe version. this is definitely very easy to edit though, so if someone were to use it on their site theyd be able to change all that to their liking without issue; just would probably make it easier to understand! you did awesome, pre-written code that is easy to edit is a godsend always.  :happy:
Logged

[img width=100%]https://file.garden/ZVKAVGDEUWH6MWlN/ads%20%2B%20bumper%20stickers/this_message_1and0.png[/img]
zzzzz
Casual Poster ⚓︎
*


oops! i dont know what im doing

⛺︎ My Room
StatusCafe: ooops
iMood: ooops

View Profile WWW

Joined 2024!
« Reply #2 on: May 14, 2024 @173.55 »

Good notes! changing some variable names was quick, though the button text swap acts weird if I try to switch the order  :evil: so that will be solved later

I'm planning on also having an alert dialogue with buttons to opt in/out of GIF visibility before the page loads, so that one didn't even occur to me, good looks!
Logged

:evil: feeding the inner gremlin like they warned me not to :omg:
Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

we built this city on stolen gifs

Started by luluBoard ✁ ∙ Web Crafting

Replies: 8
Views: 3337
Last post September 15, 2024 @553.15
by TheMessengerVEVO
Some of my GIFS

Started by DojidaveBoard ➶ ∙ Art Gallery

Replies: 2
Views: 1680
Last post March 16, 2022 @762.07
by Karius
REQUEST: Day of week gifs

Started by MelooonBoard ✁ ∙ Web Crafting

Replies: 3
Views: 1314
Last post July 18, 2022 @885.64
by Pepyogurt

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies 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