Last active
June 25, 2020 06:55
-
-
Save gistlyn/4e06df1f1b9099526a7c97721aa7f69c to your computer and use it in GitHub Desktop.
Explore and generate different Spirals with SVG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>{{ title }}</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<style> | |
body { | |
background-color:white; | |
color:#000000; | |
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; | |
margin: 0; | |
} | |
.container { | |
width: 100%; | |
padding-right: 15px; | |
padding-left: 15px; | |
margin-right: auto; | |
margin-left: auto; | |
max-width: 1000px; | |
} | |
a { | |
color: #428bca; | |
text-decoration: none; | |
} | |
a:hover, a:focus { | |
color: #2a6496; | |
opacity: 0.8; | |
} | |
body, textarea, input, table, td { | |
font-size: 18px; | |
} | |
#body { | |
padding: 1rem; | |
} | |
</style> | |
</head> | |
<body> | |
<i hidden>{{ '/js/hot-fileloader.js' |> ifDebugIncludeScript }}</i> | |
{{ 'menu' |> partial({ | |
'/': 'Home', | |
'/multi': 'Multi', | |
'/animated': 'Animated', | |
'/metadata': '/metadata', | |
}) | |
}} | |
<div id="body" class="container"> | |
<h2>Having fun with spirals...</h2> | |
{{ page }} | |
</div> | |
{{ scripts |> raw }} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ var from = (qs.from ?? 1).toInt() }} | |
<div style="text-align:right;margin:-54px 0 30px 0"> | |
{{#if from > 1}} <a href="?from={{ max(from-1,0) }}" title="{{max(from-1,0)}}">previous</a> |{{/if}} | |
{{from}} | <a href="?from={{ from+1 }}" title="{{max(from-1,0)}}">next</a> | |
</div> | |
{{#each i in range(from, 4) }} | |
<svg height="640" width="240"> | |
{{#each range(180) }} | |
{{ var x = 120 + 100 * cos((5) * it * 0.02827) }} | |
{{ var y = 320 + 300 * sin((1+i) * it * 0.02827) }} | |
<circle cx="{{x}}" cy="{{y}}" r="{{it*0.1}}" fill="rgb(0,{{it*1.4}},0)" stroke="black" stroke-width="1"> | |
<animate attributeName="fill" values="green;yellow;red;green" dur="{{it%10}}s" repeatCount="indefinite" /> | |
<animate attributeName="opacity" values="1;.5;1" dur="5s" repeatCount="indefinite" /> | |
<animate attributeName="cx" values="{{x}};{{x*1.02}};{{x*0.98}};{{x}}" dur="3s" repeatCount="indefinite" /> | |
<animate attributeName="cy" values="{{y}};{{y*1.02}};{{y*0.98}};{{y}}" dur="3s" repeatCount="indefinite" /> | |
</circle> | |
{{/each}} | |
</svg> | |
{{/each}} | |
<div> | |
Jump to favorites: | |
{{#each [1,221,441,445,665,885,889,1109,1329,1333,1553,1665,1777,1997,2001,2217,2221,2441] }} | |
{{#if index > 0}} | {{/if}} {{#if from == it }} {{it}} {{else}} <a href="?from={{it}}">{{it}}</a> {{/if}} | |
{{/each}} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debug true | |
name Spirals | |
CefConfig { width:1150, height:1050 } | |
appName spirals | |
description Explore and generate different Spirals with SVG | |
tags svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ var from = (qs.from ?? 1).toInt() }} | |
<div style="text-align:right;margin:-54px 0 30px 0"> | |
{{#if from > 1}} <a href="?from={{ max(from-1,0) }}" title="{{max(from-1,0)}}">previous</a> |{{/if}} | |
{{from}} | <a href="?from={{ from+1 }}" title="{{max(from-1,0)}}">next</a> | |
</div> | |
<svg height="640" width="240"> | |
{{#each range(180) }} | |
{{ var x = 120 + 100 * cos((5) * it * 0.02827) }} | |
{{ var y = 320 + 300 * sin((from) * it * 0.02827) }} | |
<circle cx="{{x}}" cy="{{y}}" r="10" fill="rgb(0,100,0)" stroke="black" stroke-width="1"></circle> | |
{{/each}} | |
</svg> | |
<svg height="640" width="240"> | |
{{#each range(180) }} | |
{{ var x = 120 + 100 * cos((5) * it * 0.02827) }} | |
{{ var y = 320 + 300 * sin((from) * it * 0.02827) }} | |
<circle cx="{{x}}" cy="{{y}}" r="10" fill="rgb(0,{{it*1.4}},0)" stroke="black" stroke-width="1"></circle> | |
{{/each}} | |
</svg> | |
<svg height="640" width="240"> | |
{{#each range(180) }} | |
{{ var x = 120 + 100 * cos((5) * it * 0.02827) }} | |
{{ var y = 320 + 300 * sin((from) * it * 0.02827) }} | |
<circle cx="{{x}}" cy="{{y}}" r="{{it*0.1}}" fill="rgb(0,{{it*1.4}},0)" stroke="black" stroke-width="1"></circle> | |
{{/each}} | |
</svg> | |
<div> | |
Jump to favorites: | |
{{#each [1,5,101,221,222,224,298,441,443,558,663,665,666,783,888] }} | |
{{#if index > 0}} | {{/if}} {{#if from == it }} {{it}} {{else}} <a href="?from={{it}}">{{it}}</a> {{/if}} | |
{{/each}} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ var from = (qs.from ?? 1).toInt() }} | |
<div style="text-align:right;margin:-54px 0 30px 0"> | |
{{#if from > 1}} <a href="?from={{ max(from-4,0) }}" title="{{max(from-1,0)}}">previous</a> |{{/if}} | |
{{from}} | <a href="?from={{ from+4 }}" title="{{max(from-1,0)}}">next</a> | |
</div> | |
{{#each i in range(from, 4) }} | |
<svg height="640" width="240"> | |
{{#each range(180) }} | |
{{ var x = 120 + 100 * cos((5) * it * 0.02827) }} | |
{{ var y = 320 + 300 * sin((1+i) * it * 0.02827) }} | |
<circle cx="{{x}}" cy="{{y}}" r="{{it*0.1}}" fill="rgb(0,{{it*1.4}},0)" stroke="black" stroke-width="1"></circle> | |
{{/each}} | |
</svg> | |
{{/each}} | |
<div> | |
Jump to favorites: | |
{{#each [1,221,441,445,665,885,889,1109,1329,1333,1553,1665,1777,1997,2001,2217,2221,2441] }} | |
{{#if index > 0}} | {{/if}} {{#if from == it }} {{it}} {{else}} <a href="?from={{it}}">{{it}}</a> {{/if}} | |
{{/each}} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment