css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <script src="https://gojs.net/latest/release/go.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div class="navbar navbar-inverse navbar-fixed-top" style="height:50px;background-color:black;">
    <div class="container-fluid body-content" style="padding:0px">
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav" style="font-size:8pt;color:white;margin-top:15px;margin-right:2px">
                <li id="returnview" style="margin-top:1px;margin-right:2px;font-size:10pt"><span class="glyphicon glyphicon-circle-arrow-left">返回</span></li>
                <li id="SaveButton" style="margin-top:1px;margin-right:2px;font-size:10pt" ><span class="glyphicon glyphicon-floppy-disk">儲存</span></li>
                <li id="AAAA" ><img width="20" height="20" style="margin-right:2px" src="pic" />AAAA</li>
                <li id="BBBB" ><img width="20" height="20" style="margin-right:2px" src="pic" />BBBB</li>
                <li id="CCCC"><img id="image" width="20" height="20" style="margin-right:2px" src="pic" />CCCCCC</li>
                <li id="ddddd"><img width="20" height="20" style="margin-right:2px" src="pic" />DDDDD</li>
                <input type="text" id="fontstyle" style="display:none" />
                <input list="size" name="fontsize" id="zzzzz" style="width:40px;height:25px;margin-top:0px;ime-mode:disabled;font-size:10px" disabled="disabled">
                <datalist id="size">
                    <option value="8">
                    <option value="9">
                    <option value="10">
                    <option value="11">
                    <option value="12">
                    <option value="14">
                    <option value="16">
                    <option value="18">
                    <option value="20">
                    <option value="22">
                    <option value="24">
                    <option value="36">
                    <option value="48">
                    <option value="72">
                </datalist>
                <div class="btn-group">
                    <button class="btn btn-xs btn-default disabled" id="bold"><img src="~/Content/bold.png" width="11" height="12" style="margin-bottom:1px"></button>
                    <button class="btn btn-xs btn-default disabled" id="italic"><img src="~/Content/Italic.png" width="11" height="12" style="margin-bottom:1px"></button>
                    <button class="btn btn-xs btn-default disabled" id="underline"><img src="~/Content/underline.png" width="11" height="12" style="margin-bottom:1px"></button>
                    <button class="btn btn-xs btn-default disabled" id="strikethrough"><img src="~/Content/strikethrough.png" width="11" height="12" style="margin-bottom:1px"></button>
                </div>
            </ul>
            <ul class="nav navbar-nav">
                <li><a style="font-size:12px;padding-top:5px">備註<br>顏色</a></li>
                <div class="btn-group-vertical">
                    <div class="btn-group">
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="red" style="margin-top:2px;background-color:red;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="black" style="margin-top:2px;background-color:black;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="orange" style="margin-top:2px;background-color:orange;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="yellow" style="margin-top:2px;background-color:yellow;border-color:white"></button>
                    </div>
                    <div class="btn-group">
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="green" style="margin-top:2px;background-color:green;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="blue" style="margin-top:2px;background-color:blue;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="purple" style="margin-top:2px;background-color:purple;border-color:white"></button>
                        <button class="btn btn-md disabled" onclick="changetextColor(this)" value="darkgray" style="margin-top:2px;background-color:darkgray;border-color:white"></button>
                    </div>
                </div>
            </ul>
            <ul class="nav navbar-nav">
                <li><a id="functionguide" style="font-size:10pt" data-toggle="modal" data-target=".bs-example-modal-sm"><span class="glyphicon glyphicon-question-sign"> 說明</span></a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container-fluid body-content">
<body class="body">
    <div id ="divForZoomBtn" style="position:relative">
        <!-- this Div is for the zoom in and out btn to stay on canvas-->
        <div id="mainDiagramDiv" class="mainDiagram"></div>
        <div style="position:absolute;right:20px;bottom:10px;z-index:1000; width: 50px">
            <button class="btn btn-sm btn-primary" id="increaseZoom" style="float:right"><span class="glyphicon glyphicon-plus"></span></button>
            <button id="zoomToFit" class="btn btn-sm" style="float:right"><span class="glyphicon glyphicon-fullscreen"></span></button>
            <button class="btn btn-sm btn-primary" id="decreaseZoom" style="float:right"><span class="glyphicon glyphicon-minus"></span></button>
        </div>
    </div>
</body>
            
          
!
            
              .mainDiagram {
        border: solid 1px black;
        height: 620px;
    }

    html, h1, h2, h3, h4, h5, h6 {
        font-family: "Comic Sans MS", cursive, sans-serif;
    }

    h5 {
        font-size: 17px;
    }

    h4 {
        font-size: 25px;
    }

    .label {
        margin-right: 10px;
        font-size: 15px;
    }

    .disabledbutton {
        pointer-events: none;
        opacity: 0.4;
    }

    .display {
        display: none;
    }

body {
    padding-top: 0px;
    padding-bottom: 0px;
}
.body {
    padding-top: 50px;
    padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 1000px;
}

/* styles for validation helpers */
.field-validation-error {
    color: #b94a48;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #b94a48;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #b94a48;
}

.validation-summary-valid {
    display: none;
}

.container-fluid {
  padding-right: 0px;
  padding-left: 0px;
  margin-right: 0px;
  margin-left: 0px;
}
            
          
!
            
                function init() {
    var $ = go.GraphObject.make;  // for conciseness in defining templates

    myDiagram = $(go.Diagram, "mainDiagramDiv",  // create a Diagram for the DIV HTML element
                  {
                    "undoManager.isEnabled": true  // enable undo & redo
                  });

    // define a simple Node template
    myDiagram.nodeTemplate =
      $(go.Node, "Auto", 
        $(go.Shape, "RoundedRectangle", { strokeWidth: 0},
          new go.Binding("fill", "color")),
        $(go.TextBlock,
          { margin: 8 }, 
          new go.Binding("text", "key"))
      );


    myDiagram.model = new go.GraphLinksModel(
    [
      { key: "Alpha", color: "lightblue" },
      { key: "Beta", color: "orange" },
      { key: "Gamma", color: "lightgreen" },
      { key: "Delta", color: "pink" }
    ],
    [
      { from: "Alpha", to: "Beta" },
      { from: "Alpha", to: "Gamma" },
      { from: "Beta", to: "Beta" },
      { from: "Gamma", to: "Delta" },
      { from: "Delta", to: "Alpha" }
    ]);
  }

init();

 function makeCanvasSizeFitDivSize() {
     var div = myDiagram.div;

     div.style.width = "1278px";
     div.style.height = "618px";
     myDiagram.requestUpdate();
 }
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console