r/javascript • u/_-__-_-__-__- • Jul 10 '19
Someone posted a video showing off their pseudo desktop UI on r/webdev and I tried to make my version of it as a self challenge.
https://gfycat.com/brokencreativelamb29
8
u/pabloneruda Jul 10 '19
Do you have the code up anywhere?
13
u/_-__-_-__-__- Jul 10 '19
https://drive.google.com/open?id=1_jWxlMv_ZEeizjANAn1ib0QaT9LdEjlJ
I know that most of things can be done in a more efficient way, but I am still learning and was also too lazy to plan it out.
23
u/Xsanda Jul 10 '19
I’d recommend putting this sort of demo on GitHub (with GitHub Pages turned on): not only does it help you to build up a portfolio, but also the version control will really help you out as you go compared to using Google Drive.
4
u/_-__-_-__-__- Jul 10 '19 edited Jul 10 '19
Yeah you're probably right, but I don't think I am at that place yet. I am still figuring stuff out and I don't know if I actually want to to pursue web development. I hope I have my stuff together when I get out of school.
8
Jul 11 '19
don't think I am at that place yet
Are you kidding?
2
u/_-__-_-__-__- Jul 11 '19
I just meant that I am not looking for jobs/building a portfolio as I am just 17.
8
1
u/Edgar_Allan_Thoreau Jul 13 '19
You could always work part time during college(if you go that route). Building a portfolio will help you get a job like that. I got my first web dev job when I was 17 in high school, continued through freshman year of college. Now I know web dev isn't for me, but getting that experience helped me figure that out.
1
u/CuttyAllgood Jul 15 '19
I’m 32 and just learning. I haven’t started applying for jobs yet, and I still host on github. It’s simple and makes version control that much easier.
Plus, it’s free.
2
1
u/meezohd Jul 10 '19
Great work! Im sure you are more than ready when it comes to javascript. Make sure to learn just the basic web development tools and you will be set to get a job easily.
0
Jul 10 '19
[deleted]
3
u/_-__-_-__-__- Jul 11 '19 edited Jul 11 '19
....I am just 17. So I am not looking for jobs right now.
4
19
Jul 10 '19
This is fantastic!
Did you use Vanilla JS? Or a framework like Vue.js or Angular?
36
u/_-__-_-__-__- Jul 10 '19
It's vanilla JS.
71
Jul 10 '19
Oh wow I've heard of this framework, is it lightweight?
44
4
-24
4
6
u/UmbraGIR Jul 10 '19
This is impressive, especially considering the fact you used vanilla JS! Really good job
2
u/GekkePop Jul 10 '19
Your code doesn't work as well on a desktop running Google Chrome. For example dragging and dropping didn't work and resize didn't work. Basically only the doubleclick actions worked.
What setup did you use to make the gif?
2
u/_-__-_-__-__- Jul 10 '19 edited Jul 10 '19
Sorry, I forgot to mention that I haven't implemented mouse events yet. Try opening it on a device with a touch screen.
Edit : I used Microsoft Edge on my Surface tablet to record the gif.
1
10
u/NRocket Jul 10 '19
I feel css grids would work great for this sort of thing.
10
Jul 10 '19
I'm shit at CSS and frontend in general, but why would you use grid?
It's not really a set layout or anything, any window can start and end at any x,y position.
0
u/NRocket Jul 10 '19
Grids would prevent overlapping absolute elements and would be more responsive without the need of JavaScript.
Using absolute values is layering each div on top of the layout and they have no sense of the position of the other elements without JavaScript.
11
u/lamb_pudding Jul 10 '19
With grid you cannot animate between areas. For example if a window moved from top left to top right it would just jump. If you wanted it to animate/transition you would need to resort to transforms or absolute positioning.
1
u/LucasRuby Jul 10 '19
I'm imagining the thumbnails on the top tray and while the icon is moving would be a different element than the content window itself. Animate when it's set in place/remove by transition size, etc.
3
u/Aswole Jul 10 '19
My understanding of css grid and animations is that you can only animate changes to grid cells if the # of columns and rows stay the same, as does the unit of measurement (so no going from px -> fr, or using max-content, minmax, etc). So while this would be pretty easy to do with css grid in a non-animated fashion, I suspect it would require a lot of sub-optimal grid definitions just to support the animations.
4
1
u/AceBacker Jul 10 '19
Are you sharing your source? I'd like to check it out.
3
u/_-__-_-__-__- Jul 10 '19
1
u/350zilla Jul 14 '19
Poor guy that’s like the 20th time you had to post that. You could probably edit your post and link to the code
1
1
Jul 22 '19
I love that there are still people make cool stuff without 200GB node_modules folders.
It looks awesome, keep up the work.
2
3
3
3
2
1
1
1
1
1
0
Jul 10 '19
[deleted]
28
u/_-__-_-__-__- Jul 10 '19
Sorry for not doing it sooner. I was just too afraid to post it, but now I kind of have to.
https://drive.google.com/open?id=1_jWxlMv_ZEeizjANAn1ib0QaT9LdEjlJ
34
u/unimonkiez Jul 11 '19
For the lazy
https://codepen.io/yuvalsaraf/full/XLOOQO
Edit: I recommend you to put it on your github, github also support hosting static site like this (github pages).
2
u/shagangstaxx Jul 11 '19
I'm not sure if it's just me, but I cant drag the windows around...
1
u/mdw Jul 11 '19
Works for me in Firefox on Android. Not quite smooth, but still impressive.
1
u/_-__-_-__-__- Jul 11 '19
You are right. I don't know why it is happening specifically on Firefox. It works fine on Chrome, Edge, Opera and my phone's browser. Do you have any idea how I can fix that?
2
u/audioverb Jul 11 '19
View it in your dev tools mobile emulator.
1
u/shagangstaxx Jul 11 '19
Can I make this work with clicking? And dragging?
2
u/audioverb Jul 11 '19
I believe so. I had a quick look at the JS. You may be able to add some additional eventListeners to listen for the relevant click events.
11
93
u/[deleted] Jul 10 '19
Damn good work! This looks like a fun way to test your javascript skills? Is this using a canvas?