Svelte! #2

Manually merged
MiniJack merged 6 commits from svelte into master 2020-08-20 05:57:50 -04:00
15 changed files with 45 additions and 486 deletions
Showing only changes of commit f4167ba9d4 - Show all commits

View File

@ -1,84 +1,42 @@
<script>
export let segment;
export let rightComponent;
export let segment;
export let rightComponent;
</script>
<style>
nav {
border-bottom: 1px solid rgba(255, 62, 0, 0.1);
font-weight: 300;
flex-flow: row nowrap;
position: relative;
justify-content: flex-start;
width: 100%;
margin-right: auto;
margin-left: auto;
}
ul {
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
align-items: flex-start;
}
/* clearfix */
ul::after {
content: '';
display: inline-block;
clear: both;
}
li {
font-size: 1rem;
text-align: center;
padding: 5px;
box-sizing: border-box;
list-style: none;
}
[aria-current] {
position: relative;
display: inline-block;
}
[aria-current]::after {
position: absolute;
content: '';
width: calc(100% - 1em);
height: 2px;
background-color: rgb(255, 62, 0);
display: block;
bottom: -1px;
}
a {
color: #CC99FF;
text-decoration: none;
padding: 1em 0.5em;
display: block;
}
/*
/*
.right {
margin-left: auto;
align-self: flex-end !important;
}
*/
a {
font-size: 1rem;
text-align: center;
}
</style>
<header>
<div class="container">
<nav class="navbar navbar-expand-md">
<div class="navbar-collapse order-1 order-md-0 dual-collapse2">
<ul class="navbar-nav mr-auto">
<li><a aria-current="{segment === undefined ? 'page' : undefined}" href=".">Quartznet</a></li>
<li><a aria-current="{segment === 'about' ? 'page' : undefined}" href="about">About</a></li>
<nav>
<ul>
<li><a aria-current="{segment === undefined ? 'page' : undefined}" href=".">Quartznet</a></li>
<li><a aria-current="{segment === 'about' ? 'page' : undefined}" href="about">About</a></li>
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
the blog data when we hover over the link or tap it on a touchscreen -->
<li><a rel=prefetch aria-current="{segment === 'blog' ? 'page' : undefined}" href="blog">Blog</a></li>
<li class="right">
<svelte:component this={rightComponent}/>
</li>
</ul>
</nav>
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
the blog data when we hover over the link or tap it on a touchscreen -->
<li><a rel=prefetch aria-current="{segment === 'blog' ? 'page' : undefined}" href="blog">Blog</a>
</li>
</ul>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li>
<svelte:component this={rightComponent}/>
</li>
</ul>
</div>
</nav>
</div>
</header>

View File

@ -3,77 +3,28 @@
</script>
<style>
body {
font-family: 'Open Sans', sans-serif;
font-display: swap;
font-size: 1rem;
line-height: 1.8;
margin-top: 0;
}
.description {
margin-bottom: .5rem;
font-family: inherit;
font-weight: 500;
line-height: 1.2;
}
.overlay {
display: flex;
background-image: url("/bluenebula.webp");
background-image: url("/img/bluenebula.webp");
background-size: cover;
background-position: center;
min-height: 200px;
text-align: center;
align-items: center;
justify-content: center;
width: 100%;
}
.title {
display: inline-block;
font-size: 3rem;
text-decoration: none;
font-family: "Open Sans", sans-serif;
font-weight: 500;
margin-bottom: 0.5rem;
margin-top: 0px;
}
main {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
margin-top: 30px;
display: block;
box-sizing: border-box;
}
.description p {
margin-top: 0;
margin-bottom: 1rem;
box-sizing: border-box;
font-size: 1rem;
font-weight: 400;
}
h5 {
color: var(--headings-color);
}
@media (min-width: 640px) {
main {
max-width: none;
}
}
</style>
<div class="overlay">
<div class="description">
<div class="description col-md-5">
<h1 class="title">{title}</h1>
<p>Software, Games, Science, Space!</p>
</div>

View File

@ -7,70 +7,16 @@
</script>
<style>
.row {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
box-sizing: border-box;
}
.thumb {
flex: 0 0 58.333333%;
max-width: 58.333333%;
position: relative;
width: 100%;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
box-sizing: border-box;
}
.blurb {
flex: 0 0 41.666667%;
max-width: 41.666667%;
position: relative;
width: 100%;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
box-sizing: border-box;
}
h2 {
font-size: 2rem;
margin-bottom: .5rem;
font-family: inherit;
font-weight: 500;
line-height: 1.2;
margin-top: 0;
box-sizing: border-box;
}
a {
color: #CC99FF;
text-decoration: none;
background-color: transparent;
}
img {
margin-bottom: 0 !important;
max-width: 100%;
height: auto;
vertical-align: middle;
border-style: none;
box-sizing: border-box;
}
</style>
<div class="row">
<div class="thumb">
<div class="thumb col-md-7">
<a href="{name}">
<img class={imgClass} {src} alt={name}>
</a>
</div>
<div class="blurb">
<div class="blurb col-md-5">
<h2>{name}</h2>
<p>{description}</p>
</div>

View File

@ -5,17 +5,15 @@
<style>
img {
display: inline-block;
position: relative;
width: 100%;
height: 100%;
margin: 0 auto;
padding: .2rem;
}
a {
position: relative;
right: 50%;
display: inline-block;
height: 100%;
}
</style>

View File

@ -16,42 +16,6 @@
box-sizing: border-box;
}
/* Default theme */
:global(:root) {
--background-color: #222222;
--headings-color: #ffffff;
--font-color: #ffffff;
--blue: #007bff;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
--red: #dc3545;
--orange: #fd7e14;
--yellow: #ffc107;
--green: #28a745;
--teal: #20c997;
--cyan: #17a2b8;
--white: #fff;
--gray: #6c757d;
--gray-dark: #343a40;
--primary: #007bff;
--secondary: #6c757d;
--success: #28a745;
--info: #17a2b8;
--warning: #ffc107;
--danger: #dc3545;
--light: #f8f9fa;
--dark: #343a40;
--breakpoint-xs: 0;
--breakpoint-sm: 576px;
--breakpoint-md: 768px;
--breakpoint-lg: 992px;
--breakpoint-xl: 1200px;
--font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
/* Dark theme */
:global(html[data-theme='dark']) {
--background-color: #222222;
@ -67,8 +31,10 @@
color: var(--font-color);
box-sizing: border-box;
}
</style>
</style>
<Nav {segment} rightComponent={userManager}/>
<slot></slot>

View File

@ -34,84 +34,19 @@
<main class="container">
<section>
{#each games as game}
<!-- Project One -->
<Thumb {...game}/>
{/each}
</section>
</main>
<style>
section {
display: block;
border-radius: 5px;
padding: 5px 20px;
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
font-size: 1rem;
line-height: 1.8;
font-weight: 400;
text-align: left;
border-radius: 5px;
padding: 5px 20px;
}
body {
font-family: 'Open Sans', sans-serif;
font-display: swap;
font-size: 1rem;
line-height: 1.8;
margin-top: 0;
}
main {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
margin-top: 30px;
display: block;
box-sizing: border-box;
}
.description p {
margin-top: 0;
margin-bottom: 1rem;
box-sizing: border-box;
font-size: 1rem;
font-weight: 400;
}
h5 {
color: var(--headings-color);
}
@media (min-width: 768px) {
.container {
max-width: 720px
}
}
@media (min-width: 992px) {
.container {
max-width: 960px
}
}
@media (min-width: 1200px) {
.container {
max-width: 1140px
}
}
@media (min-width: 640px) {
main {
max-width: none;
}
}
</style>

View File

@ -7,11 +7,11 @@
%sapper.base%
<link rel="stylesheet" href="/global.css">
<link rel="stylesheet" href="/bootstrap.min.css">
<link rel="stylesheet" href="/themes.css">
<link rel="stylesheet" href="/css/global.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/themes.css">
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="icon" type="image/png" href="/img/favicon.ico">
<!-- Sapper creates a <script> tag containing `src/client.js`
and anything else it needs to hydrate the app and

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -1,141 +0,0 @@
body {
font-family: 'Open Sans', sans-serif;
font-display: swap;
font-size: 1rem;
line-height: 1.8;
}
.overlay {
display: flex;
background-image: url("/bluenebula.webp");
background-size: cover;
background-position: center;
min-height: 200px;
text-align: center;
align-items: center;
justify-content: center;
}
.title {
display: inline-block;
font-size: 3rem;
text-decoration: none;
}
nav {
align-items: center;
display: flex;
flex-direction: row;
justify-content: space-between;
}
/* flexbox navbar test*/
nav ul {
display: flex;
padding: 0;
margin: 0;
}
nav ul li {
font-size: 1rem;
text-align: center;
padding: 5px;
}
nav li {
list-style-type: none;
}
/* Change color on hover */
nav li a {
margin-left: 20px;
margin-right: 20px;
text-decoration: none;
}
main {
margin-top: 30px;
}
/* Content types */
section {
border-radius: 5px;
padding: 5px 20px;
}
/*Simple css to style it like a toggle switch*/
.theme-switch-wrapper {
display: flex;
align-items: center;
}
.theme-switch {
display: inline-block;
height: 24px;
position: relative;
width: 40px;
}
.theme-switch input {
display: none;
}
.slider {
background-color: #ccc;
bottom: 0;
cursor: pointer;
left: 0;
position: absolute;
right: 0;
top: 0;
transition: .2s;
}
.slider:before {
background-color: #fff;
bottom: 4px;
content: "";
height: 16px;
left: 4px;
position: absolute;
transition: .2s;
width: 16px;
}
input:checked + .slider {
background-color: #66bb6a;
}
input:checked + .slider:before {
transform: translateX(16px);
}
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
/* Responsive layout - when the screen is less than 700px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 700px) {
.title {
display: block;
text-align: center;
}
nav {
flex-direction: column;
}
nav ul {
flex-direction: column;
margin: 0 auto;
}
nav ul li a {
text-align: center;
margin: 0 auto;
}
}

View File

@ -1,43 +0,0 @@
/* Default theme */
:root {
--background-color: #222222;
--headings-color: #ffffff;
--font-color: #ffffff;
}
/* Dark theme */
html[data-theme='dark'] {
--background-color: #222222;
--headings-color: #ffffff;
--font-color: #ffffff;
}
body {
background-color: var(--background-color);
color: var(--font-color);
}
h1, h2, h3, h4, h5 {
color: var(--headings-color);
}
hr {
background-color: #eeeeee;
}
.overlay {
border-bottom: 2px solid #eeeeee;
}
li a:hover {
border-bottom: 3px solid white;
text-decoration: none;
}
a {
color: #CC99FF;
}
a:hover {
color: white;
}

View File

@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>