Skip to content

Comments

Allow to select an example on the front page#1777

Merged
dlang-bot merged 3 commits intodlang:masterfrom
wilzbach:example-selecting
Jun 30, 2017
Merged

Allow to select an example on the front page#1777
dlang-bot merged 3 commits intodlang:masterfrom
wilzbach:example-selecting

Conversation

@wilzbach
Copy link
Contributor

Marking this as "needs work" as I will to rebase this once we agree on #1775

image

image

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 27, 2017

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Contributor Author

Alrighty, finally thanks to the minimal solution in #1775 this should be ready.

@CyberShadow
Copy link
Member

First: Diff looks great! Thanks for not giving up.

Dropdown looks a bit weird for me, any idea why?

@wilzbach wilzbach force-pushed the example-selecting branch from 4a87735 to 034b889 Compare June 28, 2017 02:22
@wilzbach
Copy link
Contributor Author

Okay, I think we can fix this by providing our own selector symbol from FontAwesome.
However, there are still UI differences:

Chrom(ium):

image

Firefox:

image

@CyberShadow
Copy link
Member

Alright, but why is that necessary? Why isn't the browser rendering the arrow?

@wilzbach
Copy link
Contributor Author

Alright, but why is that necessary? Why isn't the browser rendering the arrow?

Without it looked really ugly in my Firefox:

image

@CyberShadow
Copy link
Member

Without it looked really ugly in my Firefox:

That's because we're setting the background color. If we exclude that block from having its color and background color set, it should use the native styling... with the downside that it will look a little weird to people who have their browsers set to have a light-on-dark color theme by default. I don't think we need to worry about that, as long as the website is not unusable to them.

@CyberShadow
Copy link
Member

I guess either way works, but if possible, I think it would be better to not rely on font-awesome for the front page.

@wilzbach
Copy link
Contributor Author

If we exclude that block from having its color and background color set, it should use the native styling... with the downside that it will look a little weird to people who have their browsers set to have a light-on-dark color theme by default. I don't think we need to worry about that, as long as the website is not unusable to them.

That wouldn't look good:

image

I actually tried to be close to styling of the "Install X" boxes.

I guess either way works, but if possible, I think it would be better to not rely on font-awesome for the front page.

FWIW we already rely on it:

image

AFAICT it's the only way to ensure a consistent experience across different browsers.

@CyberShadow
Copy link
Member

That wouldn't look good:

No, that's not right. You're trying to undo the background rule with another background rule, right? That's not going to work. There must be no background rule in effect at all.

@CyberShadow
Copy link
Member

FWIW we already rely on it:

Ah, that's right.

@CyberShadow
Copy link
Member

Seb do you want to try the no-CSS approach or should we go forward with the current FontAwesome version?

@wilzbach
Copy link
Contributor Author

Seb do you want to try the no-CSS approach or should we go forward with the current FontAwesome version?

Hmm, the no-CSS approach would look like this:

image

image

or should we go forward with the current FontAwesome version?

I am fine with both ways (slight preference on FontAwesome because it keeps the styling consistent).

@CyberShadow
Copy link
Member

Needs some tweaking for mobile:

index.dd Outdated
EXAMPLE=$(TAG2 a, id="a$1-control" class="example-control", )$(TAG2 div, id="a$1" class="example-box", $(RUNNABLE_EXAMPLE $2))
EXTRA_EXAMPLE=<div class="your-code-here-extra" style="display:none">$(RUNNABLE_EXAMPLE $0)</div>
EXTRA_EXAMPLE=<div class="your-code-here-extra" style="display:none">
<div class="your-code-here-title">$1</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DIVC?

@wilzbach
Copy link
Contributor Author

Needs some tweaking for mobile:

Thanks. I came to the conclusion that tip box hasn't been used much over the last years and especially users on their phone most likely won't post an example, so imho the best solution is also the simplest here: hiding the tip box on devices with a narrow layout.

@CyberShadow
Copy link
Member

Still broken for very narrow widths:

dtest dlang io-artifact-website-ec00ac7dd35faa307819ad634ab38bf91aabacb4-3f759d90a402ac3595f96e341659d3c6-web-index html

@wilzbach
Copy link
Contributor Author

Still broken for very narrow widths:

I can't really reproduce this in Chrome or FF, but I added max-width: 100% which should fix things even for these tiny layouts:

image

@CyberShadow does it work for you now?

@CyberShadow
Copy link
Member

@CyberShadow does it work for you now?

Looks perfect, thanks!

examples[rouletteIndex].style.display = "none";
rouletteIndex = sel.selectedIndex;
examples[rouletteIndex].style.display = "block";
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler could have been added later in the main JS file, but it's just 3 lines so no matter.

@dlang-bot dlang-bot merged commit 1ca1706 into dlang:master Jun 30, 2017
@CyberShadow
Copy link
Member

CyberShadow commented Jun 30, 2017

tip box hasn't been used much over the last years

Forgot to post this earlier, but I think you simply found a bug in the forum search (or SQLite indexing). I know I fixed one yesterday (regarding deleted posts), but that search and its variations is still producing inconsistent results with some variations of it (for one, the query needs to search the subject, not body).

@wilzbach wilzbach deleted the example-selecting branch December 18, 2017 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants