Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Search engines are unpredictable, it might happen within a day or it could take more than a week. You can give Google suggestions though Google Webmaster Tools, but I don't know if Bing or other search engines have a similar tool.
  2. Use robots.txt You'll have to wait a few days for search engines to remove your pages from their index if they're already indexed.
  3. If you're not using those variables inside the loop in which they're set then you will only see the values of the last row. What exactly are you trying to do with $count2 and result?
  4. Ingolme

    All reference Css

    No. Just find a CSS reference online http://www.w3schools.com/cssref/default.asp https://developer.mozilla.org/en-US/docs/Web/CSS/Reference
  5. The selectors you're showing apply to <tr> elements, which are rows, not cells. If you want to target cells you need to select <td> and <th> elements. Table cells have their own behavior when being rendered: The width of a cell, including padding and borders, is the same as the width of all other cells in its column The height of a cell, incuding padding and borders, is the same for every cell in one same row. Cells take up as much horizontal space as necessary to fill up the width of the table they're in
  6. I don't think "W3layotus" is affiliated in any way with the W3C.
  7. You have to prevent the form from submitting. Instead of assigning the event to the submit button assign it to the form. Then call preventDefault() on the event object to stop the form from submitting. $('#formLogin').submit(iniciarSesion); function iniciarSesion(e) { "use strict"; e.preventDefault(); // El resto del código sigue a partir de aquí
  8. If you want to be proficient with PHP you will need to learn the fundamentals of programming in general. Algorithms, data structures and the like.
  9. It's more efficient. In the first case you're doing extra calculations to figure out where things would be in the previous coordinate system, in the second case you're transforming the image only once and then not doing any other calculations. Overall, the performance difference between the two is negligible for a simple application like this one. I would go with storing the transformed image on a new canvas so that I wouldn't have to figure out what inverse operations to do to calculate the drag position.
  10. You would have to invert the operation on the profileImgX and profileImgY variables when you transform, then change it back after the transformation is done. Another option is to transform the image before starting the animation and paste it on a new canvas, then draw that canvas onto the other canvas. var transformedImage = new Canvas(); var transformContext = transformedImage.getContext("2d"); switch(orientation) { /* ... Set width, height x and y and do transformations to the context ... */ } transformedImage.drawImage(profileImg, ... width, height, etc. ...); Then in your animation loop just draw the image: function animationLoop() { // Draw image renderProfileImg(transformedImage); // Draw overlay context.drawImage(overlayImg, canvas.width - distanceFromRightSide, canvas.height - distanceFromBottomSide, 183, 242); // Next iteration requestAnimationFrame(animationLoop, profileImg); } function renderProfileImg(img) { /* Calculate position, width, height, etc) */ context.drawImage(img, ... ... ); }
  11. You've forgotten to declare all your variables with the var keyword, which means that most of them are in the global scope. I think you meant to write context.save() here: save.context(); You're making an unnecessary function call here, just set it to EXIF.getData(profileImg, orientateProfileImg) EXIF.getData(profileImg, function() { orientateProfileImg(); }); For efficiency, you should create this outside the loop: overlayImg = new Image(); overlayImg.src = './img/profile_default_red_frame.png'; Now, as I said earlier, to solve your problem you need to do the transformation right before drawing the object you want transformed. /* --- Some code here --- */ function processProfileImg(event) { var overlayImg = new Image(); overlayImg.src = './img/profile_default_red_frame.png'; var profileImg = new Image(); profileImg.src = event.target.result; profileImg.onload = function() { /* --- Some code here --- */ // Get image orientation var orientation; EXIF.getData(profileImg, function() { orientation = EXIF.getTag(this, "Orientation") }); function animationLoop() { // Save context.save(); // Transform transformContext(orientation); // Draw renderProfileImg(); // Restore context.restore(); // Draw overlay context.drawImage(overlayImg, canvas.width - distanceFromRightSide, canvas.height - distanceFromBottomSide, 183, 242); // Next iteration requestAnimationFrame(animationLoop, profileImg); } animationLoop(); hideDefaultProfileImg(); } /* --- Some code here --- */ } function transformContext(orientation) { switch (orientation) { case 0: // 90° rotate left context.translate(canvas.width / 2 + 183, canvas.height / 2 - 242); context.rotate(90 * (Math.PI / 180)); break; case 2: // horizontal flip context.scale(-1, 1); break; case 3: // 180° rotate left context.rotate(Math.PI); break; case 4, -90: // vertical flip context.translate(0, 1000); context.scale(1, -1); break; case 5: // vertical flip + 90 rotate right context.translate(0, 1000); context.rotate(-90 * (Math.PI / 180)); context.scale(1, -1); break; case 6: // 90° rotate right context.rotate(-90 * (Math.PI / 180)); break; case 7: // horizontal flip + 90 rotate right context.rotate(-90 * (Math.PI / 180)); context.scale(-1, 1); break; case 8, 90: // 90° rotate left context.translate(canvas.width / 2 + 183, canvas.height / 2 - 242); context.rotate(90 * (Math.PI / 180)); break; default: // vertical flip context.translate(0, 1000); context.scale(1, -1); break; } } /* --- Some code here --- */
  12. You're going to have to show some actual code if you want me to understand what's going on.
  13. If you want to stop the loop, just don't call requestAnimationFrame(). if (loopCount > 399) { window.location.reload(); } else { // Only called if loopCount < 400 gid = window.requestAnimationFrame(step); }
  14. That's because lastTimestamp starts off as 0. You should have this at the beginning of your function: function step(timestamp) { if(lastTimestamp == 0) { lastTimestamp = timestamp; } This makes sure that on the first frame the delta time is zero so nothing changes.
  15. You have to scale every time you plan to draw the object that needs to be scaled. If you only draw the object once then you only need to scale once. If you draw it on every frame then you need to scale it on every frame.
  16. What do your HTML and Javascript code look like?
  17. You should save before doing a transform, then call restore once you want to return to the original state. Given the code structure you displayed, this should work: Photo is loaded Animation Loop Save context Context is scaled Photo is drawn Restore context Overlay Image is drawn RequestAnimationFrame I don't know what other operations you're doing with the scaled canvas, but if it's just drawing the photo and then the overlay this will work.
  18. That sounds like a Javascript error occurred. You should check your browser's Javascript console for error messages.
  19. I would look at location.hash or location.search instead of location.href. It gives access to specific parts of the URL. If the URL is slideshow.html#image1 then you can access the "1" like this: // location.hash contains "#image1" // substring(6) gets everything from the sixth position in the string and on var slide = location.hash.substring(6); // Convert string to number slide = Number(slide);
  20. How do you intend to tell it which slide to start on? What URL would the links on the other page use?
  21. I don't believe there is access to the prototype of the Window object, and I don't think there is a list of native Javascript objects. Why do you want to do this?
  22. You can use the pattern attribute: <input required pattern="\s*\S{8,}\s*">
  23. Your code has mismatched tags and needs to be properly indented. Be sure to use code blocks on the form to represent code. I don't know exactly what your intention is, but I've rewritten your code to be valid: <form action="mail99.php" method="POST"> <input type="text" value="Name" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Name';}"> <div class="clear"> </div> <div class="your-single"> <i class="email"> </i> <input type="text" value="E-mail" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'E-mail';}"> <div class="clear"> </div> </div> <div class="your-single"> <i class="website"> </i> <input type="text" value="Website" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Website';}"> <div class="clear"> </div> </div> <div class="grid-single-in"> <textarea name="message" cols="77" rows="5" value=" " onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Message';}">Message</textarea> </div> <input type="submit" value="SENT MESSAGE"> </form> This code looks really old. You could do without the onfocus and onblur attributes if you used the placeholder attribute.
  24. The two domains seem to be using different sets of files. Your web host may have some sort of server-side caching going on. The style.min.css file is different on both pages. unclean.co.nz was unable to load bootstrap.min.js.
  25. Like I said, you should use the timestamp that's passed as a parameter to your function. function updateGameArea(timestampIsInHere) { console.log(timestampIsInHere); It's an argument that's passed into your function by the browser. You can give it whatever name you want. You should not use setTimeout or setInterval while using requestAnimationFrame, because requestAnimationFrame is intended to substitute those functions. The concept of "frames per second" no longer exists when you use requestAnimationFrame. Each time the function is called you are given a timestamp telling you the current time with microsecond precision. You have to use that timestamp to determine how much to change the values in your program.
×
×
  • Create New...