public marks

PUBLIC MARKS from decembre with tags dev & example

2018

CSS - PRO TIPS - CSS element() function - [: -moz-element()]Vincent De Oliveira

element() brings CSS design to a new level, in an easily way. Few ideas that comes to my mind (some that I've already used since the last 4 years): - when you have to deal with duplicated content in advanced effects - live thumbnails of previous/next slides in a slideshow - live zoom over an image, for example in an e-commerce product page - animated background, using CSS Animations or by referencing a video, canvas or SVG - faking backdrop-filter or filter() - watermark with multiples backgrounds from Lea Verou idea - and anything you’re currently thinking of ;) Few things we can note: - prefixed for now in Firefox: -moz-element() - impact on rendering performance when using multiple reference. Not as bad as CSS filters, but still something you have to consider - there’s a CanIUse support page - Issue Chromium - Issue WebKit - No mention from IE Platform Status

JAVASCRIPT - IMAGE - LAZY LOAD - Lazy Loading Images? Don’t Rely On JavaScript! | Robin Osborne

(via)
One popular method to deal with this is to “Lazy Load” the images; that is, to only load the images just before the user will need to see them. If this technique is applied to the “above the fold” content – i.e., the first average viewport-sized section of the page – then the user can get a significantly faster first view experience. So everyone should always do this, right? Given the potential limitations, let’s work on a solution that can handle all my concerns: a. works without JavaScript (i.e., lazy loading is an enhancement) b. vanilla js – no dependencies on jquery or angularjs c. works with broken JavaScript (i.e., the browser supports JavaScript, but there’s a js error somewhere which causes your script to break; might not even be your fault!)

2017

USERSTYLES - EXAMPLE - ss16 a Fresh attempt at (user)styling 4chan.... (2017)

ss16 - a self-centered, fresh attempt at (user)styling 4chan * * created on: February 11th, 2016 * last modified: May 16th, 2017 * 4chan X version: ccd0 1.13.89.3 / https://github.com/ccd0/4chan-x * created by: @saxamaphone69 * (loose) coding style: https://github.com/necolas/idiomatic-css * * in an attempt to make the style as user-friendly as possible, i will * comment most of the css to explain what it all does * * please leave any comments, suggestions, or feedback on github: * https://github.com/saxamaphone69/ss16 * */ /** * this userstyle utilises a lot of best practices * and sensible defaults inspired from a variety of * stylish and modern web frameworks and resources, mainly: * https://github.com/twbs/bootstrap */ /** * first thing we do, is we use web fonts from google! * this is so users aren't required to download fonts prior. * and of course, if you don't want to or don't like it, * delete or change it accordingly. we use roboto, roboto mono, * karla, and material icons. circular has been removed in the production * version of ss16 to not only keep the file size down, but also * to not have a font that i don't own the license for :^) */

JAVASCRIPT - syntax - What does "use strict" do in JavaScript, and what is the reasoning behind it? - Stack Overflow

The statement "use strict"; instructs the browser to use the Strict mode, which is a reduced and safer feature set of JavaScript. List of features (non-exhaustive) Disallows global variables. (Catches missing var declarations and typos in variable names) Silent failing assignments will throw error in strict mode (assigning NaN = 5;) Attempts to delete undeletable properties will throw (delete Object.prototype) Requires all property names in an object literal to be unique (var x = {x1: "1", x1: "2"}) Function parameter names must be unique (function sum (x, x) {...}) Forbids octal syntax (var x = 023; some devs assume wrongly that a preceding zero does nothing to change the number.) Forbids the with keyword eval in strict mode does not introduce new variables Forbids deleting plain names (delete x;) Forbids binding or assignment of the names eval and arguments in any form Strict mode does not alias properties of the arguments object with the formal parameters. (i.e. in function sum (a,b) { return arguments[0] + b;} This works because arguments[0] is bound to a and so on. ) arguments.callee is not supported [Ref: Strict mode, Mozilla Developer Network]

FIR - ADDON - Example extensions - Mozilla | MDN

To help illustrate how to develop extensions, we maintain a repository of simple example extensions at https://github.com/mdn/webextensions-examples. This article describes the WebExtension APIs used in that repository.

2014

JAVASCRIPT - TUTO - DEMEO - Web Developer Introduction To Features of JavaScript "Function" Objects

by 1 other (via)
There are several ways to declare a function. All valid, but there are differences on how they're handled in the background.