Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 25 Sep 2026 - @558.74
Forum Activity: Four Stars Random | Recent Posts | Guild Recents
News: :4u: ~~~~~~~~~~~ Guild Events: weekly zine jam 13: hope
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  ♺ ∙ Snippets & Materials
| | | |-+  Simple Site Closer Script!


« previous next »
Pages: [1] 2 Print Embed
Author Topic: Simple Site Closer Script!  (Read 12808 times)
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
You're a Star!Flinstone VitaminWavy Shoulder-Length Hair with BangsBug!Top HatI got robbed by Dan Q on Melonland!
« on: Spring, 18 May 2023 @769 » Toggle Font Embed

Site Closer Script
I made a very simple script that will allow you to close your site on Mondays (or any other day) like my sites do!  :pc:

Update: Please check some of the subsequent posts and pages to get more advanced versions that people have posted that support more than just days.

It's not perfect because it depends on Javascript, so someone can bypass it if they disable JS, but since its mostly a fun feature I don't think that's actually a big deal!

To close your site on Mondays, just create your own closed.html page, then place this code on the HEAD of the page you wanna close (your index.html, or particular pages if you don't wanna close your whole site.)  :grin:

Code
<script src="https://melonking.net/scripts/site-closer.js"></script>
<script>
  // sc.closedPage = "closed.html"; // Optional: change the closed page URL
  // sc.closedDays = ["Monday"]; // Optional: change the days to close (default is Monday)
  shutItDown();
</script>

« Last Edit: Spring, 12 May 2026 @744 by Melooon » Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: black n cyan yappin kittayHave a chillpillMove it, football head!The Wizards OrbRed Tulip100 coins<3eyntivemds pet fishcurious fishPlank
Lyonid
Full Member ⚓︎
***
View Profile WWWArt


Controlled Chaos ~ Please be kind.
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: Lyonid
iMood: Lyonid
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
ArturFirst 1000 Members!Joined 2023!
« Reply #1 on: Spring, 18 May 2023 @786 » Toggle Font Embed

 :4u: I love this, this is so fun. I will draw a little picture of a closed laboratorium to make everyone on my site take a breather on Fridays. This is the first step towards a great labour union for internet protocols.

Logged

xx <3
https://img.flowergame.net/1111441.png

Artifact Swap: KnollCrystallized ExoskullShell Creature
Memory
Guest

« Reply #2 on: Spring, 10 Apr 2024 @971 » Embed

Thank melon!  :4u:  This is gonna make my site feel 100% more personal!... That is if I can revise it before Monday. Been months since I made a "true" update.

Logged
Memory
Guest

« Reply #3 on: Spring, 10 Apr 2024 @003 » Embed

[removed by author]

« Last Edit: Summer, 31 Jul 2024 @651 by Memory » Logged
Yaya
Sr. Member ⚓︎
****
View Profile WWW


⛺︎ My Room
StatusCafe: yaya

Guild Memberships:
Artifacts:
Live Slow Die YoungWelcome Back !Joined 2024!
« Reply #4 on: Spring, 10 Apr 2024 @083 » Embed

WOW~! Adding it now! This is so cool!

Logged
clowdywings
Casual Poster ⚓︎
*
View Profile WWW


transmasc cyberpunk ocs 🔛 🔝
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: clowdywings
iMood: clowdywings
Itch.io: My Games

Artifacts:
Joined 2024!
« Reply #5 on: Spring, 30 Apr 2024 @150 » Toggle Font Embed

oooh this is really cool, thanks for the code!

Logged

https://i.imgur.com/ySc4IY3.png
JINSBEK
Sr. Member ⚓︎
****
View Profile WWW


Yoroshiku.
⛺︎ My Room

Artifacts:
Great Posts PacmanJoined 2024!
« Reply #6 on: Winter, 08 Dec 2024 @985 » Toggle Font Embed

Hey, this is pretty cool. I always thought it was cool that Sprayground closed their website on Shabbat, and now we can, too. Haha. @VioletHeaven , take a look at this!
 :4u:

Logged

VioletHeaven
Casual Poster ⚓︎
*
View Profile WWW


Welcome to Acme Bunny Solutions!
⛺︎ My Room
StatusCafe: VioletHeaven
iMood: VioletHeaven

Artifacts:
Joined 2024!
« Reply #7 on: Winter, 10 Dec 2024 @927 » Toggle Font Embed

Hey, this is pretty cool. I always thought it was cool that Sprayground closed their website on Shabbat, and now we can, too. Haha. @VioletHeaven , take a look at this!
 :4u:
This script is awesome! I'm definitely going to use it to close my site for Shabbat, too! I really want my site to be fun and playful, and to gently remind myself (and others!) to take a break and disconnect. Plus I'll probably have a bunny of the week there, too!

Thank you for showing me this, Jinsbek!  :transport:

Logged

https://seabunny2006.neocities.org/bunnies/Illustration_200.png https://seabunny2006.neocities.org/media/anziop.gif
Kalka
Hero Member ⚓︎
*****
View Profile WWWArt


Go to the tanterwomps for they are lost in time
⛺︎ My Room
XMPP: Chat!

Guild Memberships:
Artifacts:
Cube StoneMurbyGreat Posts PacmanGiver of Many Welcomes!Joined 2024!
« Reply #8 on: Winter, 14 Jan 2025 @554 » Toggle Font Embed

So it only "close" the page of the website it is put on or does it "close" the sub domains as well ? Imagine I'm making some kind of tea-party or swimming pool page, putting the script on it would only close that page, right ?

Logged

http://internetometer.com/image/51289.png
Nova
Full Member ⚓︎
***
View Profile WWWArt


Cat, I'm a kitty cat, and I dance dance dance...
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: cielos-pasteles
Matrix: Chat!
XMPP: Chat!
iMood: Pastel_Skies
PicMix: Cielos-Pasteles
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Best Wishes and Good Luck for your GED !Joined 2025!
« Reply #9 on: Winter, 12 Feb 2025 @393 » Toggle Font Embed

I'm definitely adding this to my site.

But I am curious, how do you set it to it closes for a particular time zone? Considering the default is GMT.

Logged

https://file.garden/Z3biHjjyWGCd1efn/Nova_Galaxium_Button.gif
sen.fish
Casual Poster ⚓︎
*
View Profile WWW


⛺︎ My Room

« Reply #10 on: Winter, 12 Feb 2025 @459 » Embed

But I am curious, how do you set it to it closes for a particular time zone? Considering the default is GMT.

The getDay() method uses the local time zone! See: "The getDay() method of Date instances returns the day of the week for this date according to local time" (MDN docs). If you want to use a specific timezone, you could try this code (replacing timeZone: "America/New_York" with the time zone of your choice):

Code
var sc = {};
sc.closedPage = "closed.html";
sc.closedDays = ["Monday"];
sc.weekDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

var dayNow = new Date().toLocaleString("en-US", {
  timeZone: "America/New_York",
  weekday: 'long'
});

// Trigger this site closer!
function shutItDown() {
  sc.dayNow = new Date().toLocaleString("en-US", {timeZone: "America/New_York", weekday: 'long' });

  if (sc.closedDays.includes(sc.dayNow)) {
    console.log("Gordon Ramsay screams: Shut it Down!!!");
    window.location.replace(sc.closedPage);
  }
}

shutItDown();

Logged

Skykristal
Sr. Member ⚓︎
****
View Profile WWWArt


I may be dead but I am here
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: skykristal
iMood: skykristal

Guild Memberships:
Artifacts:
Uni-StarGreat Posts PacmanFirst 1000 Members!Joined 2023!
« Reply #11 on: Winter, 12 Feb 2025 @584 » Toggle Font Embed

ohh I didn't know you made this public. Very cool, thank you so much!  :4u: I will definitely use it in the future

Logged


Read My Blog ⋆。°✩ Punch my OCs  ⋆。°✩ View my Gallery

http://internetometer.com/imagesmall/50425.png
Nova
Full Member ⚓︎
***
View Profile WWWArt


Cat, I'm a kitty cat, and I dance dance dance...
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: cielos-pasteles
Matrix: Chat!
XMPP: Chat!
iMood: Pastel_Skies
PicMix: Cielos-Pasteles
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Best Wishes and Good Luck for your GED !Joined 2025!
« Reply #12 on: Spring, 22 Apr 2025 @315 » Toggle Font Embed

Coming into this again to ask how to add how long a website can be closed for (Isay like, 11 PM tp 9 AM).

Asking cuz a friend of mine is getting into building his own website, and he wants this JS not just to shut down his site on certain days but at certain hours too (he wants to do a silly thing akin to those "3 AM challenges" for his site lmao)

Logged

https://file.garden/Z3biHjjyWGCd1efn/Nova_Galaxium_Button.gif
Mono The Bun
Full Member ⚓︎
***
View Profile WWW


Sailing the vast sea of the internet
⛺︎ My Room
XMPP: Chat!
iMood: monoki_BUN_E

Guild Memberships:
Artifacts:
The One And Only MonokiJoined 2024!
« Reply #13 on: Spring, 04 May 2025 @952 » Toggle Font Embed

Implemented this onto my own site to close it on Sundays. Great way to remind people to take a break from the internet for a day. Lol

Logged
Corrupted Unicorn
Hero Member ⚓︎
*****
View Profile WWWArt


Unicorns aren't meant to stay forever
⛺︎ My Room
iMood: moodyunicorn

Guild Memberships:
Artifacts:
Unicorn of the InternetSurbypink pigeon prizeyou are un-bear-ably cool!Rainbow Noodle Dance!Scrafty, I choose you!
« Reply #14 on: Autumn, 23 Sep 2025 @635 » Toggle Font Embed

I'd love to see if other variants of the idea could be implemented. Can you close a site for certain hours? The entire year except one month, one week, one week, one hour, one minute?  :dunno:

Of course, sounds kinda counterproductive, but it could lead to some fun ideas, methinks  :tongue:

Logged

https://corruptedunicorn.neocities.org/images/gifs/robotuni.gif
https://i.gpx.plus/sFmfu/c15.png

Artifact Swap: From Tuffy with ❤️Stinger CreatureSnake CreatureFlower CreatureCrystalFeather StoneWave Stone
Pages: [1] 2 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
@000 Melon
Land
Index Recent Edits Tenement Arcade Forum Art Hub Chat Webring Want to Login or Join ?
Link Land Web Craft Guide Graphic Catalogue Wiki Newsletters Image Stream Help Im Lost! Zap! Minecraft: Online
Passport Sites Asatte Add your site?
Melonking MelonLand Aero Archive Onio Cafe 32 Bit Cafe Status Cafe