I AM LISTENING TO
|
WAS ICH LIEBE
  • Englisch
  • Deutsch


BLOG FILTER



URI.js is a javascript library for working with URLs. It offers a „jQuery-style“ API (Fluent Interface, Method Chaining) to read and write all regular components and a number of convenience methods like .directory() and .authority().

URI.js offers simple, yet powerful ways of working with query string, has a number of URI-normalization functions and converts relative/absolute paths.“

GitHub

readmore

NavNav provides a ton of CSS, jQuery, and JavaScript responsive navigation examples, demos, and tutorials from all over the web.

NavNav

readmore

metisMenu offers a lot of options to tweak layout and usage. The plugin provides options for

  1. Vertical menus
  2. Folder Views
  3. Hover Menus

GitHub / WordPress Version

readmore

What is a @font-face?

@font-face is a CSS at-rule used to define custom fonts for use on web pages. It allows web designers and developers to specify downloadable fonts that can be used to render text on their websites, regardless of whether the font is installed on the user’s device.

What is the FOUT, FOIT or FOFT?

There are three common issues regarding text rendering on browsers. And the goal always is to reduce or at least minimize the text reflow.

What the FOUT!

FOUT stands for „Flash of Unstyled Text.“ It’s a phenomenon that occurs when using web fonts in CSS. When a web page is loading, the browser might initially render text using a fallback font while waiting for the web font to download and apply. This results in a momentary flash where the text appears in the fallback font before switching to the desired web font.

FOUT can be visually disruptive, especially if the fallback font differs significantly from the intended web font in terms of style or size. To mitigate FOUT, web developers often use techniques such as font loading strategies (like using the font-display property in CSS) or server-side rendering to ensure that the desired web font is loaded and applied as quickly as possible to minimize or eliminate the flash of unstyled text.

What the FOIT!

FOIT stands for „Flash of Invisible Text.“ It’s another phenomenon related to web fonts in CSS. Unlike FOUT, where fallback text is briefly visible before the web font loads, FOIT occurs when the browser hides text until the web font is fully loaded and ready to be applied.

When FOIT happens, the text remains invisible until the browser has downloaded the web font. This can result in a delay in displaying text content on the webpage, which might lead to a poor user experience.

To address FOIT, web developers sometimes use techniques such as font loading strategies (like preloading fonts or using the font-display property) to ensure that text content remains visible while waiting for web fonts to load. These techniques aim to balance the trade-off between the performance benefits of font loading and the user experience of text visibility.

What the FOFT!

„FOFT“ stands for „Flash of Faux Text.“ This term describes a phenomenon similar to FOUT (Flash of Unstyled Text) but specifically occurs when using synthetic fonts, such as system fonts or web-safe fonts, instead of custom web fonts.

In FOFT, when a web page is loading, the browser may initially render text using a generic font (like Arial or Times New Roman) before switching to the specified font once it has fully loaded. This switch can result in a brief flash where the text appears in the generic font before being replaced with the intended font, causing a disruption in the visual appearance of the text.

To mitigate FOFT, developers can employ similar techniques used to address FOUT, such as optimizing font loading strategies or utilizing font preloading techniques to ensure a smoother transition from the generic font to the specified font. Additionally, choosing system fonts or web-safe fonts that closely resemble the desired custom font can help reduce the visibility of FOFT.

DETECT WHEN FONTS ARE LOADED!

Option 1

Use the CSS font loading API. Not supported in all browsers yet (MDN, W3C). You can call document.fonts  to get a FontFaceSet object.

  • check(fontSpec) – returns whether all fonts in the given font list have been loaded and are available. The fontSpec uses the CSS shorthand syntax for fonts.
    Example: document.fonts.check('bold 16px Roboto'); // true or false
  • document.fonts.ready – returns a Promise indicating that font loading and layout operations are done.

Option 2

Use Font Face Observer – its a small @font-face loader and monitor compatible with any web font service. It will monitor when a web font is applied to the page and notify you. It does not limit you in any way in where, when, or how you load your web fonts. Unlike the Web Font Loader Font Face Observer uses scroll events to detect font loads efficiently and with minimum overhead.

GitHub

Option 3

Use jQuery-FontSpy.js, works by checking the change in width of a string.

GitHub

Option 4

Use Webfont Loader,  if loading fonts from Typekit , Fonts.com, Google, Fontdeck or custom location.

This introduces the following events:

  • loading – This event is triggered when all fonts have been requested.
  • active – This event is triggered when the fonts have rendered.
  • inactive – This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded.
  • fontloading – This event is triggered once for each font that’s loaded.
  • fontactive – This event is triggered once for each font that renders.
  • fontinactive – This event is triggered if the font can’t be loaded.

GitHub

Enjoy coding …

readmore

  • touch (mobile)
  • zooming
  • rotating
  • scaling (flipping)
  • multiple croppers
  • crop on a canvas
  • crop image in the browser by canvas
  • translate Exif Orientation information
  • Cross-browser support

Cropper.js / jQuery Version

readmore

SPLIT PANES / DOCKER allow you to display multiple areas, either side by side or one on top of each other. Nested layouts are often part of it. By dragging a divider that appears between the areas, the user can specify how much of the total width / height goes to each area.

I have been building a backend interface in the past weeks, that forced me to look into ways to organize the workspace more efficiently . I could code my own splitter, but is not a priority right now and makes no sense to always reinvent the wheel :)

Here some of the options out there…

Pure jQuery UI

This uses the jQuery UI draggable component and provides limited options :)

 jQuery UI

jQuery Plugins

Pure Jasvascript

CSS only

Enjoy coding …

readmore

„Responsive FileManager is a free open-source file manager and image manager made with jQuery, CSS3, PHP and HTML5 that offers a nice and elegant way to upload and insert files, images and videos.
You can use it as external plugin for TinyMCE, CKEditor and CLEditor or as a stand-alone file manager to manage and select files.“

USAGE WITH TINYMCE

Responsive filemanager / GitHub

readmore

I am currently developing a drag and drop interface for a course builder. Courses are split into lessons and lessons into slides. While switching between slides, I wanted to have a small thumbnail representing the current slide content.

One option would have been to use something like PhantomJS / CasperJS.  A headless browser , to take a screenshot of the slide. I have done that in the past and it works perfectly.

This time, I decided to go with another solution, that allows me to convert html to a canvas element.

The project is called html2canvas (GitHub).

„This script allows you to take screenshots of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.“

EXAMPLE

CANVAS TO BACKGROUND IMAGE

I have a slide container (#slideContainer), that holds the active slide for editing and a thumb navigation to switch between slides (.slide.thumb).

When switching between slides, I am doing a snapshot of the current slideContainer and add it as a new background image to the thumb navigation item for that slide. This is done with canvas.toDataURL() and by embedding the resulting image  using a data: url.

Works perfectly. html2canvas has no full css support, so the output will not always match 100%, but its close enough to get a glimpse of what is stored per slide ;)

html2canvas
PhantomJS
CasperJS

Enjoy coding …

readmore

Enjoy coding…

readmore

Background Blur plugin is a cross browser jQuery plugin for blurring images.

Demo + GitHub

readmore