mirror of https://github.com/sveltejs/svelte
commit
b3a913a19a
@ -0,0 +1,9 @@
|
||||
/*
|
||||
!/Dockerfile
|
||||
!/package.json
|
||||
!/package-lock.json
|
||||
!/__sapper__
|
||||
/__sapper__/*
|
||||
!/__sapper__/build
|
||||
!/static
|
||||
!/content
|
@ -0,0 +1 @@
|
||||
#!include:.dockerignore
|
@ -1,21 +1,19 @@
|
||||
FROM mhart/alpine-node:10.15
|
||||
FROM mhart/alpine-node:11.14
|
||||
|
||||
# install dependencies
|
||||
WORKDIR /app
|
||||
COPY static /app/static
|
||||
COPY content /app/content
|
||||
COPY __sapper__ /app/__sapper__
|
||||
COPY package.json package-lock.json /app/
|
||||
RUN npm install --production
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --production
|
||||
|
||||
###
|
||||
# Only copy over the Node pieces we need
|
||||
# ~> Saves 35MB
|
||||
###
|
||||
FROM mhart/alpine-node:base-10.15
|
||||
FROM mhart/alpine-node:base-11.14
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=0 /app .
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["node", "__sapper__/build"]
|
||||
|
@ -0,0 +1,64 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
let p = 0;
|
||||
|
||||
const sleep = ms => new Promise(f => setTimeout(f, ms));
|
||||
|
||||
onMount(() => {
|
||||
let running = true;
|
||||
|
||||
function next() {
|
||||
p += 0.1;
|
||||
|
||||
const remaining = 1 - p;
|
||||
if (remaining > 0.15) setTimeout(next, 500 / remaining);
|
||||
}
|
||||
|
||||
setTimeout(next, 250);
|
||||
|
||||
return () => {
|
||||
running = false;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.progress-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
background-color: var(--prime);
|
||||
transition: width 0.4s;
|
||||
}
|
||||
|
||||
.fade {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(255,255,255,0.3);
|
||||
pointer-events: none;
|
||||
z-index: 998;
|
||||
}
|
||||
</style>
|
||||
|
||||
{#if p > 0}
|
||||
<div class="progress-container" transition:fade>
|
||||
<div class="progress" style="width: {p * 100}%"></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if p >= 0.4}
|
||||
<div class="fade" in:fade={{duration:800}}></div>
|
||||
{/if}
|
Loading…
Reference in new issue