Skip to content

Commit

Permalink
Merge branch 'release/0.1.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Dec 9, 2024
2 parents 0f83c08 + 5b55cd0 commit e3ee59a
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 5 deletions.
104 changes: 104 additions & 0 deletions assets/components/access.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import React, { useState, useEffect } from 'react'
import { motion, useAnimate } from 'framer-motion'

const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: {
staggerChildren: 0.1
}
}
}

const character = {
hidden: { opacity: 0 },
show: { opacity: 1 }
}

const loggedInText = `
Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-47-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
Expanded Security Maintenance for Applications is not enabled.
62 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
10 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
`

function Window(props) {
return (
<svg
width={props.width}
height={props.height}
viewBox="0 0 883 606"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
xmlSpace="preserve"
xmlns:serif="http://www.serif.com/"
style={{
fillRule: "evenodd",
clipRule: "evenodd",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeMiterlimit: 1.5,
}}
{...props}
>
<path
d="M882.375,13.949l0,578.102c0,7.492 -6.082,13.574 -13.574,13.574l-854.852,0c-7.492,0 -13.574,-6.082 -13.574,-13.574l-0,-578.102c-0,-7.492 6.082,-13.574 13.574,-13.574l854.852,0c7.492,0 13.574,6.082 13.574,13.574Z"
style={{
fill: "#020617",
fillOpacity: 0.36,
stroke: "#fff",
strokeOpacity: 0.14,
strokeWidth: "0.75px",
}}
/>
<path
d="M0.375,571.875l882,0"
style={{
fill: "none",
stroke: "#fff",
strokeOpacity: 0.2,
strokeWidth: "0.75px",
}}
/>
</svg>
)
}

export function SSHAccess() {
const [isLoggedIn, setIsLoggedIn] = useState(false)
const [scope, animate] = useAnimate()

useEffect(() => {
if (!isLoggedIn) {
animate(scope.current, { opacity: 0 })
}

if (isLoggedIn) {
animate(scope.current, { opacity: 1 })
}
}, [isLoggedIn])

return (
<div>
<Window width={800} height={600} className="absolute left-1/2 -translate-x-1/2 -bottom-8"/>
<motion.div className="absolute left-10 bottom-0 mb-0.5 text-xs font-mono" onAnimationStart={() => setIsLoggedIn(false)} onAnimationComplete={() => setIsLoggedIn(true) } variants={container} initial="hidden" whileInView="show">
{'ssh ubuntu@your-bastion-address'.split('').map((char, index) => <motion.span variants={character} key={`${char}-${index}`} className='text-slate-400'>{char}</motion.span>)}
</motion.div>
<motion.div ref={scope} className="absolute left-10 bottom-0 mb-2 text-xs text-slate-500 font-mono" initial={{ opacity: 0 }}>
{loggedInText.split("\n\n").map((line, index) =>
<div className="my-6" key={index}>{line.split("\n").map((l, idx) => <p key={`line-${idx}`}>{l}</p>)}</div>
)}
</motion.div>
</div>
)
}
13 changes: 13 additions & 0 deletions assets/js/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { MobileNav } from "../components/mobile-nav";
import { Categories } from '../components/categories';
import { Player } from '../components/player';
import { Technologies } from '../components/technologies';
import { SSHAccess } from '../components/access';

function mountCategories() {
const domNode = this.el;
Expand Down Expand Up @@ -92,6 +93,13 @@ function mountStaggerIn() {
animate(nodes, {opacity: [0, 1]}, {delay: stagger(0.2)})
}

function mountAccess() {
const el = this.el;
const root = createRoot(el);

root.render(<SSHAccess />);
}

let Hooks = {};

Hooks.MountBroadcast = {
Expand Down Expand Up @@ -119,6 +127,11 @@ Hooks.MountStaggerIn = {
updated: mountStaggerIn,
}

Hooks.MountAccess = {
mounted: mountAccess,
updated: mountAccess,
}

Hooks.MountPlayer = {
mounted() {
const domNode = this.el;
Expand Down
6 changes: 3 additions & 3 deletions lib/opsmaru_web/live/blog_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule OpsmaruWeb.BlogLive do
</div>
<div class="px-6 lg:px-8">
<div class="mx-auto max-w-2xl lg:max-w-7xl">
<div class="mt-16 grid grid-cols-1 gap-8 pb-24 lg:grid-cols-[15rem_1fr] xl:grid-cols-[15rem_1fr_15rem]">
<div class="mt-16 grid grid-cols-1 gap-8 pb-24 lg:grid-cols-[15rem_1fr]">
<div class="flex flex-wrap items-center gap-8 max-lg:justify-between lg:flex-col lg:items-start">
<div class="flex items-center gap-3">
<img
Expand All @@ -55,13 +55,13 @@ defmodule OpsmaruWeb.BlogLive do
</div>
</div>
<div class="text-slate-700">
<div class="max-w-2xl xl:mx-auto">
<div class="max-w-7xl xl:mx-auto">
<img
class="mb-10 aspect-[3/2] w-full rounded-2xl object-cover shadow-xl"
alt={@post.cover.alt}
src={Image.url(@post.cover, w: 1024)}
/>
<div class="prose prose-slate prose-img:rounded-2xl prose-h2:font-medium lg:prose-lg">
<div class="prose prose-slate max-w-max prose-img:rounded-2xl prose-h2:font-medium lg:prose-lg">
<%= raw(render_markdown(@post.content)) %>
</div>
<div class="mt-10">
Expand Down
4 changes: 3 additions & 1 deletion lib/opsmaru_web/live/home_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ defmodule OpsmaruWeb.HomeLive do
</h3>
<div class="mt-10 grid grid-cols-1 gap-4 sm:mt-16 lg:grid-cols-6 lg:grid-rows-2">
<div class="max-lg:rounded-t-4xl lg:col-span-4 lg:rounded-tl-4xl group relative flex flex-col overflow-hidden rounded-lg shadow-sm ring-1 ring-black/5 bg-slate-800 ring-white/15">
<div class="relative h-80 shrink-0"></div>
<div id="access" class="relative h-80 shrink-0" phx-hook="MountAccess">
</div>
<div class="relative p-10"></div>
</div>
<div class="z-10 lg:col-span-2 lg:rounded-tr-4xl group relative flex flex-col overflow-hidden rounded-lg shadow-sm ring-1 ring-black/5 bg-slate-800 ring-white/15">
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Opsmaru.MixProject do
def project do
[
app: :opsmaru,
version: "0.1.12",
version: "0.1.13",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit e3ee59a

Please sign in to comment.