Home » Development » Javascript » Page 4
“Element queries are a new way of thinking about responsive web design where the responsive conditions apply to elements on the page instead of the width or height of the browser. Unlike CSS @media queries, @element Queries are aware of more than just the width and height of the browser, you can write responsive conditions for a number of different situations like how many characters of text or child elements an element contains. Another concept that element queries brings to CSS is the idea of ‘scoping’ your styles to one element in the same way that JavaScript functions define a new scope for the variables they contain.”
min-width
max-width
min-height
max-height
min-characters
max-characters
min-lines
max-lines
min-children
max-children
min-scroll-y
max-scroll-y
min-scroll-x
max-scroll-x
orientation
min-aspect-ratio
max-aspect-ratio
$this
$parent
$root
$prev
$next
Element Queries
A library to generate PDFs in client-side JavaScript.
GitHub
TaffyDB / GitHub
FinderJS
Simple way to make sure you are assigning unique IDs to a series of elements.
If you want to do IETF RFC-4122 compliant Universally Unique Identifiers (UUID), checkout Pure UUID.
Seems to be all about unique IDs this week ;)
I am currently building a custom slides / template builder for a project, with a lot of moving parts and dynamic logic.
As there are repeating patterns within the slides, each pattern and its logic needs to be neatly separated. As the slides can be reordered and dropzones can be changed, I need to make sure logic doesn’t break and IDs get updated.
Before reassembling all templates, I am making sure that IDs match the slide and dropzone using a preg_replace_callback
One of the patterns is a simple tab setup, each has its unique ID defined like vl-tab_U1_S1_D1.
The function below passes the found matches through to the anonymous callback function in preg_replace_callback and offers outside data to the function using use($foo). The $dropzone object holds the current unit, slide and dropzone of the pattern, which can be used to replace the current ID with the correct one.
Really nice combo to make magic happen ;)
BTW here a nice website to testdrive and tweak your Regex : https://regex101.com/
dom-to-image is a library which can turn an arbitrary DOM node into a vector (SVG) or raster (PNG or JPEG) image, written in JavaScript.
More uptodate and faster than html2canvas, which I used before in a couple of projects.
Firefly jQuery Floating Pixels .
Joyride is an easy to configure site tour wizard.
Joyride
With Chrome 56, web apps can now communicate with nearby Bluetooth Low Energy devices using the Web Bluetooth API, position sticky is back – making it easy to create elements that scroll normally until sticking to the top of the viewport. And HTML5 by Default is enabled for all users.
Chrome 56 on iOS also adds the ability to scan QR codes directly within Chrome. So many thought QR-Codes were dead, well not so much !
Google