I'm working on a personal project and I'm trying to figure out how to randomly 'color' various parts of an image. The result I'm looking for is like the following image generator when you click "Generate":
Random Color Image Generator
I'm not even sure where to begin. Is it possible to assign different Element IDs to a single image?
Thank you!
Laura
This is not a pure HTML project from what I understand of your requirements. HTML is not a programming language, it is a markup language for displaying things. Where anything apart from display is involved, a scripting or programming language is needed.
In your project, HTML would be used for the front-end, for example to gather information for example about which color goes where, and to show a 'generate' button that the viewer can click.
You will then need (to build) an actual program in the back-end (on a server etc) that will generate the image based on the parameters collected from the viewer.
The HTML front-end can then fetch the generated image and display it to the viewer.
The back-end can be built in a number of ways in a number of programming languages. PHP is a typical language for something like this. It can also be done in javascript (node.js), python, etc.
A good starting point is looking at open-source projects on github. A quick search showed me a few projects which might be in line with yours.
https://github.com/kotekipiesek/3D-Pony-Creator
https://github.com/lat9nq/make-pony
https://github.com/Tailszefox/Pony-Fusion
Even with the programming language, you would typically not interact deeply with the JPG or PNG file formats. Your scripting language would use a library to do this. ImageMagick is one such popular library.
Here is a question that I think you might ask if you pick node.js as your language:
How to replace a color with another using GraphicsMagick Nodejs
Currently, all documentation is based on MS office. This makes it quite challenging if you want to integrate some functionality. Then you have either the option to go with VBA or VSTO. First is not that comfortable, second could be like taking a sledgehammer to crack a nut.
Simple things like simple controls, hiding text or basic maths can be easily realized by HTML.
So I would need an HTML text processor what focus on content (text) and allow me to add interactivity when I need it. That means switching to source code or showing additional panels only on request so that the author can focus on the textual content (A more programming familiar person would do the formatting/interactivity).
In the long term, I want to have the ability to integrate things like SQLite and API calls.
In addition, the output has to be in a single file otherwise it isn't portable in a practical way and users (who only fill in data) won't accept it.
I conduct some research and figured there isn't an all-in-one solution instead there are several options to meet some of my requirements.
I wonder which is best to realize my long-term goals.
HTML5 offline app
It looks like that I either develop an offline HTML5 app what is well explained well, e.g. here:
Offline web applications: a working example
Tutorial: How to make an offline HTML5 web app, FT style
Creating HTML5 Offline Web Applications
How to Build an Offline Single-page Website
plus some background information on Single page apps in depth
markdown
The content could be generated in a markdown editor as recommended in What's a good, auto-saving, WYSIWYG HTML word processor? or just simple convert office documents to html5.
HTML editor / site designer
Alternatively, I could use an HTML editor or and visual site designer
but the selection isn't exactly a small one for me to choose from.
I found some help in:
Battle of the Text Editors: Atom, Sublime & Brackets
26 Tools and Frameworks for HTML-based Desktop and Web App Interfaces
Free HTML Editors: The 16 Best for Web Developers on Windows
14 Best Free HTML Editors
or even simpler for the standard office user: GrapesJS - Next generation tool for building templates without coding
single file website (app)
In my understanding there is still the problem that the output won't be a single file, will it?
I could make use of the archive formats but there aren't supported by all applications as well explained on What's the best “file format” for saving complete web pages (images, etc.) in a single archive?.
That could work if I do only simple things and integrated media object as Base64 encoded objects but it comes with the disadvantage of large overhead.
Desktop web apps
If I want to realize more complex things I would need to develop desktop apps using HTML/CSS/JavaScript but once again the selection is little as you can see in How to develop Desktop Apps using HTML/CSS/JavaScript? [closed].
I haven't found anything yet telling me if I can deploy a desktop web app as a single file.
A4 layout
The layout would be realized on the information given in How to make an HTML Page in A4 paper size page(s)?
office to HTML / html word processor
XSweet - The open .docx to HTML conversion tool
Wax / Wax II (web-based word processor)
HTML to office
For the transition phase, it would be nice to be able to transfer HTML to e.g. docx. Some options are mentioned in the references below:
How to convert HTML file to word?
Convert html to docx using pandoc
html-docx-js
Convert Html to Docx in c#
So how shall I proceed?
First, a short disclaimer. I have next to no knowledge about web applications. I come from an iOS background where I exclusively wrote native code, so if you write your answers like I know nothing outside the shallow parts, that would be great.
I'm interested in learning a stack to develop web applications, but I'm not sure what the right way to build the GUI is. I know that a web front end consists of html and CSS to create the display and javascript as the bridge between the back end and the GUI, but I don't know the best way to put something together.
I know in iOS, you can use the Interface Builder (part of xcode that lets you graphically create the xml that describes the display) to create GUI's without any knowledge of how iOS translates the xml to some rendering, or even what is written in your xml files. Is there any analog to the web front end?
I'm mainly just looking for a list of the accepted ways to develop the GUI for a web application. If I have to learn HTML and CSS, so be it, but I'd like to know what my options are and the tradeoffs between each of them.
I can answer shortly stating that (technically) you can design web pages without coding in HTML or CSS, or even Javascript - although, you would be somewhat limited in your creative abilities and applications.
You can read about WYSIWYG html editors on this link, or try out ckeditor (someone said it's good)...
...I think a bit of background will help you reach a correct decision...
so here goes:
The Long Answer
I would start by trying to put the world of web programming and design into concepts that correlate with iOS coding.
If we look at the whole of a web app from an MVC perspective, then the browser is the view, the server is the controller and the database is the model... although this is very simplified.
Just like in iOS, each of these can be (but doesn't have to be) broken down into sub-MVC systems.
Just like any model in MVC, the view (the browser) can talk to the model (the database), but really it shouldn't. that's just bad practice.
If we break down the main-view (the browser) to a sub-MVC system, I would consider the HTML as the model, the CSS as the view and the browser (through links and javascript) as the controller.
It's not all that clear cut, but thinking like this helps me practice better and cleaner coding.
The HTML is the view's model for the web-app - it contains the data to be displayed or used.
HTML is a variation on the XML format and it contains data organized in a similar way to an XML file.
The basic HTML file will contain:
<html>
<head>
</head>
<body>
</body>
</html>
this should look familiar to you if you read any XML.
The CSS (cascading style sheets) is the view - it states HOW the html DATA should be displayed.
if your web app does't have any CSS, it will use the browser's default CSS/styling to be applied on the data in the HTML.
This "language" makes me think more about dictionaries in iOS (I think that's what they're called in Objective C). They have properties and values (like key-value pairs) that determine how the HTML data is displayed (if it's displayed).
They could look something like this:
body
{
color: white;
background-color: black
}
The browser is the web-app's view's controller - it makes it all work together and serves it up to the screen.
Javascript and links help us tell the controller what we want it to do, but it is the browser that acts (and willfully at times).
You can have a whole web app that acts without javascript, using only the default actions offered by links - in which case the browser will usually ask the server (the main controller) what to do.
Javascript helps us move some of the legwork from the server to the client, by allowing us to have a "smarter" controller for our view - just like in iOS.
The issue of the errant main-view / browser
Not all views are created equal, and not all browsers are the same.
Because the browser is used as the controller for the web-app's view, and because some browsers act differently then others, we web coders have the problem of working around someone else's idea of how our view's controller should behave.
You might see us complaining about it quite a lot (especially complaining about Internet Explorer).
These days, this issue is not as big of a problem as it used to be... it's just that some people don't update their computers...
WYSIWYG web editors
There are website builders and editors that try to work like X-Code does, by allowing us to build the website much like we would write word documents.
But, unlike X-Code which codes only the graphical interface of the view, these website builders write the model as well and usually add javascript into the mix.
When we use these tools (which I avoid), the whole MVC model breaks apart.
We can use them as a starting point for dirty work, but then we take their code apart and adjust it to our needs - usually by taking the code we need for the view (CSS) and applying it where we need it (and discarding much of the nonsense they add to the code and the HTML).
To summarize
As you can tell, HTML and CSS (and Javascript) are only a small part of a web app - as they all relate to the main view of the web app.
To write the controller and models for web apps, we use other tools (such as Ruby, PHP, js.node, MySQL and the like).
Coding the HTML and CSS isn't as hard as you might think, although it might be harder then I present it to be.
You can avoid writing code for web apps and use applications that offer WYSIWYG (What You See Is What You Get), but that would limit your abilities and will take away from your control over what you want to create.
This is more a theoretical question than a coding question. I am trying to create a epub, with some interactive components. Now to separate the code, I put each interactive component in a separate html file. Typical interactive components will be a questionnaire.
What will be the best way to link this to my epub, two options I am considering are:
Iframe - the interactive component will display as a part of the book, and users will seamlessly complete the activity.
External link - an Icon will be displayed in the book, which will serve as a link to a new page, this page will contain the interactive component.
I would like to keep the epub according to epub 3.0 standard.
Any suggestions or alternative solutions I can research?
Either approach is compatible with the standard since external links are allowed and scripting within an iFrame is also allowed (known as scripting in a container).
The broader question is what are you trying to achieve? If the user is sent to an external page in a browser then the browser will have to post the results back to some server since the browser can't write the results back to disk or the EPUB.
It also depends on whether the EPUB Reading System is browser-based itself or an app. It is an app then in theory the app might know how to log info locally (though that would require jumping through some hoops that could have security implications.
So what is the goal here?
It seems the most common aproach to web design is to use HTML/XHTML & CSS in conjunction with other technologies or languages like Javascript or PHP.
On a theoretical level, I'm interested to know what other languages or technologies could be used to build an entire site without using a single HTML tag or CSS style for styling/positioning?
Could a website be made only using XML or PHP alone, including actual styling and positioning?
Presumably Flash sites are till embedded in HTML tags?
Thanks
There are actually several solutions that allow you to nearly completely avoid CSS and HTML.
GWT: Google Web Toolkit
Written in Java and will allow you to build both server and client code in Java. Used to build Google Wave.
Cappuccino and Objective-J:
Objective-J is to JavaScript as Objective-C is to C. It extends JavaScript with many near features, including type-checking, classes and types.
Cappuccino is like Cacoa (Mac OS X GUI toolkit).
Using these two you can build incredibly rich and desktop like webapps. They run mostly on the client side and you can use whatever you want on the server.
A good example is 280slides
SproutCore is similar to Cappuccino, but it uses pure JavaScript instead. Apple is using SproutCore to make me.com.
I should also mention that knowledge to HTML, CSS, JavaScript is a good skill to know, just like understanding your compiler is a good skill.
EDIT:
As said above Adobe Flash can also be used.
You can make a website with out a single html tag. Just give folder read access to all your directories, have sensible file names. From here you user will be able to browse images , read text files, download videos and depending on the content he may or may not come back ever again, but you do achieve the goal of setting up a "website" with out a single line of html or css or any other code for that matter.
:-) :-) :-)
You can host a telnet server with anonymous access and a specialized shell that restricts the user to doing whatever it is you want the site to do. ;)
Lets make the distinction between what is required by the web browser, and what you as a developer use to create that markup.
Remember that HTML nowadays is xml. You could use any markup language you like and convert that to HTML using XML.
eg ASP.NET uses markup such as which is converted on the server to .
As long as the content going down the wire to the browser is HTML, or generates HTML through script, you can use any approach you like.
However these approaches have mostly failed as developers prefer having direct control over the markup. It makes css as well as scripting much easier when you are certain what the html is going to be.
ASP.NET MVC is a product created in response to criticisms leveled at the ASP.NET webforms model.
Also, this is another answer because it's a completely different technology, but you can write an application in XUL and it'll run in Mozilla-based browsers without any HTML.
There's also XML. You can create websites with XML only. A well known one is World Of Warcraft. Check the page source. An XSL is used as stylesheet. There exist even XML based web frameworks like OpenLaszlo. You can let it serve either DHTML or Flash on reqeust out of a single XML template.
The Wt C++ Web Toolkit.
You can write your web application in C++ using Qt-style widgets (input boxes, buttons, tabs etc) and hook up client-side events to C++ code on your server. All without writing any HTML or CSS.
A sample application from their website (you may also want to look at this excellent tutorial):
HelloApplication::HelloApplication(const WEnvironment& env)
: WApplication(env)
{
setTitle("Hello world"); // application title
root()->addWidget(new WText("Your name, please ? ")); // show some text
nameEdit_ = new WLineEdit(root()); // allow text input
nameEdit_->setFocus(); // give focus
WPushButton *b = new WPushButton("Greet me.", root()); // create a button
b->setMargin(5, Left); // add 5 pixels margin
root()->addWidget(new WBreak()); // insert a line break
greeting_ = new WText(root()); // empty text
/* when the button is clicked, call the 'greet' method */
b->clicked().connect(this, &HelloApplication::greet);
}
void HelloApplication::greet()
{
/* set the empty text object greeting_ to greet the name entered */
greeting_->setText("Hello there, " + nameEdit_->text());
}
Curl (requires a browser plugin)
Wikipedia article
A webpage looks like this:
{curl 1.7 applet}
{value
let b:int=99
let song:VBox={VBox}
{while b > 0 do
{song.add b & " bottle(s) of beer on the wall,"}
{song.add b & " bottle(s) of beer."}
{song.add "Take one down, pass it around,"}
set b = b - 1
{song.add b & " bottle(s) of beer on the wall."}
}
song
}
Source
Since browsers view HTML, I'm assuming you mean create a site without ever having to edit/write HTML/CSS. The framework/app environment/whatever taking care of everything for you - yet still allowing you control over the presentation layer.
Seems like that is certainly possible on a theoretical level.
I ran across Noloh (not one line of html) a while back. Was intrigued, but never actually tried it out.
From various places on the Noloh site:
Because NOLOH does not rely on HTML or pages, maintaining complex rich Internet applications is significantly easier than with other methods.
Developing applications with NOLOH only requires using a single, unified language: a superset of PHP that completely maintains all aspects of server-client communication for you!
I think you could build a site entirely in SVG.
The front page of emacsformacosx is almost entirely SVG, for example.
Downsides: It wouldn't be viewable in IE (at least through version 8). And last I looked, text support, like flowing and justification, was weaker in SVG. (You could embed HTML inside an SVG element when you needed sophisticated text features, but that would violate your no-HTML rule.)
You'd probably still want to use CSS with SVG, because it's a good idea there for the same reason it's a good idea with HTML, but it wouldn't be necessary.
A website is always viewed through a browser (at least always if you are human :)). Browsers understand HTML. Whatever the technology - you have to basically render HTML. Even in cases with rich technologies like flash, the flash object that is rendered by a browser plugin is embedded inside the HTML.
In theory it is possible to do it without HTML, but the question becomes how much does the product diverge from the definition of a website...
One really short, simple answer... you can't :D
Flash requires an embed tag, an image requires an embed tag etc, so you'd have to use HTML in some method or another.
PHP is an embedded language, it is used to generate HTML on which the browsers renders, with XML, well technically a browser like Ie or FireFox will render it in it's own way for readability, but I would not class that as a website.
The major developments in the world of web technologies involves the development of HTML and CSS to improve them, there isn't any need for an alternative. In fact we're pushing towards a standard, what point would there be in introducing a new language to negate these standards. The whole IE saga would simply get worse.
Like the others have suggested, you could directly load an image or a flash file, but an image is useless on it's own, and a flash interface throws up loads of problems like SEO, accessibility etc, not least it's very heavy and usually completely misused. In my mind I wouldn't even class this method as a website, it just doesn't tick any of the boxes (IMO).
I think you can have an URL pointing directly at a hosted Flash (SWF) file, I've certainly done this though I don't know if all browsers work.
Anyhow, I tested this when developing MyDinos.
e.g: http://mydinos.com/home.swf
You can use Emscripten and its SDL subset.
You could try using quickstatic. You can code HTML templates from Python3. What is super cool about it is the fact that if you put in a for-loop for a certain item, you can generate that many items (maybe even use it to print items from a directory or quickly serve thousands of links).