Skip to content

Commit

Permalink
feat: change the UI theme and dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Parthipan-Natkunam committed Dec 24, 2024
1 parent f676598 commit 1cd212b
Show file tree
Hide file tree
Showing 10 changed files with 475 additions and 65 deletions.
37 changes: 24 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,57 @@
<meta property="og:url" content="https://tools.codedparts.com" />
<meta property="og:description"
content="Make your LinkedIn & BlueSky Posts Prettier" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap"
rel="stylesheet">

<style>
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
font-family: "Source Code Pro", serif;
font-optical-sizing: auto;
font-size: 16px;

color-scheme: dark;
color: rgb(0, 0, 0);
background-color: #242424;
background-color: #dedede;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
color: #0077cc;
text-decoration: none;
}

body, body > * {
margin: 0;
padding: 0;
}
header,
footer {
color: #fff;
color: #020101;
user-select: none;
}
header{
display: flex;
flex-direction: column;
margin: 0.5rem 0 4rem 1rem;
font-size: 0.85rem;
min-width: 250px;
}
header > h1 {
font-size: 0.95rem;
font-size: 1.25rem;
display: inline-block;
}
header > p {
margin: 0;
font-size: 0.95rem;
font-family: monospace;
}
header > h1 > img {
margin-right: 0.25rem;
}

footer{
Expand All @@ -65,9 +76,9 @@
height: 1px;
background-image: linear-gradient(
to right,
rgb(255, 166, 0),
rgba(197, 246, 0, 0.75),
rgba(218, 185, 0, 0.683)
rgb(0, 0, 0),
rgba(58, 73, 0, 0.75),
rgba(94, 80, 0, 0.683)
);
}

Expand All @@ -80,7 +91,7 @@
</head>
<body>
<header>
<h1><img src="./logo.svg" alt="application logo" width=30>Social Text Formatter</h1>
<h1><img src="./logo_inverse.svg" alt="application logo" width=30>Social Text Formatter</h1>
<p>
Make your LinkedIn & BlueSky Posts Prettier
</p>
Expand All @@ -90,7 +101,7 @@ <h1><img src="./logo.svg" alt="application logo" width=30>Social Text Formatter<
</main>
<footer>
<hr id="footer-hr" />
<p>A Tool from <a href="https://codedparts.com">Parthipan</a></p>
<p>A Tool from <b><a href="https://codedparts.com">&lt;Coded Parts/&gt;</a></b></p>
</footer>
<script type="module" src="./src/main.ts"></script>
</body>
Expand Down
300 changes: 300 additions & 0 deletions public/logo_inverse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions src/lib/components/ActionButtons.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
<style>
.button-container {
display: flex;
justify-content: space-around;
position: absolute;
right: -0.55rem;
bottom: -4rem;
justify-content: flex-end;
}
.editor-copy-btn,
.ai-sentiment-btn {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/EditorContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

<style>
.editor-content {
height: 200px;
padding: 1rem;
width: calc(100% - 2px - 2rem);
background: white;
Expand Down
11 changes: 8 additions & 3 deletions src/lib/components/RichTextEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
.writeText(text)
.then(() => {
toast = {
message: "Text copied to clipboard",
message: "Text copied Successfully",
type: "success",
};
})
Expand Down Expand Up @@ -154,12 +154,17 @@

<style>
.editor-container {
background: white;
background: rgba(255, 255, 255, 0.84);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 600px;
max-width: 1200px;
margin: 0 auto;
display: grid;
position: relative;
min-height: calc(100vh - 20rem);
min-width: 256px;
box-shadow: 0px 7px 7px 3px rgba(0, 0, 0, 0.2);
grid-template-rows: 70px 3fr 70px;
}
</style>
112 changes: 69 additions & 43 deletions src/lib/components/ToastNotification.svelte
Original file line number Diff line number Diff line change
@@ -1,50 +1,76 @@
<script>
export let message = '';
export let type = 'success';
let visible = false;
const showToast = () => {
visible = true;
setTimeout(() => {
visible = false;
message = '';
}, 5000);
};
$: if (message) {
showToast();
}
import CheckIcon from "./icons/CheckIcon.svelte";
import CrossIcon from "./icons/CrossIcon.svelte";
import InfoIcon from "./icons/InfoIcon.svelte";
export let message = "";
export let type = "success";
let visible = false;
const showToast = () => {
visible = true;
setTimeout(() => {
visible = false;
message = "";
}, 5000);
};
$: if (message) {
showToast();
}
</script>

{#if visible}
<div class="toast-container">
{#if visible}
<div class="toast {type}">
{message}
<span class="icon">
{#if type === "success"}
<CheckIcon />
{:else if type === "error"}
<CrossIcon />
{:else}
<InfoIcon />
{/if}
</span>
<span class="message">{message}</span>
</div>
{/if}
{/if}
</div>

<style>
.toast {
position: absolute;
top: -4rem;
width: calc(100% - 32px);
padding: 16px;
color: white;
border-radius: 4px;
opacity: 0.9;
z-index: 1000;
font-weight: 500;
text-align: center;
}
.success {
background-color: #48bb78;
}
.error {
background-color: #f56565;
}
.info {
background-color: #4299e1;
}
</style>
.toast-container {
position: absolute;
top: -4rem;
left: 0;
right: 0;
}
.toast {
width: calc(100% - 32px);
padding: 16px;
color: white;
border-radius: 4px;
opacity: 0.9;
z-index: 1000;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.toast > .message {
text-align: center;
}
.success {
background-color: #48bb78;
}
.error {
background-color: #f56565;
}
.info {
background-color: #4299e1;
}
</style>
2 changes: 1 addition & 1 deletion src/lib/components/ToolbarButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<style>
.toolbar-button {
padding: 0.25rem 0.5rem;
padding: 0.25rem 0.75rem;
border: 1px solid #e2e8f0;
background: white;
border-radius: 4px;
Expand Down
22 changes: 22 additions & 0 deletions src/lib/components/icons/CheckIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<svg
width="25px"
height="25px"
stroke-width="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
color="currentColor"
><path
d="M7 12.5L10 15.5L17 8.5"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path></svg
>
22 changes: 22 additions & 0 deletions src/lib/components/icons/CrossIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<svg
width="25px"
height="25px"
stroke-width="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
color="currentColor"
><path
d="M9.17218 14.8284L12.0006 12M14.829 9.17157L12.0006 12M12.0006 12L9.17218 9.17157M12.0006 12L14.829 14.8284"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path></svg
>
28 changes: 28 additions & 0 deletions src/lib/components/icons/InfoIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<svg
width="25px"
height="25px"
stroke-width="1.5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
color="currentColor"
><path
d="M12 11.5V16.5"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M12 7.51L12.01 7.49889"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path><path
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
></path></svg
>

0 comments on commit 1cd212b

Please sign in to comment.