Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
weihsinyeh committed Mar 26, 2024
1 parent e5b7c2a commit 8aca6fa
Show file tree
Hide file tree
Showing 11 changed files with 325 additions and 305 deletions.
100 changes: 100 additions & 0 deletions css/new.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
@property --k {
syntax: '<number>';
initial-value: 0;
inherits: false
}

html, body { display: grid }
body {
padding: 25px;
background-color: white;
color: black;
font-size: 25px;
}

.dark-mode {
background-color: black;
color: white;
}
html { height: 100% }

body { background: #000 }

svg[height='0'] { position: absolute }



h1 { /* no pseudo needed */
--k: 0;
place-self: center;
background:
linear-gradient(90deg,
hsl(calc(var(--k)*1turn), 95%, 65%),
hsl(calc(var(--k)*1turn + 90deg), 95%, 65%));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font: 900 clamp(.875em, 7.25vw, 5em) arial black, sans-serif;
font-size: 100px;
filter: url(#f);
text-align: center;
text-transform: uppercase;
/* needs support for animating custom properties */
/* Firefox not quite there yet, but it's coming */
animation: k 4s linear infinite
}
h3 { /* no pseudo needed */
--k: 0;
place-self: center;
background:
linear-gradient(90deg,
hsl(calc(var(--k)*1turn), 95%, 65%),
hsl(calc(var(--k)*1turn + 90deg), 95%, 65%));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font: 900 clamp(.875em, 7.25vw, 5em) arial black, sans-serif;
font-size: 32px;
filter: url(#f);
text-align: center;
/* needs support for animating custom properties */
/* Firefox not quite there yet, but it's coming */
animation: k 4s linear infinite
}
h2 { /* no pseudo needed */
--k: 0;
place-self: center;
background:
linear-gradient(90deg,
hsl(calc(var(--k)*1turn), 95%, 65%),
hsl(calc(var(--k)*1turn + 90deg), 95%, 65%));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font: 900 clamp(.875em, 7.25vw, 5em) arial black, sans-serif;
font-size: 32px;
filter: url(#f);
text-align: center;
/* needs support for animating custom properties */
/* Firefox not quite there yet, but it's coming */
animation: k 4s linear infinite
}
p { /* no pseudo needed */
--k: 0;
place-self: center;
background:
linear-gradient(90deg,
hsl(calc(var(--k)*1turn), 95%, 65%),
hsl(calc(var(--k)*1turn + 90deg), 95%, 65%));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font: 900 clamp(.875em, 7.25vw, 5em) arial black, sans-serif;
font-size: 32px;
filter: url(#f);
text-align: center;
/* needs support for animating custom properties */
/* Firefox not quite there yet, but it's coming */
animation: k 4s linear infinite
}
@keyframes k { to { --k: 1 } }
55 changes: 55 additions & 0 deletions css/new2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body {
margin: 0;
background-color: black;
}

#carousel {
perspective: 1000px;
overflow: hidden;
}
#carousel #scene {
width: 42%;
margin: 40px auto 0 auto;
transform-style: preserve-3d;
transition: transform 0.5s;
}
#carousel #scene .carousel_item {
width: 100%;
box-sizing: border-box;
padding: 0 20px 0 10px;
backface-visibility: hidden;
}
#carousel #scene .carousel_item:not(:first-of-type) {
position: absolute;
left: 0;
top: 0;
}
#carousel #carousel_btn {
width: 100px;
margin: 20px auto 0 auto;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}
#carousel #carousel_btn .btn {
width: 45px;
height: 45px;
line-height: 40px;
padding-left: 7px;
box-sizing: border-box;
border-radius: 50%;
float: left;
border: 2px solid #2f2f2f;
color: #2f2f2f;
font-family: sans-serif;
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
}
#carousel #carousel_btn .btn:hover {
color: #ffffff;
background-color: #2f2f2f;
}
#carousel #carousel_btn > div:first-child {
margin-right: 10px;
}/*# sourceMappingURL=new2.css.map */
1 change: 1 addition & 0 deletions css/new2.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions css/new2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
body {
margin: 0;
background-color: black;
}

// Configuration parameters
// Define width of individual slide (% or px)
$slide-width: 42%;

// Define gap between the slides
$slide-separation: 40px;

$distance: 1000px;

#carousel {
perspective: $distance;
overflow: hidden;

#scene {
width: $slide-width;
margin: 40px auto 0 auto;
transform-style: preserve-3d;
transition: transform 0.5s;

.carousel_item {
width: 100%;
box-sizing: border-box;
padding: 0 ($slide-separation / 2) 0 ($slide-separation / 4);
backface-visibility: hidden;
&:not(:first-of-type) {
position: absolute;
left: 0;
top: 0;
}
}
}

#carousel_btn {
width: 100px;
margin: 20px auto 0 auto;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

#carousel_btn .btn {
width: 45px;
height: 45px;
line-height: 40px;
padding-left: 7px;
box-sizing: border-box;
border-radius: 50%;
float: left;
border: 2px solid #2f2f2f;
color: #2f2f2f;
font-family: sans-serif;
font-size: 14px;
cursor: pointer;
transition: all 0.3s;
}

#carousel_btn .btn:hover {
color: #ffffff;
background-color: #2f2f2f;
}

#carousel_btn > div:first-child {
margin-right: 10px;
}
}

Loading

0 comments on commit 8aca6fa

Please sign in to comment.