• Web Development - WAYWO - #8
    5,514 replies, posted
I don't get it, what is that green dot that tries to move with my mouse but just doesn't get it right?
Could somebody explain to me what's wrong with my javascript... object function class substitute thingy :v: I'm trying to define an object called HeightTerrain, and a function within it called geHeightData but when I try to call it I get the error in the screenshot below [IMG]http://i.imgur.com/1kJV9Z5.png[/IMG] [CODE] function HeightTerrain() { this.terrainData = new Image(); this.getHeightData = function(img,scale) { if (scale == undefined) { scale=1 }; var canvas = document.createElement( 'canvas' ); canvas.width = img.width; canvas.height = img.height; var context = canvas.getContext( '2d' ); var size = img.width * img.height; var data = new Float32Array( size ); context.drawImage(img,0,0); for ( var i = 0; i < size; i ++ ) { data[i] = 0 } var imgd = context.getImageData(0, 0, img.width, img.height); var pix = imgd.data; var j=0; for (var i = 0; i<pix.length; i +=4) { var all = pix[i]+pix[i+1]+pix[i+2]; data[j++] = all/(12*scale); } return data; }; this.terrainData.onload = function() { var pixels = this.getHeightData(this.terrainData,1); //for(var i = 0; i<ground.geometry.vertices.length; i++) //{ // ground.geometry.vertices[i].z = data[i]; //} var material = new THREE.MeshBasicMaterial({color: 0x808080}); mesh = new THREE.Mesh(ground,material); mesh.rotateX(270*(Math.PI/180)); scene.add(mesh); objects.push(mesh); } this.terrainData.src = "/content/heightData/data.png"; } [/CODE]
[QUOTE=Nigel_Farage;45308124]Could somebody explain to me what's wrong with my javascript... object function class substitute thingy :v: [/QUOTE] You're missing a semicolon here: [code] for ( var i = 0; i < size; i ++ ) { data[i] = 0 } [/code]
[QUOTE=Nigel_Farage;45308124]Could somebody explain to me what's wrong with my javascript... object function class substitute thingy :v: I'm trying to define an object called HeightTerrain, and a function within it called geHeightData but when I try to call it I get the error in the screenshot below [/QUOTE] [code] for ( var i = 0; i < size; i ++ ) { data[i] = 0 // <--- you're missing a ; } [/code]
2 days wasted over a semicolon. fml. thanks lol
[QUOTE=Nigel_Farage;45308234]2 days wasted over a semicolon. fml. thanks lol[/QUOTE] This is why you use linting tools
[QUOTE=Mega1mpact;45308332]This is why you use linting tools[/QUOTE] I got another similar error after the one above so I think I'm done with webgl, I just can't get along with javascript - I'll definitely use linting next time I'm forced to use it though, it could've saved a lot of pain
How can I spice this landing page up? [url]http://speedsums.com/landingpage/index.html[/url] [img]https://dl.dropboxusercontent.com/s/b6f2m9f9gcjqscj/Screenshot%202014-07-06%2017.59.40.png[/img] (Groupspaces 2.0 is a placeholder name for now) I did try all manner of background images but they didn't seem to work :(
I've been working on a boredom project in the recent past: [URL="https://github.com/PotcFdk/TemPIC"]TemPIC[/URL] - a simple temporary file/image-hoster. [URL="https://i.imgur.com/009mquu.gif"]Upload example 1: uploading an image[/URL] [URL="https://i.imgur.com/TRbxglb.gif"]Upload example 2: uploading a custom file[/URL] [URL="https://i.imgur.com/6Zwg42J.gif"]Upload example 3: trying to upload a file that is too big[/URL] Initial work was done by me, ukgamer ([URL="http://facepunch.com/member.php?u=10981"]fp[/URL]/[URL="https://github.com/ukgamer"]gh[/URL]) made the design base which I then began molesting (I'm not very good with web design).
[QUOTE=PotcFdk;45311084]I've been working on a boredom project in the recent past: [URL="https://github.com/PotcFdk/TemPIC"]TemPIC[/URL] - a simple temporary file/image-hoster. [URL="https://i.imgur.com/009mquu.gif"]Upload example 1: uploading an image[/URL] [URL="https://i.imgur.com/TRbxglb.gif"]Upload example 2: uploading a custom file[/URL] [URL="https://i.imgur.com/6Zwg42J.gif"]Upload example 3: trying to upload a file that is too big[/URL] Initial work was done by me, ukgamer ([URL="http://facepunch.com/member.php?u=10981"]fp[/URL]/[URL="https://github.com/ukgamer"]gh[/URL]) made the design base which I then began molesting (I'm not very good with web design).[/QUOTE] at least one file exceed[u][b]s[/b][/u] Other than that, neat.
[QUOTE=Khub;45311133]at least one file exceed[u][b]s[/b][/u][/QUOTE] Thanks, fixed.
Is there a way we can add that to sharex? Like sending the pic with a http POST and specifying the length it stays up as a parameter? That way I could share things that I might not want a permanent reference to, but still have a backup on my hard drive. [editline]7th July 2014[/editline] nvm just noticed that you aren't actually hosting it yet
[QUOTE=LennyPenny;45311637]Is there a way we can add that to sharex? Like sending the pic with a http POST and specifying the length it stays up as a parameter? [/QUOTE] Yeah, it's possible. Custom uploaders.
So, made a small widget thing on codepen.io yesterday, and got inspired to turn it into a small website template. Turned out pretty nicely, despite it being a while since I last worked with web stuff. [t]http://files.gamebanana.com/bitpit/framekit_2.png[/t] Probably gonna work on it some more during the next couple of weeks, and take it as far as I can. The plan is the make a template that's easily edited to make my life easier. Ideas? Suggestions? [i][url=http://gamebanana.com/members/304167](Can be seen in action here,[/url] although with some minor mistakes because GB is trash.)[/i]
[QUOTE=Kosai106;45313050]So, made a small widget thing on codepen.io yesterday, and got inspired to turn it into a small website template. Turned out pretty nicely, despite it being a while since I last worked with web stuff. [t]http://files.gamebanana.com/bitpit/framekit_2.png[/t] Probably gonna work on it some more during the next couple of weeks, and take it as far as I can. The plan is the make a template that's easily edited to make my life easier. Ideas? Suggestions? [i][url=http://gamebanana.com/members/304167](Can be seen in action here,[/url] although with some minor mistakes because GB is trash.)[/i][/QUOTE] Firefox x64 linux [img]http://i.imgur.com/NUiNTz6.png[/img] text overflowing and wrong font etc
[QUOTE=Mega1mpact;45316203]Firefox x64 linux [t]http://i.imgur.com/NUiNTz6.png[/t] text overflowing and wrong font etc[/QUOTE] Yeah, as I said, GB is trash. I couldn't get the text to flow properly, but I'll look into it. Cheers.
[QUOTE=LennyPenny;45293020]I don't get it, what is that green dot that tries to move with my mouse but just doesn't get it right?[/QUOTE] I'm glad the actual animation was good enough that you had to resort to the green dot for criticism. That's about the nicest thing that's been said to me on facepunch.
[QUOTE=Poo Monst3r;45316456]I'm glad the actual animation was good enough that you had to resort to the green dot for criticism. That's about the nicest thing that's been said to me on facepunch.[/QUOTE] I just thought I would have to do something with the green dot, like a minigame or something. Didn't want to throw criticism before actually understanding the thing. But yeah the animations is pretty nice! (svgs ftw)
[QUOTE=LennyPenny;45316523]I just thought I would have to do something with the green dot, like a minigame or something. Didn't want to throw criticism before actually understanding the thing. But yeah the animations is pretty nice! (svgs ftw)[/QUOTE] The dot was me debugging why I couldn't track the mouse coordinates properly, and it's because I had to change the <svg> width and height to 100% AFTER initiating the Raphael canvas, because the Raphael canvas isn't capable to spanning the width and height of the entire page dynamically (as far as I've found???). So I basically have a 600 x 800 canvas being stretched to 100%, skewing all of the mouse coordinates, for the sake of having the SVG centered on the page. It's a messy issue which I am still struggling with :(.
text-align: center; always worked for me when dealing with svgs
[QUOTE=LennyPenny;45311637]Is there a way we can add that to sharex? [...] [editline]7th July 2014[/editline] nvm just noticed that you aren't actually hosting it yet[/QUOTE] I don't plan to host it for the public, too much legal trouble that I don't have time to deal with. As for ShareX support, if you have an instance running at tempic.example.com, this should work with a custom url uploader entry: [CODE]{ "Name": "TemPIC", "RequestType": "POST", "RequestURL": "http://tempic.example.com/upload.php", "FileFormName": "file[]", "Arguments": { "lifetime": "30m" }, "ResponseType": "Text", "RegexList": [ "\"(.+?tempic.example.com/upload/.+?)\"" ], "URL": "$1,1$", "ThumbnailURL": "", "DeletionURL": "" }[/CODE] Native ShareX support doesn't make sense in my opinion, as the project is not popular enough, so it would just unnecessarily fill up ShareX' config menu.
Yeah I was referring custom uploader
[t]https://dl.dropboxusercontent.com/u/965202/ShareX/Screenshot%202014-07-07%2010.38.37.png[/t] Stuff! (I can't think of a better Gold color!)
The lobster doesn't fit in the thread title imo Looks quite good on the gold members actually, it's quickly turning into the next comic sans though
I've never see it used on any website though. If it's being obnoxiously used everywhere I'll just get rid of it.
google's new material design is pretty cool. polymer etc etc.
Material design is hilarious and not really doing anything new at all. It is literally iOS7 with drop shadows. Google needed something to go against iOS7 and MS's Metro to show that they are a design conscious organization and to help win over the UI design crowd (more designers wanting to work on your platform = better apps = better experience for end users). Have you actually read the PDF they put together for it? It's such a load of flowery meaningless bullshit lol [url]http://static.googleusercontent.com/media/www.google.com/en/us/design/material-design.pdf[/url] "A material metaphor is the unifying theory of a rationalized space and a system of motion. Our material is grounded in tactile reality, inspired by our study of paper and ink, yet open to imagination and magic." AKA "we made things like things in real life"
not entirely sure what i ended up doing this week [url]http://nlan.org/cnn_shit[/url]
[QUOTE=KmartSqrl;45323299]Material design is hilarious and not really doing anything new at all. It is literally iOS7 with drop shadows. Google needed something to go against iOS7 and MS's Metro to show that they are a design conscious organization and to help win over the UI design crowd (more designers wanting to work on your platform = better apps = better experience for end users). Have you actually read the PDF they put together for it? It's such a load of flowery meaningless bullshit lol [url]http://static.googleusercontent.com/media/www.google.com/en/us/design/material-design.pdf[/url] "A material metaphor is the unifying theory of a rationalized space and a system of motion. Our material is grounded in tactile reality, inspired by our study of paper and ink, yet open to imagination and magic." AKA "we made things like things in real life"[/QUOTE] It's not all bad. I like how they explain animations. I hate the colors they picked tho. It's going to look like a bunch of m&m's in a bowl.
While the 'Material Design' concept isn't new at all, I've actually never seen anyone go full out with it. (That includes Google). I'm looking forward to seeing how this will work out.
Sorry, you need to Log In to post a reply to this thread.