Home Forums Horse and Musket Napoleonic My Russian Napoleonic page Reply To: My Russian Napoleonic page

#57015
Avatar photoJonathan Gingerich
Participant

Well, a happy day recently!

Okay, so with General Slade’s interest in the new books on Russian flags, I dusted off my manuscript for a look-see. A couple of things have changed since I  put it aside. Working with Leonov, Popov, and Kibovsky has made me a lot more comfortable with what is known and what is not and I think I have a more decisive handle on the flags data. The other thing is I’ve gotten a lot better with SVG and decided that I really ought to try some simple graphics and worry about the details later.  General Slade’s enthusiasm for pretty pictures reminded me that that’s what it’s all about. Excruciately listing all the possible variations of color in the sources only excites me…

So I whipped up some SVG and some modal CSS and some JQuery and, well it fell together fairly easily (for that kind of thing which is always a headache to some extent). But here’s where the excitement comes! Okay hopefully Katie or John Salt will stumble on this and empathise. A lot has happened with SVG and HTML since I got started. SVG tags are now recognized in HTML 5 so a lot of really ugly XML namespace boilerplate doesn’t need to be there. But even better, I realized you could give SVG object classes – AND CSS classes will take SVG attributes like fill or transform. This is a huge win because it means you can parameterize with a class. Instead of having to write fill=”#00FFFF” everywhere I wanted to color azure, I can make azure a class name with fill:#00FFFF; and everything I want colored azure I just add class=’azure’. Then if I decide it really should be #00FFEF, I need only change one line. The same with transforms. This is how you move big blocks of graphics around in the view. You can define, say, a flag in an 800 by 800 format, then scale it appropriately for a browser window. So you want your scale decision separate from your flag definition and you can do this by putting it into a class.

Well almost.  Works great in Chrome, but transforms don’t work in Edge – (but the colors do, so that’s still a big win). I also discovered that JQuery cannot set events on SVG classes, because JQuery can’t tell if SVG finished loading or not. Got around that by initializing the event handlers in the first JavaScript function that will run (which is attached to an SVG object, so I know the SVG is loaded.)

Anyway, I defined all the 1797 patterns for the line, and I can cruise up and down the list, clicking up patterns!-) My the Russians used a lot of violet…