Everything posted by Fee
-
Daily Questions App
So, I was given a five year journal for Christmas. The general idea is that each day of the year the journal has a question, for example: "Can people change?" "How could today have been better?" "Today was tough because..." You get the idea, 366 days (to account for leap years), 366 different questions. Each page has space for five separate answers. Each year you start the book again from the beginning. I guess the primary aim of the book is to look back on your answers nostalgically and see how your situation, circumstances, views etc. change over time. I've decided to shamelessly rip-off this idea, and re-build it as an app. I'll most likely build a progressive web app, that'll run on mobile and desktop, although I may build the web and mobile front-ends separately, not yet 100% set on the technologies I'll use. Either way, that isn't what this thread is about. Although I'm comfortable enough ripping the general idea from this book, I don't just want to carbon-copy the questions they use. So, I've put this out to a few different communities to see if, with your help, I can come up with some interesting questions. P.S. I doubt very much I'll ever release the app, and I certainly won't monetise it so I'm not super concerned about Copyright law. I just like the idea, and figured it would be fun to put together. However, I am terrible at thinking up stuff like this (the questions).
-
Image to appear while typing: coding question
Really depends. Where are these images? Do you have a number of images stored somewhere, that you would like to retrieve when the user types into the textbox? Or are you aiming for something more like a Google image search, wherein the user can type any search term and be shown an image? If you're aiming for the first scenario with stored images, I'd recommend: Use the following JS-library to preload a JSON manifest of images, assign them tags e.g. "Chocolate", "Flowers" etc. https://www.createjs.com/preloadjs Create a textbox with an onchange value that calls a JavaScript function. Have this JS function write matching image/s to the screen. Effectively, this solution would be handled solely on the client-side, so, should be pretty snappy. <div id="image_shows_here"></div> <input id="txt_search" type="text" onchange="getImages()"> <script> function getImages(){ //Write your images to the page here... } </script> If you're looking for functionality that is similar to a search engine image search, you'll have to lean on an API to achieve this. As far as I know, Google Images API is discontinued. Bing does offer a service as linked below: https://azure.microsoft.com/en-us/services/cognitive-services/bing-image-search-api/ You'd need to look at making AJAX requests (most likely) to the API if you wanted the images to appear without page refresh. You'd also have to place a great deal of faith in the "Safe Search" capabilities of Bing - you'd be serving images on your website/app from arbitrary sources. For example, what's to stop me searching for "boobies" and populating your website full of NSFW content. Again, you're leaning on a pretty well-established search engine, so this should, in theory, be safe, but some images are bound to slip the net which is something to consider.
-
Auto Fullscreen or Not
My understanding of the Full Screen API is that it only works during user interaction, so it cannot be used maliciously. As per: https://stackoverflow.com/questions/19355370/how-to-open-a-web-page-automatically-in-full-screen-mode Maybe some context would help us understand why you feel the website needs to go full screen, and why you think interaction will interrupt this process? Full screen has a very narrow usage, for example, as used by YouTube, when I watch a video I don't want to interact with my browser for a time. So, I temporarily hide that functionality, if I choose! Auto full screen on YouTube would be annoying - something to consider. For still images, I wouldn't imagine wanting to view them for longer than a couple of seconds before I continue to interact with the browser. For that interaction, I need access to the browser's features I do not want them hidden from me. When you add-in what could be considered intrusive interaction (full screen, audio etc.) always allow the user to opt-in, rather than opt-out.
-
Mobile menu not working on scroll
I've just tested and it works for me using a Galaxy S9 without issue. However, your site is taking an age to load.. Running it through Google's speed test gives a score of 25/100. https://developers.google.com/speed/pagespeed/insights/?url=beeoutdoor.co.uk It'd be worth looking into this.
-
Interactive 'sandbox'
Use preloadJS to load a bunch of images, then EaselJS to provide the drag-and-drop functionality: https://createjs.com/ The following tutorial will show you how to achieve drag-and-drop with EaselJS: https://www.createjs.com/tutorials/Mouse Interaction/ Sending you the end design is slightly more difficult... You could track everything that happens on the canvas in a JavaScript Object. When an image gets added, add it to the object, when a user drags it, update the X and Y coordinates. When the user hits send you'd simply need to JSON.stringify the object and either save it to a database or send it to yourself somehow. Although saving in a database is probably the optimal solution as clients would be able to revisit their design at a later date. When you'd like to view a client design, you would need to read the JSON string back in, parse it and then loop through the JavaScript Object to rebuild the canvas. Alternatively, using the following two libraries, you could export the canvas as a PDF: https://html2canvas.hertzen.com/ https://parall.ax/products/jspdf I've made a similar app which is used by children to build an interactive Life Story Book (https://en.wikipedia.org/wiki/Life_story_work) and I can tell you from experience that what you're suggesting will be a massive undertaking in terms of development, before it is anywhere near useful. That said, the above will allow you to make a proof of concept that allows clients to drag some images around a canvas and save the result.
-
Browser Support
Have a look at the following link which gives a breakdown of browser support, and even more crucially an estimated usage percentage: https://caniuse.com/#feat=css-grid CSS Grid Layout comes in at 88.17% global usage if prefixed. Obviously, the usage statistics for your site may be higher or lower depending on your specific audience. To me personally, CSS Grid Layout has enough browser support to be used. However, 11.83% is by no means an insignificant figure and as such I would be looking at writing some fallback CSS to deal specifically with older browsers rather than not catering for them entirely. There is definitely some merit to feature queries and as far as I know all browsers that do not support CSS Grid, will support feature queries - so, this might be worth looking in to: https://hacks.mozilla.org/2016/08/using-feature-queries-in-css/ I think though you've hit the nail on the head with "Considering using css grid to increase efficiency but not sure if it is worth it" this I believe is the crux of it. Yes, CSS Grid increases efficiency- but when you are forced to write fallbacks the net time spent on utilising the technology may be better spent elsewhere.
-
Please review my website - Web designer
I really like the logo. A couple of things I picked up on, just had a quick look. On the home page I think there could be a good deal more contrast between the navigation/logo and the background. I'd also probably prefer a sticky navigation. I think the "Five stars on Trust Pilot" section should link to trust pilot for authenticity purposes. With regard to CSS Google prefers one file. If you minify it, even better. Some people will have two separate CSS files; The one 'main' CSS file contains layout-essential CSS - everything else gets loaded after the fold in a separate CSS file using a <noscript> tag. This in theory should speed up page load somewhat, although I've never tested this personally. I personally stick to one CSS file, minified.
-
CSS Div in dropdown not displaying correctly
Give all the DIVs an identical class. On click, use JavaScript to toggle a hidden class on all DIVs with the same class, to hide all the DIVs. Then build in an exception that doesn't add the hidden class to the DIV that fired the event - i.e. the one that was clicked.
-
Which database to store website data
You'll need a server side scripting language to query the database such as PHP. MySQL would certainly work but there are numerous other considerations such as sanitizing input/protecting against SQL Injection to name one. I'd suggest start at the beginning and try to find a decent tutorial covering each of the WAMP (Windows, Apache MySQL, PHP) stack elements individually. If you install PHPMyAdmin with this stack you'll have a web based control panel for easy database interaction.
-
React and Vue - Opinions?
Building something similar in both frameworks is a good idea, thanks for that. I have a todo app built in Node just using JQuery on the front-end, so I'll likely make a frontend in Vue and React. Why is there much hype surrounding Cordova if it's so poor? I mean, I get it will never perform as well as a native app, but I thought it was still a viable option for small - medium apps? I will certainly look into React Native though. Cheers for the advice.
-
React and Vue - Opinions?
So, I've got some spare time on my hands over the next few months and I would really like to spend it working with a front-end framework. I've spent the last 3 - 4 months getting more comfortable with Node, and want to expand this by building on my front-end skillset. I used to be pretty big on AngularJS, but I've moved away from that recently and would like to focus on something a bit more up-to-date. I am torn between spending some time getting to grips with Vue or opting instead for React. I appreciate that React has more employment potential, but this is really just for my own benefit. What I am struggling with, is trying to find a balanced opinion on what the pros and cons of each framework are. So, I am wondering if any of the members here have spent time in each framework, and could provide some opinions on the benefits/drawbacks of each? Down the line, I want to move into Cordova development. My knowledge of Cordova is at this point totally lacking, so I might be misunderstanding it entirely but I wonder if a specific framework would be more suited toward this? If so, that would be a big selling point for me. Any thoughts on this would be most appreciated.
-
Clicking on a button or link adds something to textarea
I'd be inclined to use a ready-made solution. It's going to perform better and be much easier. I've used SCEditor in the past. It's fairly decent: https://www.sceditor.com/ It comes with loads of options (buttons on the toolbar). If you only want the ones listed above, check out this page on the documentation to limit the options: https://www.sceditor.com/documentation/options/
-
Design website for travels
My first question would be, how does this differ significantly from the services Google provides via their Maps functionality? All of the features you've listed above are currently available: I can search for a City and I can read about all the different things there is to see and do. This is linked in with Google Reviews/TripAdvisor. So, I can read what others are saying, see photos, consult opening times and pricing. I can also do searches based on what is Nearby. For example, consider I was at a conference in Berlin at the Berlin Congress Center, I could have Google provide me with a list of hotels in the vicinity, view the reviews, check out the prices, and be linked directly to the hotel's website to make a booking. Maps also provide route planning, so I can get around easily. In one-click, I can toggle between driving, cycling, walking, trains or buses. This provides me with a detailed route, time and distance. I can also download the instructions straight to my device, for offline use. If I need to use a train/bus, I am provided with the service number and a link directly to the provider so that I could buy tickets online. What your proposing is a serious undertaking, and it would be extraordinarily difficult without programming experience. I think even one developer would struggle with a project this size. Beyond that, however, an even greater challenge would be collating all of the data you would need to make this usable. Where are you going to get the maps of all the cities? The train/bus timetables, all of the information about things to see and do? There is only one repository that I know that could provide this, and that is Google Maps, and as I said they already offer all of these features. So, you'd essentially be re-building Google Maps using Google's various APIs. I don't want to dishearten you, it seems you have a project which you are excited about, which is really cool. However, for me, the first step in any undertaking is to scope out what has already been done. I would then gauge the suitability of the project based on that. For example, are there any glaring issues with the current solution? Could I bring something new to the table? And a bunch of questions of that nature. In this case, I think you would struggle to improve upon the solutions already available. Why not consider creating a travel blog? You could write about all of the places you've been, the things you've seen and experienced, plus provide useful insider knowledge and tips to people looking to travel to the places you've visited. That is is something that would be of value to visitors. Providing your content is interesting. It's also something that will be much more achievable without having a programming background. Find yourself a decent free WordPress theme (there are hundreds out there) and you're good to go! If you like the idea of having maps of cities where you can provide your own insights, you could use Google Map's API. Embed a map in your website, create your own custom pins for places of interest, with your own content. You could place this on your blog's homepage and have each pin contain some useful info, and then a link to full blog post about your experiences.
-
Go to ID button scroll effect
Can you dump your entire code here? I'll take a look at that for you. Based upon your description I'm not fully sure what you are trying to achieve, but I am struggling to understand why you would want to make a user click twice to interact with a button? That'd annoy the hell outta me, personally.
-
Div Height
It might be beneficial to produce the layout you are looking for graphically, in something like Photoshop/GIMP/Paint. Because at the moment I am not fully understanding what it is you want to achieve. If you can show me the structure you'd like, I'd gladly mock something up. Off the top of my head, if you want divs side-by-side with equal height, Flexbox is the way to go.
-
Identify Input ID
$id = $('#myform input').map(function() { return this.id; }).get(); This, I hope, should return the ID of any input element in your Form, if you have multiples it will return an array of IDs - but I think you just have one that dynamically updates, right? I'm at work, so I cannot actually test this. I hope it works for you. If you have multiple input elements, you will need to target the element based upon something like class, as Lyndsey suggested.
-
Enlarge Images When Mouse Hover
You are using an internal stylesheet; everything inside the <style> tag is CSS. With regards to the mark-up you have posted you are applying the styles to a div element. Look at the div underneath the "Hover over div element" paragraph: <div class="zoom"></div> - this is the green rectangle. You are applying the CSS class Zoom to this element. To swap it out for an image, simply replace this div with an img tag and apply the zoom class: <img class="zoom" src="your_url_here" alt="your_alt_here" /> However, you should seriously consider fisicx's point-of-view. This really isn't taking into account users with touchscreen devices and they make-up a huge portion of your user base. What is the purpose of this image zoom? If it is providing some sort of essential functionality, you probably need to re-think it. There is a methodology in web design known as Progressive Enhancement. Essentially, what this means is that you need to start with a rock-solid foundation that provides ALL the functionality to ALL users and then you can start to build additional enhancements that target specific visitors, that offers an improved experience i.e. things like hover effects. Now, the pros and cons of this methodology are another topic altogether, I would usually start with a mobile first approach and if I couldn't find a way to deliver an aspect of a website's design to everyone, I would drop entirely or find another way to achieve it. Regardless, you need to ascertain whether this hover element fits into the first category of essential functionality, or could be deemed a progressive enhancement. If it is the first category - I would abandon it, if it is the second category, you could probably get away with it, however I still personally wouldn't recommend it. Onto fisicx's second post, his solution here is also good, you need to contain the zoom, my implementation in my first post was quite lazy, fisicx's is the one you want if you do decide to go-forward with this. You really just need to copy the code from the code pen and paste it into the right-place in your mark-up. Taking some time to understand what is going on is beneficial too however. Rename your zoom div to have a class of "item" - which matches the class of the CSS setup in the code pen. This DIV is essentially going to be a container for your image element. inside this div insert your image, you don't need to specify a class for it. The rest of the code you'll need to copy to your internal styles, inside the <style> tags. The first part (*) applies these styles to all elements on your page. The box-sizing property defines how the width and height of an element is calculated, basically, do they include padding/borders or not. The next section of the CSS (.item) is applying styles to the container element. Here you are defining a relative position, a width, some margins and a border and crucially an overflow: hidden, this is what contains the image as it grows. The final two sections .item img and .item:hover img apply styles to the image element within the container (.item) and setup the hover styles for this element. You are basically saying all images within the .item div should transition for 0.3s (i.e. it should take 0.3 seconds to complete the transition) - that transition being the increase in scale which is defined in the hover styles. You'll notice it is defined multiple times with different prefixes (-moz, -webkit) this is to ensure cross-browser compatibility. To summarise, just copy and paste the code from the code pen in fisicx's post. Copy the HTML into the body of your document and include the image you want to zoom in inside the .item div. Copy and Paste the CSS within your <style> tags.
- Enlarge Images When Mouse Hover
-
Image Grid with Dropdown Layers (Plugin Search)
Personally, I would use flex-box to achieve the layout. Check out the following tutorial, it should explain how to achieve the layout: https://css-tricks.com/snippets/css/a-guide-to-flexbox/ iirc flex-box has been supported since IE 11.0 or so, all of other browsers should manage it no bother too. With regards to the actual functionality - I doubt you'd find a plugin to achieve that exact functionality. It shouldn't be too hard to do though, depending on your JavaScript capabilities. I've done a quick hack-up of some functionality, basically just an index page with four images. Each has an ID which is passed to a JavaScript function, there is four corresponding DIVs which are hidden by default on load. When an image is clicked the JavaScript function will show it (with some animation) and hide the others, so only one is showing at a time. There's a next and previous link, that'll loop-back too. It's not pretty but should be a decent enough starting point:
-
Zoom to image coordinates?
No, I doubt there is software solution to this problem to be honest. I'd be happy to build it for you, for a reasonable price, wouldn't take me much longer than an hour I'd wager. But, we would need to discuss your exact requirements. Drop me a message if that's an option.
-
Zoom to image coordinates?
I'm not sure why you would want to replicate that exact design. In my opinion it is pretty poor. If you want to show or hide content on click, your best is JQuery: http://api.jquery.com/show/ Have a look at the documentation for this, you should be able to adapt this to fit your needs. You will need to put the target of the action as your graphic slices, then show/hide the respective information, depending on which is selected. JQuery has easing effects too, if you want to animate the transitions between content: http://api.jquery.com/slidedown/
-
Smooth Wavy/Skew Background Sections
I think SVG would be the way to go. Using the border-radius property would be a possibility, but since as far as I know it isn't possible to create a double curve in CSS, you would need multiple pseudo elements to achieve this. You might even be able to do this using a radial-gradient as a background image, but again I would suspect you would need pseudo elements. It's actually quite a tough shape to create, I had a go using the two CSS methods I mentioned above and couldn't get that close. The background gradient on the other hand is no problem. Use a linear-gradient property on a background image, as seen here: Code Pen Linear-gradient is supported by most if not all browser I believe.
-
Blur hover effect
Without seeing your code it's quite difficult to make a suggestion. I'm assuming you will need to target the image itself, rather than the div. Post your code inside the code tags or dump it at the link below and people will be able to help much more effectively. https://codedump.io/
-
HTML Page With AngularJS Routing Features
I should probably note that the solution I provided is outdated, it uses AngularJS. The more recent framework is just known as Angular. If you're going to start going down an Angular route, it'd probably be better to focus on the more recent framework. The following tutorial should help: https://scotch.io/tutorials/routing-angular-2-single-page-apps-with-the-component-router I would still give Angular a chance, in terms of job opportunities it is still miles ahead of React and has a bigger community to get support from (a result of being an older technology). A lot of the problems have been addressed in the move from AngularJS - Angular and although it's nowhere near a perfect tool (neither is React) it's still a strong tool to have in your arsenal. I reckon you should check out this article, give it a chance http://blog.techmagic.co/angular-2-vs-react-what-to-chose-in-2017/
-
Chrome Extension to Capture Open Tabs
Okay - I've had some progress. I was hoping some people here might have some ideas on how to proceed. The extension can capture all the open tabs and save this to a user's local file system as a .bat file - using FileSaver.js. However, this just feels a bit... unethical. Rightly so Chrome gives a security warning prior to the download. I'd really like to generate a HTML file on the fly with inline JavaScript used to open all the captured URLs, this could then be saved to the user's local file system. This method, however, is impossible due to Chrome's pop-up blocking methods. Can anyone think of a smart way around this? Next step, once this is solved, is to incorporate an interface for naming the file prior to download. Anyway, if anyone is interested, here is the code: background.js // background.js var activeSession = []; // Called when the user clicks on the browser action. chrome.browserAction.onClicked.addListener(function(tab) { //Tab query with no parameters, returns all open tabs. chrome.tabs.query({}, function(tabs){ //For each tab push to active session array tabs.forEach(function(tab){ activeSession.push(tab.url); }); }); //Second query return active tab - neccessary to call content.js chrome.tabs.query({active: true, currentWindow: true}, function(active) { chrome.tabs.sendMessage(active[0].id, {session: activeSession}, function(response) { console.log("Saved"); }); }); }); content.js //content.js var date_time = new Date().toLocaleString() var fileName = "captured_tabs-" + date_time; chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { var tabs = ""; console.log(request.session.length) for(var i = 0; i < request.session.length; i++){ tabs += "start chrome.exe " + request.session[i] + "\n"; } var blob = new Blob([tabs], {type: "text/plain;charset=utf-8"}); saveAs(blob, fileName+".bat"); });