Skip to content

Commit

Permalink
np.Shared and plugin-test updates for styling
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertheimer committed Oct 19, 2023
1 parent 2e0ab94 commit 0b8e119
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 154 deletions.
4 changes: 4 additions & 0 deletions np.Shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

See [Shared Plugin's README](https://github.com/NotePlan/plugins/blob/main/np.Shared/README.md) for details on this plugin.

## [0.4.6] - 2023-10-16 @dwertheimer

- update to remove CSS from React Windows if wanted

## [0.4.5] - 2023-10-16 @dwertheimer

- updates to React tooling using ShowHTMLV2 etc.
Expand Down
2 changes: 1 addition & 1 deletion np.Shared/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"noteplan.minAppVersion": "3.8.0",
"plugin.id": "np.Shared",
"plugin.name": "🤝 Shared Resources",
"plugin.version": "0.4.5",
"plugin.version": "0.4.6",
"plugin.description": "Shared resources for NotePlan plugins. (There are no commands for users to run directly.)",
"plugin.author": "jgclark + dwertheimer",
"plugin.dependencies": [],
Expand Down
2 changes: 1 addition & 1 deletion np.Shared/src/NPReactLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function openReactWindow(globalData: any = null, windowOptions?: HtmlWind

const reactRootComponent = `<script type="text/javascript" src="../np.Shared/react.c.Root.min.js"></script>`
const generatedOptions = {
includeCSSAsJS: true,
includeCSSAsJS: windowOptions.includeCSSAsJS === false ? false : true,
headerTags: `${[cssTags].join('\n')}${windowOptions.headerTags || ''}` /* needs to be a string */,
preBodyScript: addStringOrArrayItems(
[pluginToHTMLCommsBridge, ENV_MODE === 'development' ? ReactDevToolsImport : '', ENV_MODE === 'production' ? reactJSmin : reactJSDev, globalSharedDataScriptStr],
Expand Down
2 changes: 1 addition & 1 deletion np.plugin-test/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"plugin.name": "🔌 Plugin Information & Tester",
"plugin.description": "View Plugin Commands and Test that Plugins are working.",
"plugin.author": "@dwertheimer",
"plugin.version": "1.4.0-beta5",
"plugin.version": "1.4.0-beta6",
"plugin.lastUpdateInfo": "1.4.0-betaX: The beginning of a searchable plugin repository",
"plugin.dependencies": [],
"plugin.requiredFiles": [
Expand Down
316 changes: 174 additions & 142 deletions np.plugin-test/requiredFiles/css.plugin.css
Original file line number Diff line number Diff line change
@@ -1,168 +1,200 @@
/* Plugin-specific CSS */
/* This file is loaded last to override any other CSS */
/* It's a file rather than baked into the plugin to make fast editing/visual changes easier */
body { }

element.style {
margin-top: 0px;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0px;
font-weight: 500;
line-height: 1.2;
}
h3 {
background-color: beige;
font-size: 1.4rem;
margin-left: -10px;
padding-left: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.monospace { font-family: 'ui-monospace'; }
.monospaceData { font-family: 'ui-monospace'; font-size: 10px; white-space: pre-wrap }
/* loading spinner */
.loading {
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
border-radius: 100%;
height: 6em;
width: 6em;
background-color: black;
}

.loading-text {
padding-left: 20px;
}

html, body {
max-width: 100vw;
overscroll-behavior-y: none;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.5;
color: #333;
background: linear-gradient(to right, #ffffff, #f2f2f2);
overscroll-behavior-y: none; /* remove spring effect */
/* background-color: #f4f4f4; */
}

.container {
padding: 1rem;
display: flex;
flex-wrap: wrap;
height: 100vh;
width: 100vw;
max-width: 100vw;
padding-left: 0px; /* edge to edge */
padding-right: 0px;
/* align-items: center; */ /* vertical */
justify-content: center; /* horizontal */
}
.sticky {
background: linear-gradient(to bottom, #f0b785,#ffffff);
/* background-color: #f0b785; */
border-bottom: 2px solid #e0e0e0; /* increase border thickness for distinction */
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1); /* add a subtle shadow for depth */
padding: 15px 20px; /* increase padding for a better look */
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 100;
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 0;
}

@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1.0);
opacity: 0;
transform: scale(1.0);
}
}
select, input[type="text"] {
height: 30px;
padding: 5px 10px;
background-color: #fff;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
margin-right: 10px;
box-sizing: border-box;
transition: border-color 0.3s ease; /* added transition for a smooth hover effect */
}

@font-face {
font-family: "noteplanstate";
src: url('../np.Shared/noteplanstate-edited.otf') format('truetype');
}
select {
padding-right: 10px; /* To ensure the text doesn't overlap the dropdown arrow */
background-repeat: no-repeat;
background-position: right center;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEA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lmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC);
}

.noteplanstate {
font-family: "noteplanstate";
}
select:hover, input[type="text"]:hover {
border-color: #666;
transform: scale(1.02); /* scales the element slightly on hover */
transition: transform 0.3s ease;
}

.fa-icon {
font-family: "FontAwesome6Pro-Regular";
}
select:focus, input[type="text"]:focus {
border-color: #007BFF;
box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

.PluginListingPage {
padding-top: 25px;
}
.sticky:hover {
transition: transform 0.3s ease;
}

.plugin-section {
padding: 10px;
padding-top: 0px;
}
/* Modify select arrow styles for better visibility */
select:after {
content: "▼";
position: absolute;
top: -83%;
right: 6%;
bottom: 0;
font-size: 60%;
line-height: 30px;
padding: 0 10px;
background: #03498A;
color: rgb(255, 255, 255);
height: 40px;
pointer-events: none;
border-radius: 0 6px 6px 0;
}

.pluginName {
}
.PluginListingPage {
max-width: 1200px;
/* margin: 20px auto; */
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 20px;
}

.pluginVersion, .pluginBy, .install, .installed {
margin-left: 5px;
font-size: 12px;
}
.plugin-section {
margin-bottom: 25px;
padding-top: 5px;
padding-left: 20px;
padding-bottom: 10px; /* Increased padding for top and bottom */
border-radius: 5px;
transition: background-color 0.3s;
border-top: 1px solid #e4e4e4; /* Top border */
border-bottom: 1px solid #e4e4e4; /* Bottom border */
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* subtle shadow for depth */
}

.pluginAuthor {
margin-left: 2px;
font-size: 12px;
}
.plugin-section:hover {
background-color: #f9f9f9;
}

.installed {
color: green;
}

.install {
color: blue;
}
.pluginName {
font-size: 1.5rem;
font-weight: bold;
color: #444;
}

.updateIsAvailable {
color: orange;
}
.pluginVersion, .pluginBy, .install, .installed {
margin-left: 15px;
font-size: 0.9rem;
color: #777;
}

.updateIsAvailable {
color: #e74c3c;
font-weight: bold;
}

.pluginAuthor {
font-size: 1.0rem;
font-style: italic;
color: #555;
}

table.w3-table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}

table.w3-table th, table.w3-table td {
border: 1px solid #e0e0e0;
padding: 8px 12px;
}

table.w3-table thead {
background-color: #f2f2f2;
}

.lastUpdate {
.noPluginsFound {
text-align: center;
padding: 30px 0;
color: #999;
}

.noPluginsFound h3 {
font-size: 1.6rem;
}

.noPluginsFound a {
color: #3498db;
text-decoration: none;
}

.noPluginsFound a:hover {
text-decoration: underline;
}


/* Making the sticky header responsive */

@media (max-width: 768px) {
.sticky select, .sticky input[type="text"], .plugin-title, .plugin-description {
color: #333; /* Making text darker */
font-weight: bold; /* Adding boldness for better visibility */
}

.aboutPlugin {
.PluginListingPage .command, .PluginListingPage .description {
padding: 5px 10px; /* Reducing the padding to decrease the gray box size */
background-color: #f6f6f6; /* Slightly lighter gray for better contrast */
}

.PluginListingPage .plugin-title, .PluginListingPage .plugin-description {
margin-top: 5px; /* Adjusting margin for better spacing */
margin-bottom: 5px; /* Adjusting margin for better spacing */
}

.sticky {
width: 100vw;
position: fixed;
top: 0;
z-index: 100; /* optional: to ensure the div stays on top of other elements */
display: flex;
justify-content: flex-start;
padding-right: '20px;
flex-wrap: wrap; /* allow to wrap on phone */
flex-direction: column;
align-items: flex-start;
padding-top: 10px;
padding-bottom: 5px;
}

select, input[type="text"] {
width: 90%;
max-width: 90%;
margin-bottom: 5px;
}

.PluginListingPage {
margin-top: 5px; /* Increased margin to ensure space for the extended sticky header */
}

/**
* Responsive
* for phones
*/

@media only screen and (min-width: 375px)
and (max-width: 767px) {
.container {
padding-left: 0px; /* edge to edge */
padding-right: 0px; }

h1 {
font-size: 1.5rem;
}

.button {
padding: 0.5rem 1rem;
font-size: 0.875rem;
}

.sticky {
position: fixed;
top: 0;
z-index: 100;
justify-content: flex-end;
padding-top: 5px;
padding-right: 40px; /* make room for X */
flex-wrap: wrap; /* allow to wrap on phone */
}

.PluginListingPage {
margin-top: 75px;
}
}
}
2 changes: 2 additions & 0 deletions np.plugin-test/src/pluginCommandsPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export async function openReactPluginCommandsWindow() {
savedFilename: `../../${pluginJson['plugin.id']}/savedOutput.html` /* for saving a debug version of the html file */,
headerTags: cssTagsString,
windowTitle: `Plugin Commands`,
includeCSSAsJS: false /* don't want CSS because we are doing this page non-themed */,
generalCSSIn: ' ' /* don't want CSS because we are doing this page non-themed, needs to be non '' */,
}
logDebug(`===== testReactWindow Calling React after ${timer(data.startTime || new Date())} =====`)
logDebug(pluginJson, `testReactWindow invoking window. testReactWindow stopping here. It's all React from this point forward`)
Expand Down
Loading

0 comments on commit 0b8e119

Please sign in to comment.