Kind of works
This commit is contained in:
parent
0429ea7f72
commit
65c0e3469e
6 changed files with 64 additions and 113 deletions
|
|
@ -3,8 +3,8 @@
|
|||
@include responsive() using ($vars) {
|
||||
div.background-element {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 100px;
|
||||
width: 140px;
|
||||
|
||||
|
|
@ -16,12 +16,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
& {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
transition: transform map_get($vars, $transition-time),
|
||||
opacity map_get($vars, $transition-time),
|
||||
background-color map_get($vars, $transition-time);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ export class PageBackground extends PageElement {
|
|||
private readonly blobs: Array<Blob> = [];
|
||||
private readonly blobSpacing = 350;
|
||||
|
||||
public constructor(private start: PageElement, private end: PageElement) {
|
||||
public constructor(
|
||||
private readonly start: PageElement,
|
||||
private readonly inBetween: Array<PageElement>,
|
||||
private readonly end: PageElement
|
||||
) {
|
||||
super();
|
||||
Blob.initialize(10, 30, 5);
|
||||
}
|
||||
|
|
@ -35,7 +39,7 @@ export class PageBackground extends PageElement {
|
|||
}
|
||||
|
||||
private resize(parent: PageElement, heightChange?: number) {
|
||||
const siblings: Array<HTMLElement> = PageBackground.getSiblings(parent);
|
||||
const siblings: Array<HTMLElement> = this.getSiblings();
|
||||
|
||||
const width = document.body.clientWidth;
|
||||
let height = sum(siblings.map(getHeight));
|
||||
|
|
@ -72,9 +76,7 @@ export class PageBackground extends PageElement {
|
|||
});
|
||||
}
|
||||
|
||||
private static getSiblings(parent: PageElement): Array<HTMLElement> {
|
||||
return Array.prototype.slice
|
||||
.call(parent.element.children)
|
||||
.filter((e: HTMLElement) => !e.classList.contains('background-element'));
|
||||
private getSiblings(): Array<HTMLElement> {
|
||||
return [this.start, ...this.inBetween, this.end].map(e => e.element);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,16 +8,15 @@ import { ContainerPage } from '../framework/container-page';
|
|||
|
||||
export const create = ({ header, timeline, footer }: Portfolio) => {
|
||||
const pageHeader = new PageHeader(header);
|
||||
const pageTimeline = new PageTimeline(timeline);
|
||||
const pageFooter = new PageFooter(footer);
|
||||
|
||||
new ContainerPage(document.body, [
|
||||
new PageImageViewer(),
|
||||
new ContainerPage(document.body.querySelector('.main'), [
|
||||
pageHeader,
|
||||
new PageTimeline(timeline),
|
||||
pageFooter,
|
||||
new PageBackground(pageHeader, pageFooter),
|
||||
]),
|
||||
pageHeader,
|
||||
pageTimeline,
|
||||
pageFooter,
|
||||
new PageBackground(pageHeader, [pageTimeline], pageFooter),
|
||||
]).setAsMain();
|
||||
|
||||
addSupportForTabNavigation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue