-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Answer giveaway "Flag - Country" cards #220
Comments
That's a brilliant idea! Another note that comes to mind that could benefit from this is Guam. The solution you propose is quite nice. I'm not sure about the exact type of blur/noise, but that's a detail. The downside is that it means having two images for the same flag and inconsistent HTML in the note's Flag field. I wonder if we could solve this with a single image and without touching the content of the note. Let's see... How about this: 1. In the front side of the "Flag - Country" template, add an HTML tag after the flag: <div class="image">
{{Flag}}
<div class="blur"></div>
</div> 2. In the deck's CSS, target Nicaragua's flag image specifically and style the element that follows it (the one with class .image {
position: relative;
}
/* Blur out country name on Nicaragua's flag */
img[src="ug-flag-nicaragua.svg"] + .blur {
position: absolute;
/* width, height, top, left, transform, etc. as needed and with relative units */
filter: blur(0.5em);
} Since |
❤️ to all of you! Whatever the implementation, I am entirely for this being fixed 💯 👍 |
I'll work on pull requests to first add If/when the deck gets a major rev, I would recommend changing to use a second note field for the blurred flag, as that will be cleaner and much easier for people to understand when looking at card templates. |
Sorry, forgot to reply!
Thanks and good luck! |
If this is going to happen could we please:
|
@horwitz, are you referring to the fractal noise effect that @ukanuk first suggested? If so, I have the same concern about it as you. What do you think of the more classic blur effect as presented in #220 (comment) (third image)? |
@axelboc: sorry I wasn't clearer—I meant any effect that changes the flag in any way. I don't particularly like the blurring at all—though I certainly understand the motivation (and would believe if I'm the minority here!) If what's presented on the front of the card isn't actually an image of the flag of anywhere (but merely a blurred or roughened or warped (or any (non-identity) transformation) version that's close to the flag of somewhere), I'd really like to have it be made clear that the flag has been modified. |
@horwitz Are either of those really necessary? The blurred flag is only going to show in the front side of the card, with the full normal flag appearing on the back. No one will be confused as to what the real flag looks like. It will only be the text itself that is blurred/warped anyways, not the whole flag that is changed. Lastly, this will only be done to the few flags with the name of the country on them (3?), the rest will be untouched. |
@horwitz, I am also unsure what disadvantage you see in obscuring the text on the front of Flag>Country. It's effectively obscured when the flag is sufficiently small like in the emoji 🇬🇺, 🇳🇮, 🇵🇾, and 🇸🇻. I want to be able to recognize all those flags even when I'm not close enough to the flag to read the text. (EDIT: those flag emoji only appear on my Android 10 phone, not my Win10 computer -- I've added hyperlinks to a website with emoji images, but anyway the main point is a small flag ought to stay identifiable even when text is too small) Regardless, I think an alternate deck is overkill since using unmodified flags everywhere is a simple change in the note styling. Rather than styling Flag>Country cards to use the obfuscated flag on front, you'd change the styling to match the back of the card which shows the original flag. |
@axelboc said
Sounds good, I agree blur is a more obvious modification than roughen.
Good idea on using the Would it be more correct to use an Combining these two changes we get this styling: /* Hide blurred image(s) by default */
.image > img[src*="-blur"] { display: none; }
/* When requested, hide unblurred image(s) and show blurred image(s) */
.image.image--blur > img[src*="-blur"] { display: inline; }
.image.image--blur > img:not([src*="-blur"]) { display: none; } Or alternately: /* Hide blurred image(s) by default */
.image:not(.image--blur) > img[src*="-blur"] { display: none; }
/* When requested, hide unblurred image(s) and leave blurred image(s) visible */
.image--blur > img:not([src*="-blur"]) { display: none; } |
I think I need to clarify my reasoning, sorry. Let me go back a step. 😄 I'm working off the solution you suggested in one of your comments, which consists of adding classes at the template level to keep the content of the fields as light as possible (i.e. two The CSS you suggested in your earlier comment is the following:
I had three issues with it:
So I've suggested the following CSS instead: .image--front > img[src*="-blur"] + img { display: none; }
.image--back > img[src*="-blur"] { display: none; } The reasons are as follows:
Technically, this would also work: .image--front > img + img { display: none; }
.image--back > img[src*="-blur"] { display: none; } ... but I thought specifying the attribute selector in the first rule as well would be more readable/self-documenting, and more future-proof in the unlikely scenario we'd want to have two flag images in a field for a different reason than blurring. I hope this clarifies my reasoning. Does it answer your question regarding BEM? In your latest comment, I'm confused as to why you suggest using the |
FWIW, I'm amazed about how much information one can concisely pack into CSS selectors. :) (Unfortunately, github doesn't have an unambiguous "wow" reaction.)
An additional concern is that an end-user might want to add a flag themselves (for instance to have both the "state" and "civil" flags, or both an official and unofficial flag, for some of the dependent territories), and if we didn't have (Your CSS even naturally carries over to having multiple pairs of "blurred" and "unblurred" images, if they're correctly named, thanks to |
Thank you for the detailed reasoning, and I'm fine with
No, this works with template-level HTML. However if only makes sense to use with with /* Hide obfuscated image(s) unless called for */
.image:not(.image--blur) > img[src*="-blur"] { display: none; }
/* If called for, hide original image(s) instead of obfuscated image(s) */
.image--blur > img:not([src*="-blur"]) { display: none; } |
Whatever the name of the class, if you modify the front side of the Flag - Country template like so: {{#Flag}}
<div class="value value--top">?</div>
<hr>
<div class="type">Flag</div>
<div class="image image--whatever">{{Flag}}</div>
{{/Flag}} ... then selector |
You're absolutely right, I completely forgot about about countries with a single non-blurred |
No worries! Glad we're on the same page. 😃 |
I ran through all the flags in the Anki deck and found 6 flags I think we should definitely obfuscate. We probably ought to obfuscate 3 more flags with text in a non-latin alphabet, and potentially ought to obfuscate another 3 flags in case others are better at noticing details than me (whether through better eyes, displays, or both). Flags with country name
Flags with country name, but so small it wouldn't be noticeable without SVG and even then potentially not with anyone's actual Anki review setup
I documented every flag with any text, but don't think any of these cause the answer to be given away unfairly. Here they are for reference. Click to expandFlags with text besides country name
Flags with text besides country name, but so small it wouldn't be noticeable without SVG and even then potentially not with anyone's actual Anki review setup
|
It's interesting about Afghanistan, Brunei and Egypt. On one hand, it seems
that blurring them would be consistent with our direction of making the
deck less westernized. On the other hand, I feel like this concerns the
geographical content of the deck more than its internationalization, and I
think obfuscating text is an internationalization problem. When (if) we
start having translations for languages with non-latin writing systems,
then obfuscation of non-latin text could make sense, but for now I don't
feel like it would.
|
All three of these flags are currently converted to PNG, for this deck, so irrespective of how much one zooms in, the name won't be distinguishable, so we don't need to worry about them. Boliva's flag (also in PNG format) is just-about-borderline, but I agree that it's worth blurring.
This is fascinating! For completeness, there's also Iran's flag, which has a very stylised "Allah" (ٱللَّٰه) in the centre, and apparently the Takbir written in Kufic script along the two bands. |
@axelboc If the Japanese, Chinese, or Korean flags had 日本, 中国, or 韓國 written on them, I would say they ought to be blurred because I happened to study Japanese in college and can read them just as easily as I can read Guam. Someone who studied Arabic could probably make a similar argument, even if they want to study the deck in English. Regardless, I don't mind waiting to modify such flags until when (if) that becomes a problem. @aplaice Thank you, I've edited my post above to add your details about Iran! As for the PNG images, I agree. |
As for recognizing flags from emoji (e.g., 🇬🇺, 🇳🇮, 🇵🇾, and 🇸🇻): sure, I want that recognition skill—and if that's all I wanted, then these potentially obscured flags would be no worry. However, obfuscation hurts the ability to answer a question like "What nation's flag includes the text 'Republica de [country name]' on the flag?" (I was asked "What US state's flag includes the phrase 'Battle Born'?" once and didn't know—even though I had studied US flags, the deck I studied had inexact images.)
If a flag-obfuscating change goes into effect and I can undo it locally with a simple one(-ish)-line change, then that's great news—thanks! (And never mind my concern!) |
This reverts commit 4a04e15.
This reverts commit d88c965.
Prepare to handle obfuscated/blurred images as discussed in #220
Create blurred images of flags per #220
A bit late to reply now that I've merged the PR, but I just wanted to give you my two cents on this @horwitz. I did share this concern of yours, but I think that it's mitigated by the fact that you do see the real flag on the back, so the deck is not losing any information. In fact, the change from blurred to not blurred might make you realise even more that the flag had its country's name on it! 😄 Closing this issue now since auto-closing didn't work. Thanks @ukanuk and everyone else who participated! |
Some flags include the name of the country/continent/etc written on it, for example with Nicaragua, El Salvador, and Paraguay. When reviewing on my smartphone in bed at night (bad habit, I know...), I can clearly read the country name on the front side of the card. I would prefer to recognize the flag by its colors, layout, and symbols, but whenever I get the "Flag - Country" card for Nicaragua, my eye is immediately drawn to the text, and I can read the answer with zero effort.
See my proposed solution below. For affected country notes it modifies the Flag field with a second SVG image and some hidden html. To the "Flag - Country" card type, it adds one class to the existing image div and adds three styles . If someone has a cleaner solution, I'd love to hear it!
Proposed solution, using Nicaragua as the example:
Create new SVG for problematic flag
To obfuscate "Nicaragua" and "Central America", I used the Inkscape effect "Filters > Distort > Roughen" menu. My modified file is only 0.1KB larger according to Windows Explorer.
Before:
After:
Modify Flag field in note:
"Flag - Country" card type: Add "blurred" class to flag div on front template
"Flag - Country" card type: Add more styling
The text was updated successfully, but these errors were encountered: