Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow shapes - fixes #40 #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,25 @@
.newMockElement.note .editableArea, .mockElement.note .editableArea{
padding:0.5em;
}

.newMockElement.boxarrow {
display: inline-block;
}
.newMockElement.boxarrow, .mockElement.boxarrow {
width: 50px;
height: 50px;
background-color: transparent;
}
.newMockElement.boxarrow > svg, .mockElement.boxarrow > svg {
width: 100%;
height: 100%;
}
.newMockElement.boxarrow > .editableArea, .mockElement.boxarrow > .editableArea {
display: none;
}
svg.hideme {
height: 0;
}
</style>
</head>

Expand Down Expand Up @@ -918,6 +937,37 @@ <h1 class="editableArea">Headline1</h1>
</div>
</div>
</li>

<li title="arrow">
<div class="newMockElement boxarrow">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to have one element (div) in one li? – that would be consistent with the rest of the MockElements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but because they're narrow and there's 4 of them, it just looked a lot lot better to have 2 side by side.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0,0 Q25,75 100 100" marker-start="url(#arrowstart)" stroke="black" fill="none" stroke-width="2"/>
</svg>
</div>
<div class="newMockElement boxarrow">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0,0 Q75,25 100 100" marker-end="url(#arrowend)" stroke="black" fill="none" stroke-width="2"/>
</svg>
</div>
</li>
<li title="arrow">
<div class="newMockElement boxarrow">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M100,0 Q25,25 0 100" marker-start="url(#arrowstart)" stroke="black" fill="none" stroke-width="2"/>
</svg>
</div>
<div class="newMockElement boxarrow">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M100,0 Q75,75 0 100" marker-end="url(#arrowend)" stroke="black" fill="none" stroke-width="2"/>
</svg>
</div>
</li>
<svg class="hideme" xmlns="http://www.w3.org/2000/svg">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would the change work without this hidden element? It is probably hard to reason about this, since it is hard to know where it belongs to and what it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arrow SVGs reference the 2 marker tags inside the hideme SVG by the IDs arrowstart and arrowend - see Applying SVG effects to HTML content. The extra hideme SVG exists because if it were to be embedded within newMockElement then the IDs would be duplicated every time a new arrow was dropped on the page.

I apply the hideme class because SVGs often come with a pre-set height.

I hope this helps explain my reasoning! ???

<defs>
<marker id="arrowstart" viewBox="0 -5 10 10" refX="0" refY="0" markerWidth="8" markerHeight="8" orient="auto"><path d="M10,-5L0,0L10,5"/></marker>
<marker id="arrowend" viewBox="0 -5 10 10" refX="10" refY="0" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,-5L10,0L0,5"/></marker>
</defs>
</svg>
</ul>
</div>

Expand Down