|
This thread is locked; no one can reply to it. |
1
2
|
Need to learn Node.js |
Doctor Cop
Member #16,833
April 2018
|
A few days earlier everything was great. I was doing freelancing in PHP and there was an abundant of freelancing projects in PHP but now suddenly I am unable to find new PHP projects, what I am getting is maintenance or issue resolving jobs on freelancing platforms. I researched it and found that everyone is switching to Node.js and that could be the reason. Many are saying that PHP is going to die and even clients prefer Node for some reason. So I decided to learn Node.js and I started from Tutorialspoint and ended up on W3Schools.com, they are good but I need an easier one that can teach me enough that I can make APIs in it. Please help me and if there is a Node.js person who can give me some tips then it will be great.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
bump for update So you're learning Node.js, how is your plain JavaScript? Are you comfortable working with the DOM? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Simon Parzer
Member #3,330
March 2003
|
From what I've seen, Node.js is still under heavy development. The underlying technology is the V8 JavaScript engine, which also powers Google Chrome. You probably want to learn a framework instead of doing plain Node.js. If you're coming from PHP and want to do "classic" websites, look into Express.js The big strength of Node.js is the package manager NPM, where you have a huge repository of open-source packages. |
Doctor Cop
Member #16,833
April 2018
|
Hi, Edgar. If you can tell me some resources on Frontend so I can learn it easily because official docs aren't helpful and tutorialspoint is better than W3schools but not that helpful. Simon, thanks for the tip but I'm already familiar with them, just not angular and react at this time. If you can tell me some good sources to CSS tips? I know CSS but still I have trouble finding how to do certain things in it.
|
bamccaig
Member #7,536
July 2006
|
There's not really an easy button for front-end unfortunately. I've been doing Web development for about 12 years now, and I am still pretty terrible at frontend too. I recommend you just do tutorial after tutorial of Web page layout and fancy effects and things until you develop a passion for it and a strong toolbox to work from... -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Doctor Cop
Member #16,833
April 2018
|
Only if there was a way to position elements using pixels only like we do in allegro, but I doubt that they will ever give us that power (the browser standards).
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
It's called position:absolute; and position:fixed; . Do yourself a favor and learn CSS. It's what everything else is based off of, along with DOM manipulation. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
The problem with pixel-perfect layouts is that they only work on devices they were designed for. And they often don't work optimally unless the device was built specifically to match the software. Games typically have multiple resolutions that they support, and they generally need to have multiple versions assets in different sizes and ratios to match (or it can be scaled at runtime, but might hurt quality doing so). The Web is designed to be documents first (text, images, and style/layout instructions). Ideally, a document should be able to be rendered on any device, and still be readable/usable. It is up to the browser to figure out how to render the content on a given device given its limitations. HTML and CSS give us the ability to give instructions to render the contents either statically-sized, or dynamically-sized based on the size and ratio of the browser window/screen. The latter is best because users with large screens get to take advantage of it, but users with smaller screens aren't prevented from accessing the content. Yes, it's very difficult to really understand how to lay things out in HTML/CSS in a nonstandard way. Anything is possible, as has been demonstrated by Web design gods, but there are often hacks/workarounds that you need to memorize to achieve it because the straightforward way doesn't always work for various reasons. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Doctor Cop
Member #16,833
April 2018
|
Thanks bamccaig for the advice, I know now that it is very important for web documents to scale so they have to be that way but even in games how to find what the screen size is?
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
You should keep working on CSS and the DOM. The document element of any web page in a browser will tell you the exact dimensions of the browser's viewport. Listening to onresize events will let you know when it changes. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Polybios
Member #12,293
October 2010
|
Node itself is not about the DOM at all, it's basically Google's Javascript engine plus I/O. You want "responsive" design, no one listens to resize events. By the way, I wonder whether my job's information security department knows what an npm i does. |
dthompson
Member #5,749
April 2005
|
JavaScript is my day job for all intents and purposes, so I'm going to weigh in here. I think we need to separate some concerns here. JavaScript is just a language; its culture is what so often positions it as a web-first (or worse, web-only) language. This is largely because of its origin as Brendan Eich's weekend project, and thus (at first) being the only means of accessing web APIs on the client side. Incidentally, server-side JavaScript - like Node - was around as early as 1995, and this disgusting relic of the past confirms that! Anyway, Node itself has a lot of pretty good APIs for more general scripting and server-side development. I'd therefore encourage learning it, but not without some warnings:
One more thing and then I'll shut up: Polybios said: You want "responsive" design, no one listens to resize events. Yes, for goodness sake, use CSS as much as you possibly can - I believe JavaScript is the origin of the term 'spaghetti code', which you'll begin to understand very quickly if you're using it to update a page's layout on resize events ______________________________________________________ |
Doctor Cop
Member #16,833
April 2018
|
Polybios I was talking about games, like is it same for games too? like games made in javaScript use only CSS for styling and positioning? dthompson, I am feeling very frustrated while learning Node.js frameworks and especially the AWT and passport are confusing and I learned all the JavaScript and Node + Express + MongoDB in one month. Did I rush it? Or AWT and passport in fact are confusing.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
dthompson said:
Polybios said: You want "responsive" design, no one listens to resize events. Yes, for goodness sake, use CSS as much as you possibly can - I believe JavaScript is the origin of the term 'spaghetti code', which you'll begin to understand very quickly if you're using it to update a page's layout on resize events How else can you change the layout of the page without using JS? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Polybios
Member #12,293
October 2010
|
Doctor Cop said: Polybios I was talking about games Wait... This started with PHP jobs and how Node could substitute for PHP, clearly somehow Web development backend related. Then Edgar talked about the DOM which only exists in a browser (in the frontend) and now you were talking games all along...? I think games are a totally different subject; I've never done any JS games neither in a browser nor with a Node framework that could also be non-browser. Even in a browser, you would not have to use HTML / CSS but could also just render into e.g. a canvas object. Edgar Reynaldo said: How else can you change the layout of the page without using JS? CSS media queries. |
Doctor Cop
Member #16,833
April 2018
|
Polybios, welcome to our world. Here's a link for starters.
|
Peter Hull
Member #1,136
March 2001
|
Polybios was commenting on that thread before you even joined a.cc, Doc! Re: games you could look at https://phaser.io/ or http://www.melonjs.org/ (there are others, but I've never used them)
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
If you want to program games in Javascript, you should take a look at Momo, Eric's js library and his games. Where'd that bugger Eric Johnson go? I need your sig.... Found it : Long story short, draw everything using a canvas object. (HTML5) My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
dthompson
Member #5,749
April 2005
|
Edgar Reynaldo said: How else can you change the layout of the page without using JS? You'd want to use media queries. They're a bit unwieldy in normal CSS, but using them in SCSS (especially with mixins) is a dream ______________________________________________________ |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Well, you still need to use javascript, but media queries are pretty cool. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
You don't "need" to use JavaScript. You can accomplish dynamic layouts using just CSS with media queries. Sure, you can add some extra flare with JavaScript, like calendar controls and things, but for just changing the layout of a page on the fly as the device parameters change you can do this entirely with CSS. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I didn't read close enough. But it doesn't look like it will respect orientation changes without javascript listening to the media object. I'll try it and post back. Apparently that works. Just call me Doubting Thomas... My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
What you do is define different styles for different media queries. When the device parameters change (e.g., resize the window to fit a different query) the Web page should automatically react by restyling to a new layout to match the new orientation. You can test it with something like this: 1<!DOCTYPE html>
2<html>
3 <head>
4 <title>Media Queries Example</title>
5 <style type="text/css">
6 body {
7 background-color: pink;
8 }
9
10 @media only screen and (max-width: 600px) {
11 body {
12 background-color: lightgreen;
13 }
14 }
15 </style>
16 </head>
17 <body>
18 <p>Resize the window to see it react automatically.</p>
19 </body>
20</html>
If you resize the window to be less than 600 pixels wide then the background color automatically changes. No scripting required. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Edgar Reynaldo
Major Reynaldo
May 2007
|
That's cool. Are Media Queries CSS3 only? Not that that matters anymore. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
1
2
|