Skip to content

Commit

Permalink
Add video to homepage hero (#26)
Browse files Browse the repository at this point in the history
* Add video to homepage hero

* Add Layout with video

* Update version

* Update lockfile

* Fix text overlapping with video

* Autoplay, loop and mute video

* Improve responsive design

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>

---------

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
karlhorky and brc-dd committed Mar 10, 2023
1 parent 0939c89 commit 5fd5206
Show file tree
Hide file tree
Showing 6 changed files with 433 additions and 65 deletions.
27 changes: 27 additions & 0 deletions docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup>
import DefaultTheme from "vitepress/theme";
</script>

<template>
<DefaultTheme.Layout>
<template #home-hero-image>
<video autoplay loop muted src="/video.mp4" class="video" />
</template>
</DefaultTheme.Layout>
</template>

<style scoped>
.video {
position: absolute;
top: 50%;
left: 50%;
max-height: 192px;
transform: translate(-50%, -50%);
}
@media (min-width: 640px) {
.video {
max-height: unset;
}
}
</style>
6 changes: 5 additions & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import DefaultTheme from "vitepress/theme";
import Layout from "./Layout.vue";
import "./custom.css";

export default DefaultTheme;
export default {
...DefaultTheme,
Layout: Layout,
};
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ layout: home
hero:
name: SafeQL
text: Write SQL Queries With Confidence
tagline: SafeQL is an ESLint plugin for writing SQL queries in a type-safe way.
tagline: |
An ESLint plugin for writing SQL queries
in a type-safe way.
image:
src: /ts-pg-logo.svg
alt: ts-safeql
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"devDependencies": {
"@algolia/client-search": "4.14.2",
"vitepress": "1.0.0-alpha.13",
"vitepress": "1.0.0-alpha.49",
"vue": "3.2.39"
}
}
Binary file added docs/public/video.mp4
Binary file not shown.

1 comment on commit 5fd5206

@vercel
Copy link

@vercel vercel bot commented on 5fd5206 Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.