Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.

Skandranon posted:

You want to use Electron. This will give you full access to the file system while writing your application entirely as a web app. A pure web app that works offline will likely be harder, simply because even with the various caching options available, you still need to answer the question of how the 'webserver' is hosted, and making the online/offline part seamless is non-trivial.

https://github.com/electron/electron

https://scotch.io/tutorials/creating-desktop-applications-with-angularjs-and-github-electron

Awesome, thanks a lot!

Adbot
ADBOT LOVES YOU

Kekekela
Oct 28, 2004
Heh, I was just asking about Electron in the other thread. I've been intrigued since I realized how good VS Code was. Then last night I realized Curious Expedition was also an Electron app and started thinking it might be time to screw around with it some.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Kekekela posted:

Heh, I was just asking about Electron in the other thread. I've been intrigued since I realized how good VS Code was. Then last night I realized Curious Expedition was also an Electron app and started thinking it might be time to screw around with it some.

I can't help but have Adobe AIR flashbacks.....

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Kekekela posted:

Heh, I was just asking about Electron in the other thread. I've been intrigued since I realized how good VS Code was. Then last night I realized Curious Expedition was also an Electron app and started thinking it might be time to screw around with it some.

Yeah, I've wanted to do something with it for awhile, beyond the trivial. I started porting my SteamMoverWPF project to it, but then got annoyed at making symlinks with NodeJS and then got distracted by other things... Still a lot of potential there, especially if trying to target multiple platforms (Desktop, Web, Mobile)

darthbob88
Oct 13, 2011

YOSPOS

McGlockenshire posted:

Do it server side if at all possible to minimize client impact.
I'd rather do that, but I'm using ASP.NET and AngularJS; there's just the one layout template, the only thing that changes is the contents of the ng-view and which controller is active. So yeah, I can use JS in the controller to change things, and I can put something in the Angular template, and maybe I can put something in the CSS to say "If you're looking at the poop URL or the body tag contains #poop-header, then use the poop backgrounds", but that's about it.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Electron is really good. That is all.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Thermopyle posted:

Electron is really good. That is all.
Except when poorly implemented: https://github.com/Microsoft/vscode/issues/22900 :haw:

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Having a hard time coming up with the right terms to google for this one. Lets say you are coloring counties of a particular region on a map. How do you go about picking colors that are easy to distinguish from one another? How do you then ensure that two regions that border each other don't have the same color (within reason)? I'm using leaflet for this, not seeing anything on the plugins page that touches on this stuff though.

NewForumSoftware
Oct 8, 2016

by Lowtax

Ironically enough this is a bug with Chromium and not VSCode or Electron for that matter

huhu
Feb 24, 2006

fletcher posted:

Having a hard time coming up with the right terms to google for this one. Lets say you are coloring counties of a particular region on a map. How do you go about picking colors that are easy to distinguish from one another? How do you then ensure that two regions that border each other don't have the same color (within reason)? I'm using leaflet for this, not seeing anything on the plugins page that touches on this stuff though.

I recall from picking colors for a graph project -https://blog.graphiq.com/finding-the-right-color-palettes-for-data-visualizations-fcd4e707a283#.npojrgbh5

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

fletcher posted:

Having a hard time coming up with the right terms to google for this one. Lets say you are coloring counties of a particular region on a map. How do you go about picking colors that are easy to distinguish from one another? How do you then ensure that two regions that border each other don't have the same color (within reason)? I'm using leaflet for this, not seeing anything on the plugins page that touches on this stuff though.

Not that it's useful in a practical sense for you, but this general class of problem has a lot of research and history behind it: https://en.wikipedia.org/wiki/Graph_coloring

I'm not sure if that will give you any starting points for doing what you need to do, but I always find it quite interesting to read about.

Actually picking the colours to use is a different matter, of course. EDIT: But huhu's link seems really good in explaining the considerations in that field, so read that with regards to picking the colours to use.

PT6A fucked around with this message at 02:55 on Mar 24, 2017

No Gravitas
Jun 12, 2013

by FactsAreUseless
Is there a way, using CSS only, to style things differently depending on if they (or a parent) are scrollable or not?

I'm guessing not, but thought I'd ask.

darthbob88
Oct 13, 2011

YOSPOS

No Gravitas posted:

Is there a way, using CSS only, to style things differently depending on if they (or a parent) are scrollable or not?

I'm guessing not, but thought I'd ask.
Obviously you can do it with a .scrollable class, like
code:
div{ background-color: blue; }

.scrollable div{ background-color:red;}
I'm guessing there's some reason this isn't an option, though?

E: Like that you don't really have a .scrollable class, you just have a class which includes overflow:scroll, and want to do something if it's actually scrolling?

darthbob88 fucked around with this message at 18:02 on Mar 27, 2017

No Gravitas
Jun 12, 2013

by FactsAreUseless
Yup. I have a box. The box may be overfull, in which case it gets a scroll bar, I already have that. If it has that bar, I'd like the background to be red. If the text fits fine then I want the background to be blue.

Giga Gaia
May 2, 2006

360 kickflip to... Meteo?!
So I've been tasked with trying to "fix" a Flexbox system to work with ie9. This can mean anything up to replacing the entire grid system with one of my design (which I'd like to avoid if possible) or hacky CSS. We have flexibility.js loaded into the testing environments and it's not working 100%. My first step is trying to debug this JS implementation because I 100% believe it's not being done correctly, but it's quite difficult to debug this testing environment with my credentials. If I can't fix this, my ideal solution is just to toss some really basic ie9 CSS into the same call for flexibility.js that would allow me just enough leeway for the pages we start using this pattern library on to render reasonably on our dumb in-store computers. I have this sort of implemented locally, for what it's worth.

So, all that said, what I'm looking for is some opinions on the most "flex-like" grids out there. I've got 2 or 3 in mind but I'm hoping someone in this thread might have some experience with this sort of situation. Also if anyone has experience debugging flexibility.js (or an alternative) please comment! I can't link to the exact pages we're using it on due to legality, but my research is showing its fairly common with this polyfill and I can probably mock up the behavior if a screenshot would help.

I realize this has probably been asked dozens of times in this thread, but man would I like to not toss in a typical float grid. It's such a backwards step and when we finally can update the grid to flexbox, it's gonna require so much reworking or more backwards compatible blah blah blah. You all know.

Also, "hi" to the dude I work with who has an SA account and doesn't post much but may end up lurking this thread.

Edit: As an aside on the JS front, I've personally tested it in a VM of win 7 with IE9 so I can't just blame emulation. Which would make me so happy to do.

Giga Gaia fucked around with this message at 01:48 on Mar 28, 2017

Sergeant Rock
Apr 28, 2002

"... call the expert at kissing and stuff..."
Well, you could try leveraging the @supports directive to only feed flexbox to browsers that support it. Then apply CSS for IE9 etc to fake a grid layout.

You could even go crazy and try new CSS grid, using the same technique.

Rubellavator
Aug 16, 2007

How could I do whitelist input validation on a user comment field. Does that even make sense? I'm trying to clear up a persistent xss finding our sca found. It's an angular app with a java backend and I'm using gson to serialize/deserialize between pojos and json.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Rubellavator posted:

How could I do whitelist input validation on a user comment field. Does that even make sense? I'm trying to clear up a persistent xss finding our sca found. It's an angular app with a java backend and I'm using gson to serialize/deserialize between pojos and json.

Either you neutralize the content when it's entered and assume it's always safe when displaying, or you don't neutralize the content when it's entered and always assume it's tainted everywhere it's displayed and hope that you never forget to filter it.

The first option makes sense for traditional web applications, but the second option might be easier for you given that the SPA architecture tends to discard simple things like the request/response cycle everything else normally uses to process user data before it hits application logic, storage, or display.

Pick one and be consistent with it.

Rubellavator
Aug 16, 2007

McGlockenshire posted:

Either you neutralize the content when it's entered and assume it's always safe when displaying, or you don't neutralize the content when it's entered and always assume it's tainted everywhere it's displayed and hope that you never forget to filter it.

The first option makes sense for traditional web applications, but the second option might be easier for you given that the SPA architecture tends to discard simple things like the request/response cycle everything else normally uses to process user data before it hits application logic, storage, or display.

Pick one and be consistent with it.

From what I understand the second option is already handled for the most part by output encoding by both gson and angular.

What I'm likely to do is write a regex check constraint on the db to handle the first case and satisfy our sca tool. It just feels like I'd end up with a regex that would basically provide nothing in terms of security or be an annoyance to the user.

darthbob88
Oct 13, 2011

YOSPOS
I'm trying to get two transitions to fire in succession, where I slide one element left and then raise another element into visibility. I'm trying to do this using an event listener on transitionend, but it's firing early, starting the second transition when the first element is barely halfway across the screen.
1. What am I doing wrong/Is there a better way of doing this?
2. As long as I'm here- The first transition is sliding an element, specifically one button out of a row, from an uncertain starting point to the far left edge of its parent. At present, I can't find a good property to animate or transition, so I'm using jQuery to calculate its position and how far to slide it, then setting transform: translate3d(0, -DISTANCEpx, 0). Again, what am I doing wrong/Is there a better way?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

darthbob88 posted:

I'm trying to get two transitions to fire in succession, where I slide one element left and then raise another element into visibility. I'm trying to do this using an event listener on transitionend, but it's firing early, starting the second transition when the first element is barely halfway across the screen.
1. What am I doing wrong/Is there a better way of doing this?
2. As long as I'm here- The first transition is sliding an element, specifically one button out of a row, from an uncertain starting point to the far left edge of its parent. At present, I can't find a good property to animate or transition, so I'm using jQuery to calculate its position and how far to slide it, then setting transform: translate3d(0, -DISTANCEpx, 0). Again, what am I doing wrong/Is there a better way?

It's been a long time, but doesn't jQuery have a completion callback for it's animations? You can start the second one in there.

You can figure out the elements position relative to it's parent with position I think... again, it's been a while. If the thing isn't a direct child, you can figure it all out relative to the document w/ offset() You can animate top, left, and the other position properties as well in case transform isn't working well.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

McGlockenshire posted:

The first option makes sense for traditional web applications, but the second option might be easier for you given that the SPA architecture tends to discard simple things like the request/response cycle everything else normally uses to process user data before it hits application logic, storage, or display.

Not sure what you mean by this... you can be as specific as you'd like with your data layer in Angular SPAs, right up to using window.fetch() instead of $http.

darthbob88
Oct 13, 2011

YOSPOS

Lumpy posted:

It's been a long time, but doesn't jQuery have a completion callback for it's animations? You can start the second one in there.

You can figure out the elements position relative to it's parent with position I think... again, it's been a while. If the thing isn't a direct child, you can figure it all out relative to the document w/ offset() You can animate top, left, and the other position properties as well in case transform isn't working well.
I'm using that $(element).position() method, actually, and apart from the issue I mentioned with transitionend, it's working fine.* When it runs to completion, it slides the element right into place for the next step. The problem is that it doesn't always, so the element slides gracefully a little ways left, and then jumps the rest of the way to make room for the other element transitioning into visibility.

* Well, except both the element and its parent are relatively positioned, so I need $(element).position - $(element).parent().position to get my element's location relative to its parent's left edge.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
What's the largest CSS file you've ever seen? My new record from just now is 1.5MB. After being compressed, it's a mere 1.1MB.

I suspect this is the correct answer to my client's (who's subcontracted part of the work to me, so he's ultimately responsible for this monstrosity) question of "why is the site loading slowly?"

No Gravitas
Jun 12, 2013

by FactsAreUseless

PT6A posted:

What's the largest CSS file you've ever seen? My new record from just now is 1.5MB. After being compressed, it's a mere 1.1MB.

I suspect this is the correct answer to my client's (who's subcontracted part of the work to me, so he's ultimately responsible for this monstrosity) question of "why is the site loading slowly?"

Did you minify it? Compress it with zopfli?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

No Gravitas posted:

Did you minify it? Compress it with zopfli?

By compressed, I meant minified, so yes. I don't know if the server is configured to serve gzip-compressed files because I don't control that (and I don't think my client controls that directly either, so who the gently caress knows).

No Gravitas
Jun 12, 2013

by FactsAreUseless

PT6A posted:

By compressed, I meant minified, so yes. I don't know if the server is configured to serve gzip-compressed files because I don't control that (and I don't think my client controls that directly either, so who the gently caress knows).

Serious suggestion: Purifycss and uncss will help you get rid of unused CSS.

Comedy option: Remynify your CSS, watch the whole CSS burst into flames.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Just a note, minifying CSS barely does anything considering it has no variables, all you're stripping is whitespace. Gzip is mandatory to actually get the size down on a big CSS file because that can actually zip up all the repetition, unlike minification.

No Gravitas
Jun 12, 2013

by FactsAreUseless

Maluco Marinero posted:

Just a note, minifying CSS barely does anything considering it has no variables, all you're stripping is whitespace. Gzip is mandatory to actually get the size down on a big CSS file because that can actually zip up all the repetition, unlike minification.

Modern minifiers do more than just whitespace stripping, including removing repetitions. They aren't as good as gzip, but they try.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Like I said, the minifying was good at reducing 1.5MB to 1.1MB, but that's still, frankly, way too loving much for a basic corporate site (or anything, frankly).

Even if you don't take into account the page weight of such a stylesheet, the sheer quantity of CSS is almost certainly an indication that it's extremely difficult to modify/maintain in anything approaching a sane way.

No Gravitas
Jun 12, 2013

by FactsAreUseless

PT6A posted:

Like I said, the minifying was good at reducing 1.5MB to 1.1MB, but that's still, frankly, way too loving much for a basic corporate site (or anything, frankly).

Even if you don't take into account the page weight of such a stylesheet, the sheer quantity of CSS is almost certainly an indication that it's extremely difficult to modify/maintain in anything approaching a sane way.

Oh, yeah. It is insane. No question about that.

Sergeant Rock
Apr 28, 2002

"... call the expert at kissing and stuff..."
I've seen 12,000 lines of CSS in one file. This is before LESS and SASS existed, and yes it was utterly unmaintainable.

Especially since armies of previous devs had resorted to the 'just add !important' tactic.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
I mentioned it a bit ago, but our CSS is slowly bloating up too. It's basically from a series of bespoke re-inventions of the wheel.
I had a meeting with Creative/UX and we decided there were thing to do (like consolidate our huge variety of font sizes), but still nothing has happened. I think part of this may be, that unlike other 'products', there is no key person for this. Is that a thing where you work?
Is there a key person that has the final say on what does(n't) go into the main site's CSS? I'm also thinking in the long term, this would related to Angular components.

fuf
Sep 12, 2004

haha
Trying to set up a paypal "subscribe" button for a client. Paypal has a little button creator tool that works fine, but it's tied to whichever account creates the button. Is there a way to create the button for the client's paypal account without them just giving me their paypal username and password (which I feel sketchy asking for)?

Also, UK bank question: they also accept payment through bank transfer. Is it standard to just add their receiving account number and sort code to the payments page and ask the customer to use their email as the reference? :confused: It seems weird making that info public but I don't see how else to do it.

The "product" is a subscription to an academic society so the site is fairly quiet.

blunt
Jul 7, 2005

fuf posted:

Trying to set up a paypal "subscribe" button for a client. Paypal has a little button creator tool that works fine, but it's tied to whichever account creates the button. Is there a way to create the button for the client's paypal account without them just giving me their paypal username and password (which I feel sketchy asking for)?

Also, UK bank question: they also accept payment through bank transfer. Is it standard to just add their receiving account number and sort code to the payments page and ask the customer to use their email as the reference? :confused: It seems weird making that info public but I don't see how else to do it.

The "product" is a subscription to an academic society so the site is fairly quiet.

The subscribe button has to be created through the Paypal account as it's tied to a specific product you define as opposed to just being like a username & a $ value. For a one off payment instead of a subscription you could just point a button to a paypal.me/[username] link.

For the bank transfer, what you've described is pretty standard. I've usually seen it on an invoice page / behind a members area as opposed to just published on the website for everyone to view. You'd usually then ask them to use the order number as a reference etc.

fuf
Sep 12, 2004

haha
Thanks, that's helpful. The paypal.me button might be a good option but looks like they'd still need to do a bit of setup. I'll give them a choice between giving me the login or having me talk them through it all.

Re bank transfer, the payments page is behind an initial sign up page, so that's something at least.

kedo
Nov 27, 2007

What's the current hotness in terms of CSS and/or canvas animation? I have an upcoming project that's going to involve a lot of animation and I'm looking for some sort of framework so I don't have to code every single keyframe by hand and/or chain together ridiculously long jQuery functions. My assets are mainly svgs.

McGlockenshire
Dec 16, 2005

GOLLOCKS!
Are you trying to animate the SVGs, or are you trying to animate transitions between the SVGs, or are you just using the SVGs as part of another animation? I've never played with pure CSS SVG transformations before and the first few results in Google suggest that it's still black magic and a bunch of places seem to suggest using this library that I've never heard of or used before: https://greensock.com/gsap

One thing that I think everyone will agree on is not to use jQuery.animate() unless you have no better options.

kedo
Nov 27, 2007

McGlockenshire posted:

Are you trying to animate the SVGs, or are you trying to animate transitions between the SVGs, or are you just using the SVGs as part of another animation? I've never played with pure CSS SVG transformations before and the first few results in Google suggest that it's still black magic and a bunch of places seem to suggest using this library that I've never heard of or used before: https://greensock.com/gsap

One thing that I think everyone will agree on is not to use jQuery.animate() unless you have no better options.

I'll most likely be animating position and size. I don't think I'm going to be doing much of anything past that. I also Googled around to get a lay of the land and was amused to see Greensock is still a thing. I used their plugins a lot back in the days of Flash.

Adbot
ADBOT LOVES YOU

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

kedo posted:

I'll most likely be animating position and size. I don't think I'm going to be doing much of anything past that. I also Googled around to get a lay of the land and was amused to see Greensock is still a thing. I used their plugins a lot back in the days of Flash.
You can use CSS transitions, but there is one thing I've noticed is that when using something like scale/rotate. Firefox makes the origin the center of the shape where as other browsers use the center of the svg

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply