removed from landing page theme and added in mdf shortcode

master
David Kebler 2021-01-15 08:31:56 -08:00
commit f6217a6abc
20 changed files with 796 additions and 0 deletions

View File

@ -0,0 +1,13 @@
{{ $path := "/images/" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
{{ if .IsNamedParams }}
<div class="box box--avatar">
{{ with .Get "url" }}<a href="{{.}}">{{ end }}
<img class="avatar" src="{{ $path }}{{ .Get "img" }}"/>
{{ with .Get "url" }}</a>{{ end }}
</div>
{{ else }}
{{ $avatar := ( .Get 0 | default "avatar.jpg" ) }}
<div class="box box--avatar">
<img class="avatar" src="{{ $path }}{{ $avatar }}"/>
</div>
{{ end }}

View File

@ -0,0 +1,6 @@
{{ $numOfParams := ( len .Params ) }}
{{ if eq $numOfParams 1 }} <span name="{{ .Get 0 }}">{{ .Get 0 }}</span> {{ end }}
{{ if eq $numOfParams 2 }} <span name="{{ .Get 0 }}">{{ .Get 1 }}</span> {{ end }}
{{ if eq $numOfParams 3 }}
<span name="{{ .Get 0 }}" {{ if (.Get 2) "hide" }}class="invisible"{{ end }}>{{ .Get 1 }}</span>
{{ end }}

View File

@ -0,0 +1,4 @@
{{ $numOfParams := ( len .Params ) }}
<div class="box {{ range .Params }}box--{{ . }} {{ end }}">
{{ .Inner }}
</div>

View File

@ -0,0 +1,23 @@
{{ with .Site.Params.contact }} {{ $path := "/images/" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<div class="box box__contact">
<img class="avatar" src="{{ $path }}{{ .avatar | default " avatar.jpg "}}"/>
<div class="box box__contact-info">
<h4>{{ .name }}</h4>
<div class="box">
<a class="btn" onClick="javascript:window.open('mailto:{{ .email }}', 'mail');event.preventDefault()" href="{{ .email }}">
<i class="fa fa-envelope-o fa-fw"></i>
</a>
<div id="cell" class="btn clickable">
<i class="fa fa-mobile fa-fw"></i>
</div>
{{ if .cell_image | or .cell }}
{{ if .cell_image }}
<img id="cell-number" class="hide" src="{{ $path }}{{ .cell_image }}"/>
{{ else }}
<div id="cell-number" class="hide">{{ .cell }}</div>
{{ end }}
{{ end }}
</div>
</div>
</div>
{{ end }}

View File

@ -0,0 +1,50 @@
<div class="box box--disqus">
<div id="disqus_thread" class="box__embed box__embed--disqus">
</div>
</div>
<script type="text/javascript">
(function() {
// Don't ever inject Disqus on localhost--it creates unwanted
// discussions from 'localhost:1313' on your Disqus account...
// if (window.location.hostname == "localhost")
// return;
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
var disqus_shortname = '{{ .Get 0 | default .Site.DisqusShortname }}';
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
<!-- from disqus
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://landingpage-guide.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-->
<!-- goes in body before closing tag for count -->
<!-- <script id="dsq-count-scr" src="//landingpage-guide.disqus.com/count.js" async></script> -->

View File

@ -0,0 +1,23 @@
<!-- Used for embedding iframes from sites like youtube and google -->
{{ if .IsNamedParams }}
<div class="box box--embed box--{{ .Get "type" }}">
{{ with .Get "title" }}
<div class="box__title">{{ . }}</div>
{{ end }}
<div
{{ with .Get "type" }} class="embed--{{ . }}"{{end}}
{{ with .Get "id" }} id="{{ . }}"{{end}}
{{ with .Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}
{{ with .Get "wpad"}} wPad="{{ . }}"{{ end }}
>
{{ .Inner }}
</div>
{{ with .Get "caption"}}
<div class="box__caption">{{ . }}</div>
{{ end }}
</div>
{{ else }}
<div class="box box--embed {{ with .Get 0 }}embed--{{ . }}{{ end }}">
{{ .Inner }}
</div>
{{ end }}

View File

@ -0,0 +1,4 @@
<!-- Adds a class to a block of text. Used for custom formatting -->
<span class="{{ range .Params }}{{ . }} {{ end }}">
{{ .Inner }}
</span>

View File

@ -0,0 +1,22 @@
{{ $path := "/images/" }}
{{ $filename := .Get "filename" }}
{{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<div class="box box--column box--image
{{ with .Get "style"}} box--image-{{ . }}{{ end }}
{{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }}
"
{{ with .Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}
{{ with .Get "wpad"}} wPad="{{ . }}"{{ end }}
>
{{ with .Get "title" }}
<div class="box__title">{{ . }}</div>
{{ end }}
{{ with .Get "link"}}
{{ if eq . "lightbox" }}<a href="{{ $path }}{{ $filename }}">{{ else }}<a href="{{.}}" target="_blank" >{{ end }}
{{ end }}
<img src="{{ $path }}{{ .Get "filename" }}" />
{{ if .Get "link"}}</a>{{ end }}
{{ with .Get "caption"}}
<div class="box__caption">{{ . }}</div>
{{ end }}
</div>

View File

@ -0,0 +1,4 @@
<!-- parameters, jotformID,text for button-->
<div class ="box box--btn">
<a class="btn" href="javascript:void( window.open('https://form.jotform.com/{{ .Get 0 }}', 'blank', 'scrollbars=yes, toolbar=no, width=700, height=500') )">{{ .Get 1 }}</a>
</div>

View File

@ -0,0 +1,24 @@
{{ .Scratch.Set "url" (.Get "url") }}
{{ .Scratch.Set "height" (.Get "height") }}
{{ .Scratch.Set "width" (.Get "width" | default "1000") }}
{{ if .Get "height" }}
{{ .Scratch.Set "height" ( printf ", height=%s" ( .Scratch.Get "height" ) ) }}
{{else}}
{{ .Scratch.Set "height" "" }}
{{ end }}
{{ if eq (.Get "display") "window" }}
{{ .Scratch.Set "url" ( printf "javascript:void( window.open('%s', 'blank', 'scrollbars=yes, toolbar=no, width=%s %s' ))" (.Scratch.Get "url") (.Scratch.Get "width") (.Scratch.Get "height") ) }}
{{ end }}
<a
{{ if eq (.Get "display") "tab" }} target="_blank"{{ end }}
{{ if eq (.Get "display") "modal" }} modal{{ end }}
{{ if eq (.Get "type") "btn" }} class="box box--btn btn btn--{{ .Get "size" | default "regular" }}"{{ end }}
{{ printf "href=%q" (.Scratch.Get "url") | safeHTMLAttr }}
>
{{ with .Get "icon" }}<i class="btn__icon fa fa-{{ . }}"></i>{{ end }}
{{ if eq (.Get "type") "btn" }}<div class="btn__text">{{ .Get "text" }}</div>
{{ else }}
{{ .Get "text" }}
{{ end }}
</a>

View File

@ -0,0 +1,7 @@
<!-- https://github.com/f/loremjs
shorcode parameter
2p = 2 paragraphs
5s = 5 sentences
6w = 6 words
1-6w = between 1 and 6 words -->
<div data-lorem={{ .Get 0 | default "2p" }}></div>

View File

@ -0,0 +1,16 @@
{{ $s := newScratch }}
{{ $s.Set "file" (.Get 0) }}
{{ if not ( path.Ext ($s.Get "file")) }}
{{ $s.Set "file" (print ($s.Get "file") ".md") }}
{{ end }}
{{ if not ( fileExists ($s.Get "file")) }}
{{ $s.Set "file" (print ( .Site.Params.extraContentDir | default "content_common") "/" ($s.Get "file")) }}
{{ end }}
<!-- file: {{ ($s.Get "file") }} -->
<div class="markdown-include">
{{ if fileExists ($s.Get "file") }}
{{ ($s.Get "file") | readFile | replaceRE "^---[\\s\\S]+?---" "" | markdownify }}
{{ else }}
Error file: {{ ($s.Get "file") }} not found
{{ end }}
</div>

View File

@ -0,0 +1,8 @@
{{ range .Site.Params.social }}
<li>
<a href="{{ .url }}" class="btn btn--round btn--large">
<i class="fa fa-{{ .icon }} fa-fw"></i>
<span class="network-name">{{ .title }}</span>
</a>
</li>
{{ end }}

View File

@ -0,0 +1,38 @@
{{ $.Scratch.Set "maxwidth" ( $.Page.Site.Params.youtube.maxwidth ) }}
{{ $.Scratch.Set "wpad" ( $.Page.Site.Params.youtube.wpad ) }}
{{ $.Scratch.Set "nothumb" ( $.Page.Site.Params.youtube.disable_thumb ) }}
{{ if .IsNamedParams }}
{{ with .Get "maxwidth" }}{{ $.Scratch.Set "maxwidth" . }}{{ end }}
{{ with .Get "wpad" }}{{ $.Scratch.Set "wpad" . }}{{ end }}
{{ with .Get "nothumb" }}{{ $.Scratch.Set "nothumb" . }}{{ end }}
<div class="box box--embed box--column box--youtube">
{{ with .Get "title" }}
<div class="box__title">{{ . }}</div>
{{ end }}
<div
youtube_id="{{ .Get "id" }}"
{{ with .Get "start"}} start="{{ . }}"{{ end }}
{{ with .Get "end"}} end="{{ . }}"{{ end }}
{{ with .Get "plist"}} list="{{ . }}"{{ end }}
{{ with $.Scratch.Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}
{{ with $.Scratch.Get "wpad"}} wPad="{{ . }}"{{ end }}
{{ with $.Scratch.Get "nothumb"}} nothumb="yes" {{ end }}
>
<!-- thumb and video get put here -->
</div>
{{ with .Get "caption"}}
<div class="box__caption">{{ . }}</div>
{{ end }}
</div>
{{ else }}
{{ $numOfParams := ( len .Params ) }}
<div class="box box--embed box--youtube"
youtube_id="{{ .Get 0 }}"
{{ if eq $numOfParams 2 }} start="{{ .Get 1 }}"{{ end }}
{{ with $.Scratch.Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}
{{ with $.Scratch.Get "wpad"}} wPad="{{ . }}"{{ end }}
{{ with $.Scratch.Get "nothumb"}} nothumb="yes" {{ end }}
>
<!-- image or iframe injected here -->
</div>
{{ end }}

5
static/css/custom.css Normal file
View File

@ -0,0 +1,5 @@
/* picture captions */
.lg-sub-html {
font-size: 2em;
font-weight: bold;
}

View File

@ -0,0 +1,191 @@
/* ----------------
Components/Shortcodes Styling
---------------- */
/* box creates a flexbox wrapper, row default */
.box {
display: flex;
flex-flow: wrap;
align-content: center;
justify-content: center;
padding-left: 0.5em;
padding-right: 0.5em;
}
.box--embed {
flex-direction: column;
flex-wrap: nowrap;
padding-bottom: 0;
justify-content: center;
align-items: center;
}
.box--embed::before,
.box--image::before {
content: "";
height: 0.5em;
}
.box--embed::after,
.box--image::after {
content: "";
height: 0.5em;
}
.box--btn-bar {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.box--column {
flex-direction: column;
align-items: center;
}
.box__caption {
font-style: italic;
}
.box__title {
text-transform: capitalize;
font-weight: bold;
}
.box--headline {
}
.box--text {
}
.box--btn {
padding: 0.5em;
margin-bottom: 0.5em;
}
.box--btn-bar > .box--btn {
margin-right: 0.2em;
}
.btn__text {
align-self: center;
}
.btn__icon {
align-self: center;
padding-right: 0.2em;
}
.btn--large .btn__text,
.btn--large .btn__icon {
font-size: 3rem;
}
.btn--small .btn__text,
.btn--small .btn__icon {
font-size: 1rem;
}
.btn--circle {
border-radius: 50%;
padding: 0.5em;
}
.highlight {
font-size: 0.7em;
align-items: left;
color: red;
background-color: white;
padding: 0.5em;
border-color: black;
border-width: 3px;
border-radius: 1em;
}
.highlight > ul > li::before {
font-family: FontAwesome;
content: "\f054"; /* chevron-right */
padding-right: 1.1em;
margin-left: -2em;
}
.box--avatar > a {
opacity: 1;
}
.thumb--yt {
display: flex;
align-items: center;
justify-content: center;
background-repeat: no-repeat;
background-size: cover;
filter: brightness(0.8);
}
.thumb--yt:hover {
-webkit-filter: brightness(1);
cursor: pointer;
}
.thumb--yt > .play-button {
font-size: 3.5em;
color: red;
text-shadow: 3px 3px black;
}
.box__embed--disqus {
width: 90vw;
max-width: 800px;
}
.box__contact-info > * {
padding: 0.1em;
align-self: center;
}
.box__contact-info > * > * {
margin: 0.2em;
align-self: center;
}
/*turn off default bullets*/
.box--gallery {
list-style: none;
}
.box--gallery li,
.box--gallery__item {
padding: 0.2em;
}
/*turn off fontawesome bullets*/
.box--gallery li::before,
.box--gallery__item li::before {
display: none;
}
code {
font-size: 0.8em;
font-family: 'Roboto Mono', monospace;
background-color: black;
border-radius: 0.2em;
color: white;
padding-left: 0.2em;
padding-right: 0.2em;
padding-top: 0.05em;
padding-bottom: 0.07em;
overflow-x: scroll;
}
code.hljs {
font-size: 0.75em;
border-radius: 0.2em;
background-color: black;
color: white;
padding: 1em;
margin-bottom: 0.7em;
width: inherit;
max-width: 90vw;
border-style: solid;
border-width: 3px;
border-color: dimgrey;
}

141
static/js/lorem.js Normal file
View File

@ -0,0 +1,141 @@
var Lorem;
(function() {
//Create a class named Lorem and constructor
Lorem = function() {
//Default values.
this.type = null;
this.query = null;
this.data = null;
};
//Static variables
Lorem.IMAGE = 1;
Lorem.TEXT = 2;
Lorem.TYPE = {
PARAGRAPH: 1,
SENTENCE: 2,
WORD: 3
};
//Words to create lorem ipsum text.
Lorem.WORDS = [
"lorem", "ipsum", "dolor", "sit", "amet,", "consectetur", "adipiscing", "elit", "ut", "aliquam,", "purus", "sit", "amet", "luctus", "venenatis,", "lectus", "magna", "fringilla", "urna,", "porttitor", "rhoncus", "dolor", "purus", "non", "enim", "praesent", "elementum", "facilisis", "leo,", "vel", "fringilla", "est", "ullamcorper", "eget", "nulla", "facilisi", "etiam", "dignissim", "diam", "quis", "enim", "lobortis", "scelerisque", "fermentum", "dui", "faucibus", "in", "ornare", "quam", "viverra", "orci", "sagittis", "eu", "volutpat", "odio", "facilisis", "mauris", "sit", "amet", "massa", "vitae", "tortor", "condimentum", "lacinia", "quis", "vel", "eros", "donec", "ac", "odio", "tempor", "orci", "dapibus", "ultrices", "in", "iaculis", "nunc", "sed", "augue", "lacus,", "viverra", "vitae", "congue", "eu,", "consequat", "ac", "felis", "donec", "et", "odio", "pellentesque", "diam", "volutpat", "commodo", "sed", "egestas", "egestas", "fringilla", "phasellus", "faucibus", "scelerisque", "eleifend", "donec", "pretium", "vulputate", "sapien", "nec", "sagittis", "aliquam", "malesuada", "bibendum", "arcu", "vitae", "elementum",
"curabitur", "vitae", "nunc", "sed", "velit", "dignissim", "sodales", "ut", "eu", "sem", "integer", "vitae", "justo", "eget", "magna", "fermentum", "iaculis", "eu", "non", "diam", "phasellus", "vestibulum", "lorem", "sed", "risus", "ultricies", "tristique", "nulla", "aliquet", "enim", "tortor,", "at", "auctor", "urna", "nunc", "id", "cursus", "metus", "aliquam", "eleifend", "mi", "in", "nulla", "posuere", "sollicitudin", "aliquam", "ultrices", "sagittis", "orci,", "a", "scelerisque", "purus", "semper", "eget", "duis", "at", "tellus", "at", "urna", "condimentum", "mattis", "pellentesque", "id", "nibh", "tortor,", "id", "aliquet", "lectus", "proin", "nibh", "nisl,", "condimentum", "id", "venenatis", "a,", "condimentum", "vitae", "sapien", "pellentesque", "habitant", "morbi", "tristique", "senectus", "et", "netus", "et", "malesuada", "fames", "ac", "turpis", "egestas", "sed", "tempus,", "urna", "et", "pharetra", "pharetra,", "massa", "massa", "ultricies", "mi,", "quis", "hendrerit", "dolor", "magna", "eget", "est", "lorem", "ipsum", "dolor", "sit", "amet,", "consectetur", "adipiscing", "elit", "pellentesque", "habitant", "morbi", "tristique", "senectus", "et", "netus", "et", "malesuada", "fames", "ac", "turpis", "egestas", "integer", "eget", "aliquet", "nibh", "praesent", "tristique", "magna", "sit", "amet", "purus", "gravida", "quis", "blandit", "turpis", "cursus", "in", "hac", "habitasse", "platea", "dictumst", "quisque", "sagittis,", "purus", "sit", "amet", "volutpat", "consequat,", "mauris", "nunc", "congue", "nisi,", "vitae", "suscipit", "tellus", "mauris", "a", "diam",
"maecenas", "sed", "enim", "ut", "sem", "viverra", "aliquet", "eget", "sit", "amet", "tellus", "cras", "adipiscing", "enim", "eu", "turpis", "egestas", "pretium", "aenean", "pharetra,", "magna", "ac", "placerat", "vestibulum,", "lectus", "mauris", "ultrices", "eros,", "in", "cursus", "turpis", "massa", "tincidunt", "dui", "ut", "ornare", "lectus", "sit", "amet", "est", "placerat", "in", "egestas", "erat", "imperdiet", "sed", "euismod", "nisi", "porta", "lorem", "mollis", "aliquam", "ut", "porttitor", "leo", "a", "diam", "sollicitudin", "tempor", "id", "eu", "nisl", "nunc", "mi", "ipsum,", "faucibus", "vitae", "aliquet", "nec,", "ullamcorper", "sit", "amet", "risus", "nullam", "eget", "felis", "eget", "nunc", "lobortis", "mattis", "aliquam", "faucibus", "purus", "in", "massa", "tempor", "nec", "feugiat", "nisl", "pretium", "fusce", "id", "velit", "ut", "tortor", "pretium", "viverra", "suspendisse", "potenti", "nullam", "ac", "tortor", "vitae", "purus", "faucibus", "ornare", "suspendisse", "sed", "nisi", "lacus,", "sed", "viverra", "tellus", "in", "hac", "habitasse", "platea", "dictumst", "vestibulum", "rhoncus", "est", "pellentesque", "elit", "ullamcorper", "dignissim", "cras", "tincidunt", "lobortis", "feugiat", "vivamus", "at", "augue", "eget", "arcu", "dictum", "varius", "duis", "at", "consectetur", "lorem",
"donec", "massa", "sapien,", "faucibus", "et", "molestie", "ac,", "feugiat", "sed", "lectus", "vestibulum", "mattis", "ullamcorper", "velit", "sed", "ullamcorper", "morbi", "tincidunt", "ornare", "massa,", "eget", "egestas", "purus", "viverra", "accumsan", "in", "nisl", "nisi,", "scelerisque", "eu", "ultrices", "vitae,", "auctor", "eu", "augue", "ut", "lectus", "arcu,", "bibendum", "at", "varius", "vel,", "pharetra", "vel", "turpis", "nunc", "eget", "lorem", "dolor,", "sed", "viverra", "ipsum", "nunc", "aliquet", "bibendum", "enim,", "facilisis", "gravida", "neque", "convallis", "a", "cras", "semper", "auctor", "neque,", "vitae", "tempus", "quam", "pellentesque", "nec", "nam", "aliquam", "sem", "et", "tortor", "consequat", "id", "porta", "nibh", "venenatis", "cras", "sed", "felis", "eget", "velit", "aliquet", "sagittis", "id", "consectetur", "purus", "ut", "faucibus", "pulvinar", "elementum", "integer", "enim", "neque,", "volutpat", "ac", "tincidunt", "vitae,", "semper", "quis", "lectus", "nulla", "at", "volutpat", "diam", "ut", "venenatis", "tellus", "in", "metus", "vulputate", "eu", "scelerisque", "felis", "imperdiet", "proin", "fermentum", "leo", "vel", "orci", "porta", "non", "pulvinar", "neque", "laoreet", "suspendisse", "interdum", "consectetur", "libero,", "id", "faucibus", "nisl", "tincidunt", "eget", "nullam", "non", "nisi", "est,", "sit", "amet", "facilisis", "magna",
"etiam", "tempor,", "orci", "eu", "lobortis", "elementum,", "nibh", "tellus", "molestie", "nunc,", "non", "blandit", "massa", "enim", "nec", "dui", "nunc", "mattis", "enim", "ut", "tellus", "elementum", "sagittis", "vitae", "et", "leo", "duis", "ut", "diam", "quam", "nulla", "porttitor", "massa", "id", "neque", "aliquam", "vestibulum", "morbi", "blandit", "cursus", "risus,", "at", "ultrices", "mi", "tempus", "imperdiet", "nulla", "malesuada", "pellentesque", "elit", "eget", "gravida", "cum", "sociis", "natoque", "penatibus", "et", "magnis", "dis", "parturient", "montes,", "nascetur", "ridiculus", "mus", "mauris", "vitae", "ultricies", "leo", "integer", "malesuada", "nunc", "vel", "risus", "commodo", "viverra", "maecenas", "accumsan,", "lacus", "vel", "facilisis", "volutpat,", "est", "velit", "egestas", "dui,", "id", "ornare", "arcu", "odio", "ut", "sem", "nulla", "pharetra", "diam", "sit", "amet", "nisl", "suscipit", "adipiscing", "bibendum", "est", "ultricies", "integer", "quis", "auctor", "elit",
"sed", "vulputate", "mi", "sit", "amet", "mauris", "commodo", "quis", "imperdiet", "massa", "tincidunt", "nunc", "pulvinar", "sapien", "et", "ligula", "ullamcorper", "malesuada", "proin", "libero", "nunc,", "consequat", "interdum", "varius", "sit", "amet,", "mattis", "vulputate", "enim", "nulla", "aliquet", "porttitor", "lacus,", "luctus", "accumsan", "tortor", "posuere", "ac", "ut", "consequat", "semper", "viverra", "nam", "libero", "justo,", "laoreet", "sit", "amet", "cursus", "sit", "amet,", "dictum", "sit", "amet", "justo", "donec", "enim", "diam,", "vulputate", "ut", "pharetra", "sit", "amet,", "aliquam", "id", "diam", "maecenas", "ultricies", "mi", "eget", "mauris", "pharetra", "et", "ultrices", "neque", "ornare", "aenean", "euismod", "elementum", "nisi,", "quis", "eleifend", "quam", "adipiscing", "vitae", "proin", "sagittis,", "nisl", "rhoncus", "mattis", "rhoncus,", "urna", "neque", "viverra", "justo,", "nec", "ultrices", "dui", "sapien", "eget", "mi", "proin", "sed", "libero", "enim,", "sed", "faucibus", "turpis", "in", "eu", "mi", "bibendum", "neque", "egestas", "congue", "quisque", "egestas", "diam", "in", "arcu", "cursus", "euismod", "quis", "viverra", "nibh", "cras", "pulvinar", "mattis", "nunc,", "sed", "blandit", "libero", "volutpat", "sed", "cras", "ornare", "arcu", "dui", "vivamus", "arcu", "felis,", "bibendum", "ut", "tristique", "et,", "egestas", "quis", "ipsum", "suspendisse", "ultrices", "gravida", "dictum",
"fusce", "ut", "placerat", "orci", "nulla", "pellentesque", "dignissim", "enim,", "sit", "amet", "venenatis", "urna", "cursus", "eget", "nunc", "scelerisque", "viverra", "mauris,", "in", "aliquam", "sem", "fringilla", "ut", "morbi", "tincidunt", "augue", "interdum", "velit", "euismod", "in", "pellentesque", "massa", "placerat", "duis", "ultricies", "lacus", "sed", "turpis", "tincidunt", "id", "aliquet", "risus", "feugiat", "in", "ante", "metus,", "dictum", "at", "tempor", "commodo,", "ullamcorper", "a", "lacus", "vestibulum", "sed", "arcu", "non", "odio", "euismod", "lacinia", "at", "quis", "risus", "sed", "vulputate", "odio", "ut", "enim", "blandit", "volutpat", "maecenas", "volutpat", "blandit", "aliquam", "etiam", "erat", "velit,", "scelerisque", "in", "dictum", "non,", "consectetur", "a", "erat", "nam", "at", "lectus", "urna", "duis", "convallis", "convallis", "tellus,", "id", "interdum", "velit", "laoreet", "id", "donec", "ultrices", "tincidunt", "arcu,", "non", "sodales", "neque", "sodales", "ut", "etiam", "sit", "amet", "nisl", "purus,", "in", "mollis", "nunc",
"sed", "id", "semper", "risus", "in", "hendrerit", "gravida", "rutrum", "quisque", "non", "tellus", "orci,", "ac", "auctor", "augue", "mauris", "augue", "neque,", "gravida", "in", "fermentum", "et,", "sollicitudin", "ac", "orci", "phasellus", "egestas", "tellus", "rutrum", "tellus", "pellentesque", "eu", "tincidunt", "tortor", "aliquam", "nulla", "facilisi", "cras", "fermentum,", "odio", "eu", "feugiat", "pretium,", "nibh", "ipsum", "consequat", "nisl,", "vel", "pretium", "lectus", "quam", "id", "leo", "in", "vitae", "turpis", "massa", "sed", "elementum", "tempus", "egestas", "sed", "sed", "risus", "pretium", "quam", "vulputate", "dignissim", "suspendisse", "in", "est", "ante", "in", "nibh", "mauris,", "cursus", "mattis", "molestie", "a,", "iaculis", "at", "erat",
"pellentesque", "adipiscing", "commodo", "elit,", "at", "imperdiet", "dui", "accumsan", "sit", "amet", "nulla", "facilisi", "morbi", "tempus", "iaculis", "urna,", "id", "volutpat", "lacus", "laoreet", "non", "curabitur", "gravida", "arcu", "ac", "tortor", "dignissim", "convallis", "aenean", "et", "tortor", "at", "risus", "viverra", "adipiscing", "at", "in", "tellus", "integer", "feugiat", "scelerisque", "varius", "morbi", "enim", "nunc,", "faucibus", "a", "pellentesque", "sit", "amet,", "porttitor", "eget", "dolor", "morbi", "non", "arcu", "risus,", "quis", "varius", "quam", "quisque", "id", "diam", "vel", "quam", "elementum", "pulvinar", "etiam", "non", "quam", "lacus", "suspendisse", "faucibus", "interdum", "posuere", "lorem", "ipsum", "dolor", "sit", "amet,", "consectetur", "adipiscing", "elit", "duis", "tristique", "sollicitudin", "nibh", "sit", "amet", "commodo", "nulla", "facilisi",
"nullam", "vehicula", "ipsum", "a", "arcu", "cursus", "vitae", "congue", "mauris", "rhoncus", "aenean", "vel", "elit", "scelerisque", "mauris", "pellentesque", "pulvinar", "pellentesque", "habitant", "morbi", "tristique", "senectus", "et", "netus", "et", "malesuada", "fames", "ac", "turpis", "egestas", "maecenas", "pharetra", "convallis", "posuere", "morbi", "leo", "urna,", "molestie", "at", "elementum", "eu,", "facilisis", "sed", "odio", "morbi", "quis", "commodo", "odio", "aenean", "sed", "adipiscing", "diam", "donec", "adipiscing", "tristique", "risus", "nec", "feugiat", "in", "fermentum", "posuere", "urna", "nec", "tincidunt", "praesent", "semper", "feugiat", "nibh", "sed", "pulvinar", "proin", "gravida", "hendrerit", "lectus", "a", "molestie"
];
//random integer method.
Lorem.prototype.randomInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
//text creator method with parameters: how many, what
Lorem.prototype.createText = function(count, type) {
switch (type) {
//paragraphs are loads of sentences.
case Lorem.TYPE.PARAGRAPH:
var paragraphs = new Array;
for (var i = 0; i < count; i++) {
var paragraphLength = this.randomInt(10, 20);
var paragraph = this.createText(paragraphLength, Lorem.TYPE.SENTENCE);
paragraphs.push('<p>'+paragraph+'</p>');
}
return paragraphs.join('\n');
break;
//sentences are loads of words.
case Lorem.TYPE.SENTENCE:
var sentences = new Array;
for (var i = 0; i < count; i++) {
var sentenceLength = this.randomInt(5, 10);
var words = this.createText(sentenceLength, Lorem.TYPE.WORD).split(' ');
words[0] = words[0].substr(0, 1).toUpperCase() + words[0].substr(1);
var sentence = words.join(' ');
sentences.push(sentence);
}
return (sentences.join('. ') + '.').replace(/(\.\,|\,\.)/g, '.');
break;
//words are words
case Lorem.TYPE.WORD:
var wordIndex = this.randomInt(0, Lorem.WORDS.length - count - 1);
return Lorem.WORDS.slice(wordIndex, wordIndex + count).join(' ').replace(/\.|\,/g, '');
break;
}
};
Lorem.prototype.createLorem = function(element) {
var lorem = new Array;
var count;
if (/\d+-\d+[psw]/.test(this.query)){
var range = this.query.replace(/[a-z]/,'').split("-");
count = Math.floor(Math.random() * parseInt(range[1])) + parseInt(range[0]);
}else{
count = parseInt(this.query);
}
if (/\d+p/.test(this.query)) {
var type = Lorem.TYPE.PARAGRAPH;
}
else if (/\d+s/.test(this.query)) {
var type = Lorem.TYPE.SENTENCE;
}
else if (/\d+w/.test(this.query)) {
var type = Lorem.TYPE.WORD;
}
lorem.push(this.createText(count, type));
lorem = lorem.join(' ');
if (element) {
if (this.type == Lorem.TEXT)
element.innerHTML += lorem;
else if (this.type == Lorem.IMAGE) {
//TODO: for now, using lorempixum.
var path = '';
var options = this.query.split(' ');
if (options[0] == 'gray') {
path += '/g';
options[0] = '';
}
if (element.getAttribute('width'))
path += '/' + element.getAttribute('width');
if (element.getAttribute('height'))
path += '/' + element.getAttribute('height');
path += '/' + options.join(' ').replace(/(^\s+|\s+$)/, '');
element.src = 'http://lorempixum.com'+path.replace(/\/\//, '/');
}
}
if (element == null)
return lorem;
};
//Register as jQuery
if (typeof jQuery != 'undefined') {
(function($) {
$.fn.lorem = function() {
$(this).each(function() {
var lorem = new Lorem;
lorem.type = $(this).is('img') ? Lorem.IMAGE : Lorem.TEXT;
//data-lorem can be taken with data function (thanks to http://forrst.com/people/webking)
lorem.query = $(this).data('lorem');
lorem.createLorem(this);
})
};
//If developer run this javascript, then we can run the lorem.js
$(document).ready(function() {
$('[data-lorem]').lorem();
});
})(jQuery);
}
})();

161
static/js/page.js Normal file
View File

@ -0,0 +1,161 @@
// Smooth Scroll Init - Register click handler for ID anchors
$('a[href*="#"]:not(a[modal])').click(function () {
if (location.pathname.replace(/\/$/, "") == this.pathname.replace(/\/$/, "") && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
var targetOffset = target.offset().top - $(".nav-bar__header").outerHeight(true);
// console.log(targetOffset, target.offset().top, $(".nav-bar__header").outerHeight())
$('html, body').animate({
scrollTop: targetOffset
}, 1000);
return false;
}
}
});
// navbar mobile toggle - preload
(function navbarInit() {
function toggleMobileMenu() {
$('.nav-bar__menu')[0].style.transition = "max-height 0.5s";
$('.nav-bar__menu')[0].classList.toggle("hide-menu");
}
$('.nav-bar__menu-button, .nav-bar__menu-item > a').click(toggleMobileMenu)
}());
// using an image for phone and toggle hide it
$('#cell').click(function () { $('#cell-number').toggleClass("hide"); });
// $('#phone').click(function () { alert('phone clicked'); return false; });
function navbarSpacer() {
$('.nav-bar-spacer').css({
height: $(".nav-bar__header").outerHeight(true),
});
}
// hero resizer
function heroResize(bfr = 30) {
var h = $(window).height() - $(".nav-bar__header").outerHeight(true),
w = $(window).width(),
fr = bfr * h / w
// console.log('w,h,fr', w, h, fr)
// minimum base font ratio
fr = (fr > bfr) ? bfr : fr
// adjust for short viewport height
fr = (w / h > 1 && h < 700) ? 30 * w / h : fr
//console.log('fr after', fr)
$('#hero').css({
width: w + 15,
height: h / w > 1.5 ? w * 1.5 : h,
});
var mf = w / h > 1 ? 0 : 12
$('#hero').flowtype({
maxFont: 30,
minFont: mf,
fontRatio: fr
});
}
function typeResize(fr = 20) {
$('main:not(#hero)').flowtype({
// maximum: 1000,
minFont: 12,
maxFont: 25,
fontRatio: fr
})
}
// Lightbox for Gallery
function lightgallery(id) {
// Intialize all the media i.e. photos with "media" id
// TODO use Hugo params to initialize multiple galleries/albums
var lg = $(id).lightGallery({
thumbnail: true,
thumbWidth: 80,
controls: true,
loop: false,
download: false,
counter: true,
// videojs: true
});
lg.on('onBeforeOpen.lg', function (event) {
$('.nav-bar').css("display", "none")
});
lg.on('onCloseAfter.lg', function (event) {
$('.nav-bar').css("display", "flex")
});
}
// Modal tool. Must use modal template for content
(function ($) {
// extend jquery so remove handlers can be added and removed at the right time in a group
$.fn.modalHandlers = function (state = 'on') {
if (state === 'on') {
$(document).on('click', modalClickOutside);
$(document).keypress(modalEsc);
this.find('a[modal-close]').on('click', modalClickCloser);
return this
}
if (state === 'off') {
$(document).off('click', modalClickOutside);
$(document).off('keypress', modalEsc);
this.find('a[modal-close]').off('click', modalClickCloser);
return this
}
return false;
};
// modal event handlers - add more if you want - add them to extension above
function modalEsc(event) {
if (event.key === "Escape") { modalHide() }
}
function modalClickOutside(event) {
var container = $(".section__container--modal");
if (!container.is(event.target) && // If the target of the click isn't the container...
container.has(event.target).length === 0) // ... nor a descendant of the container
{ modalHide(); }
}
function modalClickCloser(event) {
modalHide();
}
// modal show and hide
function modalShow(modal_hash) {
var closer = "<a modal-close class='fa-stack fa-2x' ><i class='fa fa-circle-thin fa-stack-2x'></i><i class='fa fa-close fa-stack-1x'></i></a>"
$(modal_hash).find('.section__headline').append(closer).end().modalHandlers().addClass("current").css('display', 'flex');
}
function modalHide() {
$('.section--modal.current').hide().modalHandlers("off").removeClass("current").find('a[modal-close]').remove;
}
// Register click event for all modal links on page
$("a[modal]").click(function () {
if (location.pathname.replace(/\/$/, "") == this.pathname.replace(/\/$/, "") && location.hostname == this.hostname) {
var target = this.hash;
modalShow(target);
} else {
alert(`modal display of off page content not supported`);
}
return false;
});
}(jQuery));
// end modal

6
static/js/util.js Normal file
View File

@ -0,0 +1,6 @@
function isMobile(a) {
return (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)));
}
// Call is
// isMobile(navigator.userAgent || navigator.vendor || window.opera)

50
static/js/youtube.js Normal file
View File

@ -0,0 +1,50 @@
(function ($) {
$(document).bind("DOMContentLoaded",
function () {
var playBtn = '<i class="fa fa-play-circle-o play-button"></i>'
$('div[youtube_id]').each(function () {
if ($(this).attr('nothumb') !== "yes") {
var vid = $(this).attr('youtube_id');
var bgi = `style="background-image: url(https://i.ytimg.com/vi/${vid}/mqdefault.jpg)"`
var thumb = `<div class="thumb--yt" ${bgi} width="560" height="315">`
$(this).append(thumb).children().append(playBtn).click(insertIframe).fitToWindow()
} else { // if image thumbs turned off
insertIframe.call(this)
}
})
})
function insertIframe() {
var $box = $(this).parent()
var id = $box.attr('youtube_id')
var autoplay = "autoplay=1&"
if (!id) { // image thumb is off not called by thumb so don't need parent
$box = $(this)
id = $box.attr('youtube_id')
autoplay = ""
}
var mw = $box.attr('maxWidth');
var wp = $box.attr('wPad');
var start = $box.attr("start") || 1
if ($box.attr("end")) { var end = "&end=" + $box.attr("end") } else { var end = "" }
var list = ""
if ($box.attr("list")) { list = `&list=${$box.attr("list")}` }
var url = `https://www.youtube.com/embed/${id}?${autoplay}start=${start}${end}`
var vIframe = `<iframe width = "560" height = "315" src ="${url}${list}" frameborder = "0" allowfullscreen></iframe>`
$box.html(vIframe).children().fitToWindow($box.data("maxWidth") || mw, $box.data("wPad") || wp)
}
}(jQuery));
// TODO grab the video title as well as the thumb for use in thumb display
// only works if server allows cross domain like s3
//http://stackoverflow.com/questions/1760231/how-do-i-get-the-title-of-a-youtube-video-if-i-have-the-video-id
// #var ytApiKey = "...";
// #var videoId = "ylLzyHk54Z0";
// #$.get("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" + videoId + "&key=" + ytApiKey, function(data) {
// #alert(data.items[0].snippet.title);
// # });