Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing pages UI #19

Merged
merged 51 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
23a881c
Remove unnecessary software
ngumokenneth Aug 8, 2024
ce0386f
Update UI
ngumokenneth Aug 9, 2024
3622dda
Revert script changes
ngumokenneth Aug 9, 2024
20eea4b
Merge branch 'main' into tools_scripts
amos-kibet Aug 9, 2024
ab6924d
Merge remote-tracking branch 'origin/main' into tools_scripts
ngumokenneth Aug 13, 2024
9921f75
Update UI based on detected OS
ngumokenneth Aug 13, 2024
9243247
Temporary commit
ngumokenneth Aug 13, 2024
384216a
Merge branch 'tools_scripts' of github.com:ngumokenneth/phx.tools int…
ngumokenneth Aug 13, 2024
38098f7
Fix instollations instructionstoggle
ngumokenneth Aug 14, 2024
701be93
Fix render buttons type spec
ngumokenneth Aug 14, 2024
da8d45b
Fix render button type spec
ngumokenneth Aug 14, 2024
9027120
Fix macOS landing page
ngumokenneth Aug 14, 2024
f981821
Fix failing tests
ngumokenneth Aug 15, 2024
43f215d
Fix live_action toggle
ngumokenneth Aug 15, 2024
e15d8bc
Add temporary asciinema
ngumokenneth Aug 15, 2024
1e636fa
Fix ascciinema UI
ngumokenneth Aug 16, 2024
12ddbd6
Merge branch 'main' into tools_scripts
amos-kibet Aug 16, 2024
05c54c7
Format code
amos-kibet Aug 16, 2024
5085edc
Match UI with design
ngumokenneth Aug 16, 2024
b5f0b04
Merge branch 'tools_scripts' of github.com:optimumBA/phx.tools into t…
ngumokenneth Aug 16, 2024
96e73b8
Fix Asciinema embedding
amos-kibet Aug 16, 2024
a645f86
Update UI for unsupported OS
ngumokenneth Aug 17, 2024
04586d5
Solve failing tests
ngumokenneth Aug 19, 2024
7ce99c6
scroll command input on mobile and use hero icons
jrowah Aug 20, 2024
ce45846
fix large screen responsiveness and refactor code
jrowah Aug 20, 2024
1d04a6e
fix typography and reorganize files
jrowah Aug 20, 2024
b48b89d
refactor code and remove unused files
jrowah Aug 23, 2024
d031908
fix typography and refactor code
jrowah Aug 23, 2024
3d56989
fix failing tests
jrowah Aug 23, 2024
bc23980
capitalize os name on instructions card
jrowah Aug 24, 2024
f468726
remove OS name case manipulation
jrowah Aug 28, 2024
988bb97
refactor code
jrowah Aug 29, 2024
1927f73
use slot to render instructions
jrowah Aug 29, 2024
33f0a14
fix shadow glaring
jrowah Aug 29, 2024
c1188df
scale up fly vm memory
jrowah Aug 29, 2024
f510c0d
assign rource code url from a function
jrowah Aug 30, 2024
914ee78
decapitalize linux file name and urls
jrowah Sep 3, 2024
6248f3b
rename linux file
jrowah Sep 3, 2024
0f193b2
fix failing tests
jrowah Sep 3, 2024
13abd7c
delete extra file
jrowah Sep 8, 2024
d1fdc78
refactor code and bring back linux script
jrowah Sep 8, 2024
205e64a
fix broken source code link
jrowah Sep 8, 2024
1b492b9
fix broken source code link for linux script
jrowah Sep 8, 2024
a5ecea9
fix file renaming on git
jrowah Sep 10, 2024
064c63b
use lowercase url slug for macOS
jrowah Sep 17, 2024
63200c5
fix source code bug when live action is index
jrowah Sep 17, 2024
82e98b6
fix macos slug and refactor code
jrowah Sep 17, 2024
daa0a47
test source code url
jrowah Sep 17, 2024
781bb75
update source code url tests
jrowah Sep 17, 2024
5319e66
Merge branch 'main' into tools_scripts
almirsarajcic Sep 20, 2024
eca3b0e
Update ASCIINEMA cast IDs
almirsarajcic Sep 20, 2024
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
15 changes: 14 additions & 1 deletion assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;500;700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Martian+Mono:wght@100..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');
/* This file is for your main application CSS */
.solved-height {
padding: 0;
margin: 0;
height: 100vh;
height: var(--doc-height);
}

@layer utilities {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}
4 changes: 3 additions & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import 'phoenix_html'
import { Socket } from 'phoenix'
import { LiveSocket } from 'phoenix_live_view'
import topbar from '../vendor/topbar'
import CopyHook from './hooks/copy_hook.js'
import AsciinemaHook from './hooks/asciinema_hook'
import CopyHook from './hooks/copy_hook'

const Hooks = {
AsciinemaHook,
CopyHook,
}

Expand Down
9 changes: 9 additions & 0 deletions assets/js/hooks/asciinema_hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
mounted() {
const id = this.el.dataset.asciicast
const script = document.createElement('script')
script.id = `asciicast-${id}`
script.src = `https://asciinema.org/a/${id}.js`
this.el.appendChild(script)
},
}
22 changes: 16 additions & 6 deletions assets/js/hooks/copy_hook.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
export default {
mounted() {
this.el.addEventListener('click', () => {
var copyText = document.getElementById('tool-installation').innerText
const copyContainer = this.el
const copyElement = document.getElementById('copy-icon')
const copyConfirmationElement = document.getElementById('copied-icon')

copyContainer.addEventListener('click', (event) => {
event.preventDefault()
event.stopPropagation()

const copyText = document.getElementById('tool-installation').innerText
navigator.clipboard.writeText(copyText)
copyBtn = document.getElementById('copy')
copyBtn.innerHTML = 'Copied'
copyBtn.setAttribute('disabled', '')
copyBtn.classList.add('bg-[#9887FF]')
copyElement.classList.add('hidden')
copyConfirmationElement.classList.remove('hidden')

setTimeout(() => {
copyConfirmationElement.classList.add('hidden')
copyElement.classList.remove('hidden')
}, 600)
})
},
}
9 changes: 9 additions & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ module.exports = {
// => @media (min-width: 1240px) { ... }
},
extend: {
boxShadow: {
custom: '0 4px 10px rgba(194, 184, 255, 0.5)',
},
fontSize: {
md: '15px',
},
fontFamily: {
montserrat: ['Montserrat', 'sans-serif'],
},
fontFamily: {
pixelify: ['Pixelify Sans', 'sans-serif'],
},
fontFamily: {
martian: ['Martian Mono', 'sans-serif'],
},
colors: {
brand: '#FD4F00',
indigo: {
Expand Down
2 changes: 1 addition & 1 deletion fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ timeout = "5s"
[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 256
memory_mb = 512
1 change: 0 additions & 1 deletion lib/phx_tools_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ defmodule PhxToolsWeb do
quote do
use Phoenix.Component

alias PhxToolsWeb.Components.SharedComponents
alias PhxToolsWeb.SeoMetaTagComponent

# Import convenience functions from controllers
Expand Down
27 changes: 0 additions & 27 deletions lib/phx_tools_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,6 @@ defmodule PhxToolsWeb.CoreComponents do
@type rendered :: Rendered.t()
@type selector :: String.t()

@doc """
Renders a card for being able to select OS
"""
attr :id, :string, required: true
attr :class, :list
attr :href, :string, required: true
attr :os_icon, :string, required: true
attr :os_name, :string, required: true

@spec os_link_card(assigns()) :: rendered()
def os_link_card(assigns) do
~H"""
<.link patch={@href}>
<div
id={@id}
class={[
"block border-[2px] border-[#5337FF] py-2 rounded-md cursor-pointer hover:bg-indigo-850",
@class
]}
>
<img src={@os_icon} />
<h1 class="text-white text-center"><%= @os_name %></h1>
</div>
</.link>
"""
end

@doc """
Renders flash notices.

Expand Down
9 changes: 2 additions & 7 deletions lib/phx_tools_web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<%= assigns[:page_title] || "PhxTools" %>
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<link rel="preconnect" href="https://asciinema.org/" />
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script>
<script
Expand All @@ -19,13 +20,7 @@
</script>
</head>

<body class="font-montserrat bg-[#110B33]">
<div class="relative flex items-center justify-center lg:mb-[22px] md:mb-[33px] sm:mb-[35px] mt-[5%] px-[30%]">
<.link target="_blank" href="https://optimum.ba">
<SharedComponents.optimum_logo />
</.link>
</div>

<body class="bg-[#110A33] mx-auto sm:px-2 md:px-7 lg:w-9/12 sm:py-8">
<%= @inner_content %>
</body>
</html>
72 changes: 0 additions & 72 deletions lib/phx_tools_web/components/shared_compoents.ex

This file was deleted.

2 changes: 1 addition & 1 deletion lib/phx_tools_web/live/live_session_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule PhxToolsWeb.LiveSessionHelper do
%{"operating_system" => "Linux"}

"Mac" ->
%{"operating_system" => "Mac"}
%{"operating_system" => "macOS"}

_other ->
%{"operating_system" => operating_system}
Expand Down
Loading
Loading