Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,37 @@ function generateMiniToc() {
$(".blog-sidebar-toggle").click(function () {
$(".blog-sidebar-content").toggleClass("hidden");
});

// Home-page carousel. Items cycle every four seconds. Clicking a label stops the
// cycling and shows the selected item.
var carouselIndex = 1;

var carouselInterval = window.setInterval(function() {
showCarouselItem(carouselIndex);
carouselIndex++;

if (carouselIndex > 2) {
carouselIndex = 0;
}
}, 4000);

$(".carousel-item-label").click(function() {
clearInterval(carouselInterval);

var i = $(".carousel-item-label").index(this);
showCarouselItem(i);
});

function showCarouselItem(i) {
$(".carousel-item")
.css("opacity", 0)
.eq(i)
.css("opacity", 1);

$(".carousel-item-label")
.removeClass("border-b-2")
.eq(i)
.addClass("border-b-2");
}

}(jQuery));
4 changes: 4 additions & 0 deletions assets/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ main {

.transition-all {
@include transition(all);

&-200 {
@include transition($duration: 200ms);
}
}

.github-widget {
Expand Down
21 changes: 14 additions & 7 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "hero" }}
<header class="header-hero">
<header class="header-hero header-hero-glow">
<div class="header-hero-items container mx-auto">
<div class="header-hero-item">
<h1>Modern Infrastructure as Code</h1>
Expand All @@ -13,12 +13,19 @@ <h1>Modern Infrastructure as Code</h1>
</div>
</div>
<div class="header-hero-item">
<iframe class="rounded shadow-lg max-w-full"
width="648" height="356"
src="https://www.youtube.com/embed/B2Z2bT4Q-NY?rel=0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
frameborder="0"
allowfullscreen></iframe>
<div class="max-w-xl text-center">
{{ partial "chrome.html" . }}
<div class="relative overflow-auto relative rounded-b">
<img class="carousel-item opacity-1 transition-all-200" src="/images/home/carousel-code.png" alt="Pulumi code">
<img class="carousel-item opacity-0 transition-all-200 absolute inset-0" src="/images/home/carousel-cli.png" alt="Pulumi CLI">
<img class="carousel-item opacity-0 transition-all-200 absolute inset-0" src="/images/home/carousel-console.png" alt="Pulumi Console">
</div>
<div class="inline-flex text-sm font-bold my-6">
<a class="carousel-item-label cursor-pointer pb-1 border-b-2 border-orange-500">Code</a>
<a class="carousel-item-label cursor-pointer pb-1 mx-4 border-orange-500">CLI</a>
<a class="carousel-item-label cursor-pointer pb-1 border-orange-500">Console</a>
</ul>
</div>
</div>
</div>
</header>
Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/chrome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="bg-gray-400 rounded-t">
<div class="flex p-3">
<div class="bg-red-600 rounded-full h-3 w-3"></div>
<div class="bg-yellow-600 rounded-full h-3 w-3 mx-2"></div>
<div class="bg-green-600 rounded-full h-3 w-3"></div>
</div>
</div>
25 changes: 0 additions & 25 deletions layouts/partials/code-display.html

This file was deleted.

8 changes: 1 addition & 7 deletions layouts/partials/code.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

<div class="code-mode-{{ default "light" .mode }} {{ if .chrome }} code-chrome {{ end }} code-{{ .lang }}">
{{ if .chrome }}
<div class="bg-gray-400 rounded-t">
<div class="flex p-3">
<div class="bg-red-600 rounded-full h-3 w-3"></div>
<div class="bg-yellow-600 rounded-full h-3 w-3 mx-2"></div>
<div class="bg-green-600 rounded-full h-3 w-3"></div>
</div>
</div>
{{ partial "chrome.html" . }}
{{ end }}
{{ highlight .code $lang (default "" .opts) }}
</div>
6 changes: 3 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<nav class="nav-main bg-purple-700 py-6 px-4 lg:px-0 border-t border-purple-500">
<div class="container mx-auto">
<header class="flex items-center justify-between flex-wrap">
<div class="flex items-center flex-shrink-0 text-white mr-6">
<header class="flex items-center justify-between flex-wrap md:flex-no-wrap">
<div class="flex items-center flex-shrink-0 text-white lg:mr-6">
<a class="block" href="/">
<img class="h-10 block" src="/images/logo/logo-inv.svg" alt="Pulumi logo">
</a>
Expand All @@ -33,7 +33,7 @@

<ul class="nav-header-items hidden w-full flex-grow md:flex md:items-center md:w-auto text-white text-sm md:text-xs lg:text-sm uppercase pt-4 md:pt-0">
{{ range $.Site.Menus.header }}
<li>
<li class="whitespace-no-wrap">
{{ $active := hasPrefix $.RelPermalink .URL }}
<a href="{{ .URL }}" class="block py-2 px-4 md:px-0 md:py-0 md:px-4 md:py-2 my-2 md:my-0 lg:mx-4 border hover:border-purple-500 hover:bg-purple-600 rounded {{ if $active }}border-purple-500 bg-purple-600{{ else }}border-purple-700{{ end }}">
{{ .Name }}
Expand Down
125 changes: 0 additions & 125 deletions layouts/partials/hero.html

This file was deleted.

File renamed without changes