Home page popup proposal

@blake, John and Rod have asked for a short notice on the front page explaining what SC does. I don’t want to waste Home Page whitespace on this, so a one-time popup would seem to be the solution.

You mentioned to Dave that our handling of state had been historically inconsistent: I trust this is sorted now, at least for new implementations?

I’d like to have some sense of how this is going to behave. May I ask, if we use the same system as for the sidebar notification, what are the characteristics of it? I’m thinking things like, how reliable is it? So far, I haven’t seen the sign recur, but will that happen under some circumstances? Are there some platforms/devices that don’t support it? Anything else of interest?

Moving ahead, can we implement a splash popup for the Home page, intended for first-time visitors? It’ll be just a small bit of text, I’ll send you a mockup, nothing too fancy.

Incidentally, with the new design we should revise some of the things in the Home Page Introduction, which I’ll get on to, but it’s also a chance to squash the bug in the “translations” section of the introduction; it looks like js is inserting something it shouldn’t.

The method we use is pretty reliable, it’s called ‘localStorage’ http://caniuse.com/#search=localStorage

It obviously wont work if people use an incognito/private browser mode or disable webstorage in their browser (generally in this case, localStorage becomes like sessionStorage, it persists only until the browser is closed). Presumably people who do that are not surprised when a site remembers nothing of their previous visits.

Here’s my thoughts for implementing the Home page popup.


SuttaCentral is for anyone who has an interest in Buddhism and wants to delve deeper into the scriptures of the earliest period. We provide source texts and information for scholars, and translations for general readers.

Check the Introduction on this page to learn more about what we do and how it works.

For styling, center it vertically and horizontally, and apply the following:

box-shadow: same as sidebar-indicator popup;

With a shadowbox behind it. Click anywhere on the page, or on an X in the box, to make it go away.

Actually, I’ve had some more thoughts on this. If we have a popup, we are requiring an action from the user, which is not a good thing. Better to just include the text as part of the page, between the current heading and the random quote. We can still have it be there just the first time.

@blake, is there anything we need to get this happening ASAP?

I was thinking the same actually, I’ll get right on it.

Okay in the latest commit there is the introduction text as above.

Note that if you wish to see the introduction again, open inspect element and in the console tab run:
window.localStorage.setItem('sc.home.first_time_intro', '')

That will reset the thingy which is set on the first visit so on the next page load you’ll see the intro again.

Oh I should mention I made it replace the epigraph, I feel it works better that way, it looked way too cluttered with both the intro passage and the epigraph.

This is now implemented and works well. Thanks @blake.