mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Improved user interface of the examples page (#504)
* Added card components for basic examples * Added card components for mime rendering * fix anchor tag inside anchor tag * Added card components for js interaction * Added card components for visualizations e dashboards * Refactor card components responsive * Fix href Fractals with NumPy and canvas * Refactor quote format * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added css files * Refactor card components for basic examples * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename global file to main * Add css variables * Refactor card components * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor move css files into css folder Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
51
examples/assets/css/index.css
Normal file
51
examples/assets/css/index.css
Normal file
@@ -0,0 +1,51 @@
|
||||
.example {
|
||||
margin-bottom: 5rem;
|
||||
}
|
||||
|
||||
.example h2{
|
||||
color: #000000;
|
||||
font-family: "Inconsolata", monospace;
|
||||
font-size: 2.25rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
height: 15rem;
|
||||
background-color: #FFFFFF;
|
||||
padding: 1rem;
|
||||
-webkit-box-shadow: var(--card-shadow);
|
||||
box-shadow: var(--card-shadow);
|
||||
}
|
||||
|
||||
.card a h2 {
|
||||
color: var(--color-primary);
|
||||
margin: 0;
|
||||
font-family: "Inconsolata", monospace;
|
||||
font-size: 2.25rem;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.container-card {
|
||||
max-width: 1500px;
|
||||
margin: 0 auto;
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.container-card {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.container-card {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
17
examples/assets/css/main.css
Normal file
17
examples/assets/css/main.css
Normal file
@@ -0,0 +1,17 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap");
|
||||
@import "./variables.css";
|
||||
@import "./reset.css";
|
||||
|
||||
.container {
|
||||
max-width: 1510px;
|
||||
margin: auto;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
|
||||
.title-main {
|
||||
color: #000000;
|
||||
font-size: 4.25rem;
|
||||
font-family: "Inconsolata", monospace;
|
||||
text-align: center;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
22
examples/assets/css/reset.css
Normal file
22
examples/assets/css/reset.css
Normal file
@@ -0,0 +1,22 @@
|
||||
*,
|
||||
*:after,
|
||||
*:before {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 100%;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: "Inconsolata", monospace;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
4
examples/assets/css/variables.css
Normal file
4
examples/assets/css/variables.css
Normal file
@@ -0,0 +1,4 @@
|
||||
:root {
|
||||
--color-primary: #2563eb;
|
||||
--card-shadow: 0px 5px 11px 0px rgb(0 0 0 / 15%);
|
||||
}
|
||||
@@ -1,106 +1,290 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>PyScript demo</title>
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="./assets/css/main.css" />
|
||||
<link rel="stylesheet" href="./assets/css/index.css" />
|
||||
</head>
|
||||
|
||||
<title>PyScript demo</title>
|
||||
<body class="container">
|
||||
<h1 class="title-main">PyScript demos</h1>
|
||||
<section class="example">
|
||||
<h2>Basic examples</h2>
|
||||
<div class="container-card">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./hello_world.html" target="_blank">
|
||||
<h2>Hello world</h2>
|
||||
</a>
|
||||
<p>
|
||||
A static demo of the <code><py-script></code> tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon.png" />
|
||||
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
|
||||
</head>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./simple_clock.html" target="_blank">
|
||||
<h2>Simple clock</h2>
|
||||
</a>
|
||||
<p>
|
||||
A dynamic demo of the <code><py-script></code> tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<body class="container font-mono">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./repl.html" target="_blank">
|
||||
<h2>REPL</h2>
|
||||
</a>
|
||||
<p>
|
||||
A Python REPL (Read Eval Print Loop).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 class="text-4xl font-bold">PyScript demos</h1>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./repl2.html" target="_blank">
|
||||
<h2>REPL2</h2>
|
||||
</a>
|
||||
<p>
|
||||
A Python REPL (Read Eval Print Loop) with slightly better formatting..
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<h2 class="text-3xl font-bold">Basic examples</h2>
|
||||
<hr/>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./todo.html" target="_blank">
|
||||
<h2>TODO App</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demo showing how would a Simple TODO App would look like in PyScript</code> tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./hello_world.html" target=”_blank”>Hello world</a></h2>
|
||||
<p>A static demo of the <code><py-script></code> tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./todo-pylist.html" target="_blank">
|
||||
<h2>PyScript Native TODO App</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demo showing how would a Simple TODO App would look like in PyScript</code> tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./simple_clock.html" target=”_blank”>Simple clock</a></h2>
|
||||
<p>A dynamic demo of the <code><py-script></code> tag</p>
|
||||
<section class="example">
|
||||
<h2>MIME Rendering</h2>
|
||||
<div class="container-card">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./matplotlib.html" target="_blank">
|
||||
<h2>Matplotlib</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demonstrates rendering <a href="https://matplotlib.org/" target="_blank">Matplotlib</a> figure as output of the py-script tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./repl.html" target=”_blank”>REPL</a></h2>
|
||||
<p>A Python REPL (Read Eval Print Loop). </p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./altair.html" target="_blank">
|
||||
<h2>
|
||||
Altair
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demonstrates rendering <a href="https://altair-viz.github.io/" target="_blank">Altair</a> plot as output of the py-script tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./repl2.html" target=”_blank”>REPL2</a></h2>
|
||||
<p>A Python REPL (Read Eval Print Loop) with slightly better formatting.</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./folium.html" target="_blank">
|
||||
<h2>
|
||||
Folium
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demonstrates rendering
|
||||
<a href="https://python-visualization.github.io/folium/" target="_blank">Folium</a>
|
||||
map as output of the py-script tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./todo.html" target=”_blank”>TODO App</a></h2>
|
||||
<p>Demo showing how would a Simple TODO App would look like in PyScript</code> tag</p>
|
||||
<section class="example">
|
||||
<h2>JS Interaction</h2>
|
||||
<div class="container-card">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./d3.html" target="_blank">
|
||||
<h2>
|
||||
Simple d3 visualization
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Minimal <a href="https://d3js.org/" target="_blank">D3</a>
|
||||
demo demonstrating how to create a visualization
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./todo-pylist.html" target=”_blank”>PyScript Native TODO App</a></h2>
|
||||
<p>Demo showing how would a Simple TODO App would look like only using PyScript native elements</code> tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./webgl/raycaster/index.html" target="_blank">
|
||||
<h2>
|
||||
Webgl Icosahedron Example
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Demo showing how a Simple <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API" target="_blank">WebGL</a>
|
||||
scene would work in PyScript</code> tag
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<br>
|
||||
<h2 class="text-3xl font-bold">MIME Rendering</h2>
|
||||
<hr/>
|
||||
<section class="example">
|
||||
<h2>Visualizations & Dashboards</h2>
|
||||
<div class="container-card">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./bokeh.html" target="_blank">
|
||||
<h2>
|
||||
Simple Static Bokeh Plot
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Minimal Bokeh demo demonstrating how to create a simple
|
||||
<a href="https://bokeh.org/" target="_blank">Bokeh</a>
|
||||
plot from code
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./matplotlib.html" target=”_blank”>Matplotlib</a></h2>
|
||||
<p>Demonstrates rendering <a href="https://matplotlib.org/" class="text-blue-600" target=”_blank”>Matplotlib</a> figure as output of the py-script tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./bokeh_interactive.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
Bokeh Interactive
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Interactive demo using a
|
||||
<a href="https://bokeh.org/" target="_blank">Bokeh</a>
|
||||
slider widget to dynamically change a value in the page
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./altair.html" target=”_blank”>Altair</a></h2>
|
||||
<p>Demonstrates rendering <a href="https://altair-viz.github.io/" class="text-blue-600" target=”_blank”>Altair</a> plot as output of the py-script tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./panel_kmeans.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
KMeans Demo in Panel
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Interactive KMeans Chart using
|
||||
<a href="https://panel.holoviz.org/" target="_blank">Panel</a>
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./folium.html" target=”_blank”>Folium</a></h2>
|
||||
<p>Demonstrates rendering <a href="https://python-visualization.github.io/folium/" class="text-blue-600" target=”_blank”>Folium</a> map as output of the py-script tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./panel_stream.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
Streaming Demo in Panel
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Interactive Streaming Table and Bokeh plot using
|
||||
<a href="https://panel.holoviz.org/" target="_blank">Panel</a>
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<h2 class="text-3xl font-bold">JS Interaction</h2>
|
||||
<hr/>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./panel.html" target="_blank">
|
||||
<h2 class="text-3xl font-bold text-blue-600">
|
||||
Simple Panel Demo
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Simple demo showing
|
||||
<a href="https://panel.holoviz.org/" target="_blank">Panel</a>
|
||||
widgets interacting with parts of the page
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./d3.html" target=”_blank”>Simple d3 visualization</a></h2>
|
||||
<p>Minimal <a href="https://d3js.org/" class="text-blue-600" target=”_blank”>D3</a> demo demonstrating how to create a visualization</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./panel_deckgl.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
NYC Taxi Data Panel DeckGL Demo
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Interactive application exploring the NYC Taxi dataset using
|
||||
<a href="https://panel.holoviz.org/" target="_blank">Panel</a> and <a href="https://deck.gl/" target="_blank">DeckGL</a>
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./webgl/raycaster/index.html" target=”_blank”>Webgl Icosahedron Example</a></h2>
|
||||
<p>Demo showing how a Simple <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API" class="text-blue-600" target=”_blank”>WebGL</a> scene would work in PyScript</code> tag</p>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./toga/freedom.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
Freedom Units!
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
A <a href="https://beeware.org/project/projects/libraries/toga/" target="_blank">Toga</a>
|
||||
application (a Fahrenheit to Celsius converter), rendered as a Single Page App
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
<h2 class="text-3xl font-bold">Visualizations & Dashboards</h2>
|
||||
<hr/>
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./bokeh.html" target=”_blank”>Simple Static Bokeh Plot</a></h2>
|
||||
<p>Minimal Bokeh demo demonstrating how to create a simple <a href="https://bokeh.org/" class="text-blue-600" target=”_blank”>Bokeh</a> plot from code</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./bokeh_interactive.html" target=”_blank”>Bokeh Interactive</a></h2>
|
||||
<p>Interactive demo using a <a href="https://bokeh.org/" class="text-blue-600" target=”_blank”>Bokeh</a> slider widget to dynamically change a value in the page
|
||||
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./panel_kmeans.html" target=”_blank”>KMeans Demo in Panel</a></h2>
|
||||
<p>Interactive KMeans Chart using <a href="https://panel.holoviz.org/" class="text-blue-600" target=”_blank”>Panel</a>
|
||||
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./panel_stream.html" target=”_blank”>Streaming Demo in Panel</a></h2>
|
||||
<p>Interactive Streaming Table and Bokeh plot using <a href="https://panel.holoviz.org/" class="text-blue-600" target=”_blank”>Panel</a>
|
||||
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./panel.html" target=”_blank”>Simple Panel Demo</a></h2>
|
||||
<p>Simple demo showing <a href="https://panel.holoviz.org/" class="text-blue-600" target=”_blank”>Panel</a> widgets interacting with parts of the page
|
||||
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./panel_deckgl.html" target=”_blank”>NYC Taxi Data Panel DeckGL Demo</a></h2>
|
||||
<p>Interactive application exploring the NYC Taxi dataset using <a href="https://panel.holoviz.org/" class="text-blue-600" target=”_blank”>Panel</a> and <a href="https://deck.gl/" class="text-blue-600" target=”_blank”>DeckGL</a>
|
||||
|
||||
WARNING: This examples takes a little longer to load. So be patient :)
|
||||
</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./toga/freedom.html" target=”_blank”>Freedom Units!</a></h2>
|
||||
<p>A <a href="https://beeware.org/project/projects/libraries/toga/" class="text-blue-600" target=”_blank”>Toga</a> application (a Fahrenheit to Celsius converter), rendered as a Single Page App</p>
|
||||
|
||||
<h2 class="text-2xl font-bold text-blue-600"><a href="./numpy_canvas_fractals.html" target=”_blank”>Fractals with NumPy and canvas</a></h2>
|
||||
<p>Visualization of Mandelbrot and Julia sets with <a href="https://numpy.org/" class="text-blue-600" target=”_blank”>Numpy</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API" class="text-blue-600" target=”_blank”>HTML5 canvas</a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<a href="./numpy_canvas_fractals.html" target="_blank">
|
||||
<h2 class="text-2xl font-bold text-blue-600">
|
||||
Fractals with NumPy and canvas
|
||||
</h2>
|
||||
</a>
|
||||
<p>
|
||||
Visualization of Mandelbrot and Julia sets with
|
||||
<a href="https://numpy.org/" target="_blank">Numpy</a> and
|
||||
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API" target="_blank">
|
||||
HTML5 canvas
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user