applying css properties in image using CSS Plugin in Createjs - createjs

trying to change the css properties of an image using CSS Plugin in Createjs but i am not able to do so. Guys plz help
var wheel = new createjs.Bitmap(preload_queue.getResult("bg"));
stage.addChild(wheel);
wheel.set({x:0 ,y:0})
wheel.image.style.transform = "translate(20px, 30px)";
wheel.image.style.perspective= "2000px";
wheel.image.style.perspectiveOrigin = "left";
createjs.Tween.get(wheel)
.to({transform: "translate(500px, 50px)"}, 1000)

Have you "installed" the CSSPlugin?
createjs.CSSPlugin.install();
TweenJS natively just works with numerical values, but the transform is a string that is composed of various functions (translate, scale, etc). The CSSPlugin was updated in version 0.8.2 to deal with transforms.
CSSPlugin Documentation
Note that CSSPlugin is not included in the minified version of TweenJS, so you have to download it and add it to your project if you want to use it.
I hope that helps!

For this particular demo, the issue is that you are using the canvas to display your image.
EaselJS does not support CSS, especially perspective transforming. You can do typical x/y/rotation/skew/scale transforms using direct properties, or the setTransform() method, but that is all 2D-canvas supports.
The CSSPlugin for TweenJS is to affect the CSS transformations of DOM elements, and is not intended for use with EaselJS objects.
Hope that helps!

Related

style of asciidoc Admonition missing while using Hugo ? ( syntax not supported? )

I'm using Hugo to generate static pages in Gitlab, seems the syntax of asciidoc not supported well (such as Admonition)? or it's just about the theme I'm using?
for code [TIP]
Expected:
Current:
Please enable font-based icons by adding
:icons: font
to your document. See Font Icon Mode in AsciiDoc docs for details.
Depending on the CSS you use, the tool tip might look different. See below for the "classic" CSS of Asciidoctor.
Once you add the :icons: font, it is a matter of updating the CSS to make it look like your screenshot above.

How to style notifications in Vaadin Flow

I would like to style notifications in Vaadin Flow (19+), in Java, exactly as shown here in typescript, by assigning a theme and not setting the color of the elements (as shown in the java example). Apart the fact that setting the color is troublesome (foreground, background...) and fragile (e.g. switching to dark mode), the Java example shows setting a CSS color, I would expect to be allowed to use Lumo color variables (e.g. --lumo-success-color). Is this possible? Can anybody show an example?
You can use the addThemeVariants() method to define the variant you want to use:
Notification notification = new Notification();
notification.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
The Java examples have not been moved over to the new docs site yet, you can find them here https://vaadin.com/components/vaadin-notification/java-examples/theme-variants

pygtk spinbox style: gimp-like

In GIMP the spinboxes they use for brush sizes allow for
manual typing
up-down spinning
They also provide a bar that can be dragged which provides a nice indication of the range that spinbox can take.
Is this possible with pygtk?
You probably want to use Gtk.SpimButton and Gtk.Scale:
https://developer.gnome.org/gtk3/stable/GtkSpinButton.html
https://developer.gnome.org/gtk3/stable/GtkScale.html
These are the GTK+3 version but you can also find them in GTK+2 but I strongly suggest not to use PyGTK2 since it's not maintained anymore, use the introspection bindings instead through PyGobject:
https://wiki.gnome.org/action/show/Projects/PyGObject
You also have a tutorial:
https://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html
and the API reference:
http://lazka.github.io/pgi-docs/
http://lazka.github.io/pgi-docs/api/Gtk_3.0/classes/SpinButton.html
http://lazka.github.io/pgi-docs/api/Gtk_3.0/classes/Scale.html

Imageresizer bgcolor transparancy

I am currently using ImageResizer from Imazen (http://imageresizing.net/)
I want to create images with the same dimensions which is easily achieved by adding the
www.example.com/example.png?w=150&h=150
however i want to give a bgcolor to the image for background/whitespace color.
again www.example.com/example.png?w=150&h=150&bgcolor=FF00FF works perfectly.
However is there a way to make this bgcolor transparant? (ofcourse only for .png's)
I read the docs and couldn't find a plugin or basic functionality that could provide this feature. Does anyone know if (or how) this can be achieved?
Use a 6-digit hex value (RRGGBBAA) to include an alpha/transparency component.

Reading DOMDocument and find elements using CSS selectors

I must convert an android app to iOS, this app uses deeply the jsoup library and the element.select(cssQuery) to find elements starting from CSS selectors.
Initially I wanted to convert selectors to XPATH and use xmllib2 but the css-selector usage is really pervasive (dozen of configuration files, already existing stored files)
Does exist some Cocoa code/library/framework able to create an HTML document and search using CSS selectors?
Have a look at these Gumbo wrappers. Gumbo is an html5 parser written by Google. Note that the CSS selectors that can be used are very simple and might not suit your needs.
ObjectiveGumbo
OCGumbo
Hope this help (even if you already approved another answer).
I dont know if there is existing method to search using css selectors in Cocoa, but i here is an article about most common xml parsers for iOS:
http://www.raywenderlich.com/553/xml-tutorial-for-ios-how-to-choose-the-best-xml-parser-for-your-iphone-project
Personally, i would recomend KissXML. It's DOM with support for XPath queries.