mirror of https://github.com/sveltejs/svelte
parent
18751cc381
commit
07505fe0c6
@ -1,6 +1,3 @@
|
||||
import { wrapper_bench } from "./wrapper/wrapper_bench.js";
|
||||
import { wrapper_bench } from './wrapper/wrapper_bench.js';
|
||||
|
||||
|
||||
export const ssr_benchmarks = [
|
||||
wrapper_bench
|
||||
]
|
||||
export const ssr_benchmarks = [wrapper_bench];
|
||||
|
||||
@ -1,34 +1,31 @@
|
||||
<script>
|
||||
const wrapperWidth = 960
|
||||
const wrapperHeight = 720
|
||||
const cellSize = 10
|
||||
const centerX = wrapperWidth / 2
|
||||
const centerY = wrapperHeight / 2
|
||||
const wrapperWidth = 960;
|
||||
const wrapperHeight = 720;
|
||||
const cellSize = 10;
|
||||
const centerX = wrapperWidth / 2;
|
||||
const centerY = wrapperHeight / 2;
|
||||
|
||||
let angle = 0
|
||||
let radius = 0
|
||||
let angle = 0;
|
||||
let radius = 0;
|
||||
|
||||
let tiles = []
|
||||
const step = cellSize
|
||||
let tiles = [];
|
||||
const step = cellSize;
|
||||
|
||||
while (radius < Math.min(wrapperWidth, wrapperHeight) / 2) {
|
||||
let x = centerX + Math.cos(angle) * radius
|
||||
let y = centerY + Math.sin(angle) * radius
|
||||
let x = centerX + Math.cos(angle) * radius;
|
||||
let y = centerY + Math.sin(angle) * radius;
|
||||
|
||||
if (x >= 0 && x <= wrapperWidth - cellSize && y >= 0 && y <= wrapperHeight - cellSize) {
|
||||
tiles.push({ x, y })
|
||||
tiles.push({ x, y });
|
||||
}
|
||||
|
||||
angle += 0.2
|
||||
radius += step * 0.015
|
||||
angle += 0.2;
|
||||
radius += step * 0.015;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="wrapper">
|
||||
{#each tiles as { x, y }}
|
||||
<div
|
||||
class="tile"
|
||||
style="left: {x.toFixed(2)}px; top: {y.toFixed(2)}px;">
|
||||
</div>
|
||||
<div class="tile" style="left: {x.toFixed(2)}px; top: {y.toFixed(2)}px;"></div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in new issue