Web Development

Web Development Latest News

css-tricks.com

CSS4

Tab Atkins in 2012: There has never been a CSS4. There will never be a CSS4. CSS4 is not a thing that exists.

css-tricks.com

How To Create A Headless WordPress Site On The Jamstack

Just this morning, Chris shared a streamlined way to get a static site up and running with Netlify. As it happens, Sarah and I also wrote up a little something that expands that idea where a static site can pull content from WordPress using the REST API. Using Vue, Nuxt, axios, and Netlify, it’s possible …

css-tricks.com

PHP is A-OK for Templating

PHP templating often gets a bad rap for facilitating subpar code — but that doesn’t have to be the case. Let’s look at how PHP projects can enforce a basic Model, View, Controller (MVC) structure without depending on a purpose-built templating engine.

css-tricks.com

Overcomplicatin’

There’s some famous quote that goes something like… When we’re young, we make simple things because that’s all we know. Then we learn how to make complex things so we make complex things. When we grow old, we learn to make simple things again. Brad recently wrote about this abstractly in regard to musicianship, but …

css-tricks.com

Possibly The Easiest Way to Run an SSG

“Static Site Generator,” that is. We’ll get to that in a second. Netlify is a sponsor of this site (thank you very much), and I see Zach Leatherman has gone to work over there now. Very cool. Zach is the creator of Eleventy, an SSG for Node. One thing of the many notable things about …

css-tricks.com

The Three Types of Code

Every time I start a new project, I organize the code I’m looking at into three types, or categories if you like. And I think these types can be applied to any codebase, any language, any technology or open source project. Whether I’m writing HTML or CSS or building a React component, thinking about these …

css-tricks.com

Freezing User-Agent Strings

There’s been news about Chrome freezing their User-Agent string (and all other major browsers are on board). That means they’ll still have a User-Agent (UA) string (that comes across in headers and is available in JavaScript as navigator.userAgent. By freezing it, it will be less useful over time in detecting the browser/platform/version, although the quoted …

css-tricks.com

Get Moving (or not) with CSS Motion Path

We just linked up the idea that offset-path can be cleverly used to set type on a path. Don’t miss Michelle Barker’s experimentation either, with drawing paths or animating text along a path. Dan Wilson has also been following this tech for quite a while and points out why the sudden surge of interest in …

css-tricks.com

Full Stack Panic

A new podcast from Sean Fioritto inspired by Joel Califa’s term “Full Stack Anxiety”. … the little voice in your head says … “I should know all of this. Do I even know what I’m doing?” Why do web developers the world over feel like this? There is an episode with Joel talking about it …

css-tricks.com

Innovation Can’t Keep the Web Fast

Every so often, the fruits of innovation bear fruit in the form of improvements to the foundational layers of the web. In 2015, HTTP/2 became a published standard in an effort to update an aging protocol. This was was both necessary and overdue, as HTTP/1 rendered web performance as an arcane sort of discipline in …

css-tricks.com

Smaller HTML Payloads with Service Workers

Short story: Philip Walton has a clever idea for using service workers to cache the top and bottom of HTML files, reducing a lot of network weight. Longer thoughts: When you’re building a really simple website, you can get away with literally writing raw HTML. It doesn’t take long to need a bit more abstraction …

css-tricks.com

Sticky Table of Contents with Scrolling Active States

Say you have a two-column layout: a main column with content. Say it has a lot of content, with sections that requires scrolling. And let’s toss in a sidebar column that is largely empty, such that you can safely put a position: sticky; table of contents over there for all that content in the main …

css-tricks.com

“resize: none;” on textareas is bad UX

Catalin Rosu: Sometimes you need to type a long reply that consists of many paragraphs and wrapping that text within a tiny textarea box makes it hard to understand and to follow as you type. There were many times when I had to write that text within Notepad++ for example and then just paste the …

webprogramiranje.org

Uvod u MVVM arhitekturu

MVVM pattern MVVM (Model-View-ViewModel) je patern koji razdvaja aplikaciju na više komponenti tako da svaka komponenta ima svoje specifične odgovornosti. Pri korišćenju MVVM paterna “kod” aplikacije je razdvojen na tri dela: View, ViewModel i Model, ova arhitektura je preporučena od strane Google-a kao jedan od najboljih načina strukture koda Android aplikacija. Osnovne karakteristike ovog pristupa …

webprogramiranje.org

Popunjavanje ViewPager-a koristeći PagerAdapter

Šta je ViewPager? ViewPager je Layout Manager koji omogućava korisniku da se kreće kroz stranice podataka pokretima na levo ili desno, dok se pri promeni stranica izvršava i ugradjena animacija. Najčešće su te strane sa podacima su fragmenti, mada mogu da budu i nešto drugo kao npr. slike koje se slajduju… ViewPager se popunjava podacima …

webprogramiranje.org

Adapter za RecyclerView

Uvod Adapter je most između izvora podataka (Array objekat, List objekat…) i korisničkog interfejsa. Uloga adapter objekta (implementira Adapter interfejs) je da čita podatke iz različitih izvora podataka, i na osnovu njih popunjava View objekte članove nekog ViewGroup-a. Do sada smo koristili ListView ali preporuka je da se umesto listView-a koristi RecyclerView, a naručito kada …

webprogramiranje.org

Custom ArrayAdapter u Androidu

Uvod U osnovnoj verziji adaptera se koristi samo jedan String podatak koji se smešta u neki od predefinisanih android layouta sa jednim TextView-om. Custom adapter se razlikuje od “običnog” po tome što je kod njega jedan element liste predstavljen sa više podataka te je potrebno definisati “složeniji layout” koji bi prihvatio i prikazao te podatke. …

webprogramiranje.org

ArrayAdapter (osnovni android adapter)

Uvod Adapter je most između izvora podataka (Array objekat, List objekat…) i korisničkog interfejsa. Uloga adapter objekta (implementira Adapter interfejs) je da čita podatke iz različitih izvora podataka, i na osnovu njih popunjava View objekte članove nekog ViewGroup-a. ViewGroup: ListView, RecyclerView, GridView, Spinner, Gallery čiji sadržaj se popunjava korišćenjem adaptera se nazivaju zajedničkim imenom “AdapterView”. …

webprogramiranje.org

Konvertovanje XML resursa u View objekat (“Layout Inflating”)

Uvod “Layout inflation” je termin koji označava postupak sa kojim se XML resurs parsira i konvertuje u View objekat. Aktivnost ima svoju metodu setContentView() sa kojom inflate-uje svoj root view: Primer

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.neki_view);
}

12345

@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.neki_view);}

Ali konvertovanje drugih layout-a u View objekt (čime omogućavamo da elementi layout-a budu dostupni u kodu aktivnosti) možemo da uradimo na sledeće načine: …

webprogramiranje.org

Fragment u okviru androida

Uvod Fragment je modularni deo aktivnosti, koji ima svoj životni ciklus, prima sopstvene ulazne događaje, možete ga dodati ili ukloniti dok se aktivnost pokreće. Fragment objedinje View i logiku tako da se može jednostavno višekratno koristiti unutar jedne ili više različitih aktivnosti. U aktivnostima može biti više od jednog fragmenta tako da svaki fragment može …

webprogramiranje.org

Kreiranje custom listenera u Androidu (listener pattern)

Uvod “Listener pattern” je jedan od najčešće korišćenih paterna koji se koriste pri razvoju aplikacijja. Princip rada se zasniva na tome da u jednoj klasi definišemo dogadjaj i trenutak kada se započinje izvršavanje dogadjaja (“okida dogadjaj”), dok u drugoj klasi definišemo objekat (tzv. listener objekat) koji osluškuje taj dogadjaj i reaguje na njega. Postoji priličan …

webprogramiranje.org

Uvod u asinhrone operacije i multithreading Androida

Šta je Thread i multithreading? Thread (srp. nit) je niz uputstava u okviru programa koji se može izvršiti nezavisno od drugog koda. Ako kompjuter ima više procesora i operativni sistem koji podržava tzv. multithreading, to omogućava programerima da dizajniraju programe čiji se thread-ovi mogu izvršavati istovremeno. Thread mehanizmi “Looper” i “MessageQueue” su mehanizmi koje koristi …

webprogramiranje.org

Kreiranje menija kod android aplikacija

Kreiranje sadržaja menija Ovaj specifični meni se prikazuje u sklopu Gde se nalaze meniji? Za svaki meni je potrebno definisati stavke koje se nalaze u njemu. To se definiše u XML formatu u fajlu koje se nalazi u specifičnom folderu pod nazivom “menu” (nalazi se u sklopu “res” foldera). Ovaj fajl generišemo desnim klikom na …