Web Development

Does media query attributes still work for responsive video sources?

webdev: reddit for web developers - Wed, 11/14/2018 - 14:53

There's a lot of documentation on using "media" attribute to load different video sources depending on the screen size (eg) but it's all pretty old: around 2012, and some say the feature is being debated for dropping out of the specs. Now, I tested this with chrome and firefox and can't get it to work at all. It has been dropped since then? If so, is there a substitute method to use without js to achieve the same goal (and why tho)?

submitted by /u/Zombiehype
[link] [comments]
Categories: Web Development

Looking for a good Alogrithms & Data structures course.

webdev: reddit for web developers - Wed, 11/14/2018 - 14:25

Currently i'm teaching myself webdev with several udemy courses as a "side hobbie" while i work but with the hope of getting a job in the near future.

Next year i want to apply as a jr but i know one of the biggest walls for entry levels are interviews, since i've never studied Computer science and i lack of knowledge related of these topics which course suits to me? i'm willing to pay at least for 1 udemy course and stick with it(i learn faster watching videos than reading documentation).

These are my option but free resources are welcome.

Master the Coding Interview: Data Structures + Algorithms by andrei neagoie https://www.udemy.com/master-the-coding-interview-data-structures-algorithms/

JavaScript Algorithms and Data Structures Masterclass https://www.udemy.com/js-algorithms-and-data-structures-masterclass/

The Coding Interview Bootcamp: Algorithms + Data Structures https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/

Python for Data Structures, Algorithms, and Interviews! https://www.udemy.com/python-for-data-structures-algorithms-and-interviews/

I'm following the MERN path tho so i don't think the last course could work with me.

Thanks in advance.

submitted by /u/MexicanWPD
[link] [comments]
Categories: Web Development

Website loading issue

webdev: reddit for web developers - Wed, 11/14/2018 - 14:13

Client has this website, it visible loads pretty fast, but there is something that is causing the load cycle super long. It also has a SSL issue that I can't figure out. Anyone care to take a peek and give me a suggestion?


submitted by /u/willkode
[link] [comments]
Categories: Web Development

Looking for library for tables with support for fixed header/columns on scroll, as well as sorting functionality. (IE11 support required)

webdev: reddit for web developers - Wed, 11/14/2018 - 13:52

It seems like i can find some libraries that support each, but not one that supports all of the above. What are the best libraries out there for tables?


  1. Fixed Header support
  2. Fixed Column support
  3. Sortable (custom sorting functions a +)
  4. Must natively work on IE11

If it uses jQuery, i'm fine with that because i'm already using it in the project anyway.

In the past I've used floatHead and tablesorter

Note: Not a requirement, but i do like how floatHead has the option to lock the header with the *page* scroll (vs an internal scrollbar). I've used both depending on the page i'm working on.

submitted by /u/memtiger
[link] [comments]
Categories: Web Development

How to add auto increment number for Datatables ?

webdev: reddit for web developers - Wed, 11/14/2018 - 13:34

I have thousand in my database and i want to fetch it into table with Datatables. If i use standar code, it require more than 5 second to fetch all data into my table.

//my first code $data = $dbh->query("select * from bla")->fetchAll(); foreach ($data as $row){ ?> <tr> <td></td> <td><?php echo $row['prov_nama']; ?></td> <td><?php echo $row['kab_nama']; ?></td> </tr> <?php } ?>

Then i read again from Datatables docs and they made some kind of recomendation if i want to use a lot of data i can use defer render . I try and it works, faster than my first code. And i have some kind of problem, i want to add auto increment number into <th>Number</th>. Last time i follow this tutorial with my first code and it solve my problem. But when i use "defer render" from Datatables, it wont work. This is my html view and this is my php file to generate json format from mysql. How i can add auto increment number for my datatable ?


submitted by /u/adeguntoro
[link] [comments]
Categories: Web Development

[Tutorial] Nextjs (React) + Strapi (Node CMS) - Creating a Deliveroo clone with SSR

webdev: reddit for web developers - Wed, 11/14/2018 - 11:27

Great tutorial on creating a Deliveroo clone using React, Strapi.io , GraphQL using SSR with deployment to Heroku!

Definitely recommend checking out:


submitted by /u/MonopolyM4n
[link] [comments]
Categories: Web Development

Best performance way to implement large hero/banner image that covers 40% of the screen?

webdev: reddit for web developers - Wed, 11/14/2018 - 11:16

So recently I was tasked with optimising the performance of my company's homepage. I've done lots of things, including minimising and aggregating JavaScript libraries into one chunky file, embedding the CSS for above the fold content into <head> and deferring the remainder of CSS (minimised) and loading it at the end of body. Same for JavaScript, it loads at the end.

My page looks like this


[Embedded CSS for above the fold content]



[Big hero image]


[Deferred JS]

[Deferred CSS]


In the [embedded CSS for above the fold content] I do have a CSS for the hero/banner that loads the big image through background-url(...) rule.

Is this the correct and fastest way of going about it?

I'm also thinking of having a couple of different sizes of the image that will be served depending on the viewport width using @media (min-width: 123px)

EDIT: formatting

submitted by /u/fatDoofus
[link] [comments]
Categories: Web Development

Multi-page .NET Core with Vue.js, Typescript, Vuex, Vue router, Bulma, Sass and Webpack 4

webdev: reddit for web developers - Wed, 11/14/2018 - 10:50


I made this template( Nuget ) showing how to use .NET Core MVC with Vue as a multi-page application. You can build multiple "mini spa's" to enhance UI or simply use plain .cshtml and Razor if you don't need Vue on a particular page.

I would like to know, how many of you fellow developers actually use full SPA applications and is something like this useful?

submitted by /u/DanijelH
[link] [comments]
Categories: Web Development

What are the best simple e-commerce platforms for small shops?

webdev: reddit for web developers - Wed, 11/14/2018 - 10:05

I have used Moltin with React but their starter templates leave something to be desired. I have also used opencart which is great but feels a bit old school. I’m looking for something similar or in between. Does anyone have any experiences of their own they can share?

submitted by /u/wlfnmn
[link] [comments]
Categories: Web Development

Web dev beta (website auditing with Google)

webdev: reddit for web developers - Wed, 11/14/2018 - 10:05

Web dev beta

helps to teach and test your websites

submitted by /u/yitch
[link] [comments]
Categories: Web Development

Keyboard-Only Focus Styles

CSS-Tricks - Wed, 11/14/2018 - 10:01

Like Eric Bailey says, if it's interactive, it needs a focus style. Perhaps your best bet? Don't remove the dang outlines that focusable elements have by default. If you're going to rock a button { outline: 0; }, for example, then you'd better do a button:focus { /* something else very obvious visually */ }. I handled a ticket just today where a missing focus style was harming a user who relies on visual focus styles to navigate the web.

But those focus styles are most useful when tabbing or otherwise navigating with a keyboard, and less so when they are triggered by a mouse click. Now we've got :focus-visible! Nelo writes:

TLDR; :focus-visible is the keyboard-only version of :focus.

Also, the W3C proposal mentions that :focus-visible should be preferred over :focus except on elements that expect a keyboard input (e.g. text field, contenteditable).

(Also see his article for a good demo on why mouse clicking and focus styles can be at odds, beyond a general dislike of fuzzy blue outlines.)

Browser support for :focus-visible is pretty rough:

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

DesktopChromeOperaFirefoxIEEdgeSafariNoNo4*NoNoNoMobile / TabletiOS SafariOpera MobileOpera MiniAndroidAndroid ChromeAndroid FirefoxNoNoNoNoNo62*

But it does have Firefox support, and as Lea Verou says:

... once Chrome ships its implementation it will explode in a matter of 1-2 months.

That's generally how things go these days. Once two major browsers have support — and one of them is Chrome — that's a huge enough slice of the web that can start using it. Especially when it can be done as safely as this property.

Safely, as in, there is an official polyfill, meaning you can nuke default focus styles and just use :focus-visible styles:

/* Remove outline for non-keyboard :focus */ *:focus:not(.focus-visible) { outline: none; } /* Optional: Customize .focus-visible */ .focus-visible { outline: lightgreen solid 2px; }

But, as Patrick H. Lauke documented, you can do it even without the polyfill, using careful selector usage and un-doing styles as needed:

button:focus { /* Some exciting button focus styles */ } button:focus:not(:focus-visible) { /* Undo all the above focused button styles if the button has focus but the browser wouldn't normally show default focus styles */ } button:focus-visible { /* Some even *more* exciting button focus styles */ }

Seems like a nice improvement for the web.

The post Keyboard-Only Focus Styles appeared first on CSS-Tricks.

Categories: Web Development

Dark modes with CSS

CSS-Tricks - Wed, 11/14/2018 - 10:00

With the introduction of dark mode in macOS, Safari Technology Preview 68 has released a new feature called prefers-color-scheme which lets us detect whether the user has dark mode enabled with a media query.

That’s right. If this becomes a little bit more supported in other browsers, then we might potentially soon have a way to toggle on night modes with a few lines of CSS!

Recently Mark Otto described how we can start using prefers-color-scheme today in order to create themes that dynamically adjust to the new user setting. And the neat thing about this post is that Mark sort of frames it as an accessibility issue and shows how he uses it on his own website to adjust images so that they’re not too bright for the user:

@media (prefers-color-scheme: dark) { img { opacity: .75; transition: opacity .5s ease-in-out; } img:hover { opacity: 1; } }

In the code above, Mark detects whether the user has dark mode enabled with the media query and then makes the images darker so that they match a dark background. This reminds me of an excellent post by Marcin Wichary where he explores a similar technique and goes one step further by adding all sorts of filters to make sure they have a much higher contrast.

Andy Clarke also wrote up some thoughts about how to take this fancy new CSS feature and how we might apply a dark theme across our website. He describes how to pick colors so our light/dark themes are consistent in terms of branding and how we might want to use a lighter font-weight for darker backgrounds. He writes:

Designing for dark mode shouldn’t stop with choosing darker colours. You should also consider altering typography styles to maintain readability for people who use dark mode. Light text against dark backgrounds appears higher in contrast than when the same colours are used in reverse, so to make your dark mode designs easier to read you’ll need to add more white/dark space to your text.

If your fonts offer a lighter weight, using that for your dark mode design will open up the letterforms and make them appear further apart...

What was that? It sure sounded like the joyous applause of typography nerds and designers everywhere!

The post Dark modes with CSS appeared first on CSS-Tricks.

Categories: Web Development