Giter VIP home page Giter VIP logo

webcad's Introduction

WebCAD

Visit https://code.google.com/p/web-cad/ for more info.

WebCAD

<div class="cad">

	<div class="control">

		<div>
			<h4>Elements</h4>
			<!-- <button onclick="ctx.setMode('view');">View</button>
			<button onclick="ctx.setMode('select');">Select</button> -->
			<button onclick="ctx.drawUsing(hc.graphic.Line.creator)" title="Draw a path, press mouse to add a point to the path. Press C to end path, alt+C to close path.">Line</button>
			<button onclick="ctx.drawUsing(hc.graphic.Circle.creator)" title="Drag to create circle">Circle</button>
			<button onclick="ctx.drawUsing(hc.graphic.Rectangle.creator)" title="Drag to create rectangle">Rectangle</button>
			<button onclick="ctx.drawUsing(hc.graphic.QuadraticCurve.creator)" title="Drag to create a line, then drag to control the curve">QuadraCurve</button>
		</div>

		<div>
			<h4>Style</h4>
			<span>Fill:</span>
			<button onclick="clearFill()">
			Clear
			</button>
			<label>Color:<input id="fillColor">
			</label><br> <span>Out line:</span>
			<button onclick="clearStroke();">
			Clear
			</button>
			<label>Color:<input id="strokeColor">
			</label>
		</div><div>
			<h4>Line Style</h4>
			Line width:<input
				onchange="ctx.drawable.style.lineWidth=this.value;" value="9"
				size="3" /> <label>Line Cap: <select
				onchange="ctx.drawable.style.lineCap=this.value;">
					<option value="butt">butt</option>
					<option value="round">round</option>
					<option value="square">square</option>
			</select> </label> <label>Line join: <select
				onchange="ctx.drawable.style.lineJoin=this.value;">
					<option value="miter">miter</option>
					<option value="round">round</option>
					<option value="bevel">bevel</option>
			</select> </label> <label>miterLimit: <input
				onchange="ctx.drawable.style.miterLimit=this.value;" value="10"
				size="3"> </label>
		</div>



		<div>
			<h4>Compositing</h4>

			<span>Alpha transparent:</span> <input type="range" min='0' max='1'
				value="1" step='0.1'
				onchange="this.title=this.value;ctx.context2d.globalAlpha=this.value;"
				id="globalAlpha" /> <br /> <label> Composite operation: <select>
					<option>source-atop</option>
					<option>source-in</option>
					<option>source-out</option>
					<option>source-over</option>
					<option>destination-atop</option>
					<option>destination-in</option>
					<option>destination-out</option>
					<option>destination-over</option>
					<option>lighter</option>
					<option>copy</option>
					<option>xor</option>
					<option>vendorName-operationName</option>
			</select> </label>
		</div>

		<div>
			<h4>Outline</h4>
			<canvas id='outline' title="Outline of the canvas."
				style="border: 1px #CF0 solid; width: 300px; height: 300px;"></canvas>
		</div>

	</div>

	<div><div id="crd"></div> <button onclick='ctx.restore()'>Restore</button> <input type=range id=scale /></div>
	<div id="canvas">
		<canvas></canvas>
		<canvas></canvas>
	</div>
</div>
<p>
	Scroll the wheel to scale the whole graph. Hold ctrl key and drag to move the whole graph.
</p>

webcad's People

Contributors

zengfenfei avatar

Watchers

Robert Liu avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.