hi
- User
hi
- Assistant
Hello! How can I assist you today?
- User
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
hi
Hello! How can I assist you today?
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
.card {
width: 71.5vw;
height: 100vw;
}
@media screen and (min-width: 600px) {
.card {
width: clamp(12.9vw, 61vh, 18vw);
height: clamp(18vw, 85vh, 25.2vw);
}
}
.card {
position: relative;
overflow: hidden;
margin: 20px;
z-index: 10;
touch-action: none;
border-radius: 5% / 3.5%;
box-shadow:
-5px -5px 5px -5px var(--color1),
5px 5px 5px -5px var(--color2),
-7px -7px 10px -5px transparent,
7px 7px 10px -5px transparent,
0 0 5px 0px rgba(255, 255, 255, 0),
0 55px 35px -20px rgba(0, 0, 0, 0.5);
transition: transform 0.5s ease, box-shadow 0.2s ease;
will-change: transform, filter;
background-color: #040712;
background-image: var(--front);
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
transform-origin: center;
}
.card:hover {
box-shadow:
-20px -20px 30px -25px var(--color1),
20px 20px 30px -25px var(--color2),
-7px -7px 10px -5px var(--color1),
7px 7px 10px -5px var(--color2),
0 0 13px 4px rgba(255, 255, 255, 0.3),
0 55px 35px -20px rgba(0, 0, 0, 0.5);
}
.card.charizard {
--color1: var(--charizard1);
--color2: var(--charizard2);
--front: var(--charizardfront);
}
.card:before,
.card:after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-repeat: no-repeat;
opacity: 0.5;
mix-blend-mode: color-dodge;
transition: all 0.33s ease;
}
.card:before {
background-position: 50% 50%;
background-size: 300% 300%;
background-image: linear-gradient(
115deg,
transparent 0%,
var(--color1) 25%,
transparent 47%,
transparent 53%,
var(--color2) 75%,
transparent 100%
);
filter: brightness(0.5) contrast(1);
z-index: 1;
}
.card:after {
background-image: url("https://assets.codepen.io/13471/sparkles.gif"),
url(https://assets.codepen.io/13471/holo.png),
linear-gradient(125deg, #ff008450 15%, #fca40040 30%, #ffff0030 40%, #00ff8a20 60%, #00cfff40 70%, #cc4cfa50 85%);
background-position: 50% 50%;
background-size: 160%;
background-blend-mode: overlay;
z-index: 2;
transition: all 0.33s ease;
opacity: 0.75;
}
.card.active:after,
.card:hover:after {
opacity: 1;
}
.card.active,
.card:hover {
animation: none;
transition: box-shadow 0.1s ease-out;
}
.card.active:before,
.card:hover:before {
background-image: linear-gradient(
110deg,
transparent 25%,
var(--color1) 48%,
var(--color2) 52%,
transparent 75%
);
background-size: 250% 250%;
opacity: 0.88;
filter: brightness(0.66) contrast(1.33);
}
.card.active:before,
.card:hover:before,
.card.active:after,
.card:hover:after {
animation: none;
transition: none;
}
.card.animated {
transition: none;
animation: holoCard 12s ease 0s 1;
}
.card.animated:before {
transition: none;
animation: holoGradient 12s ease 0s 1;
}
.card.animated:after {
transition: none;
animation: holoSparkle 12s ease 0s 1;
}
@keyframes holoSparkle {
0%, 100% {
opacity: 0.75; background-position: 50% 50%; filter: brightness(1.2) contrast(1.25);
}
5%, 8% {
opacity: 1; background-position: 40% 40%; filter: brightness(0.8) contrast(1.2);
}
13%, 16% {
opacity: 0.5; background-position: 50% 50%; filter: brightness(1.2) contrast(0.8);
}
35%, 38% {
opacity: 1; background-position: 60% 60%; filter: brightness(1) contrast(1);
}
55% {
opacity: 0.33; background-position: 45% 45%; filter: brightness(1.2) contrast(1.25);
}
}
@keyframes holoGradient {
0%, 100% {
opacity: 0.5;
background-position: 50% 50%;
filter: brightness(0.5) contrast(1);
}
5%, 9% {
background-position: 100% 100%;
opacity: 1;
filter: brightness(0.75) contrast(1.25);
}
13%, 17% {
background-position: 0% 0%;
opacity: 0.88;
}
35%, 39% {
background-position: 100% 100%;
opacity: 1;
filter: brightness(0.5) contrast(1);
}
55% {
background-position: 0% 0%;
opacity: 1;
filter: brightness(0.75) contrast(1.25);
}
}
@keyframes holoCard {
0%, 100% {
transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
}
5%, 8% {
transform: rotateZ(0deg) rotateX(6deg) rotateY(-20deg);
}
13%, 16% {
transform: rotateZ(0deg) rotateX(-9deg) rotateY(32deg);
}
35%, 38% {
transform: rotateZ(3deg) rotateX(12deg) rotateY(20deg);
}
55% {
transform: rotateZ(-3deg) rotateX(-12deg) rotateY(-27deg);
}
}
.card.eevee:hover {
box-shadow:
0 0 30px -5px white,
0 0 10px -2px white,
0 55px 35px -20px rgba(0, 0, 0, 0.5);
}
.card.eevee:hover:before,
.card.eevee.active:before {
background-image: linear-gradient(
115deg,
transparent 20%,
var(--color1) 36%,
var(--color2) 43%,
var(--color3) 50%,
var(--color4) 57%,
var(--color5) 64%,
transparent 80%
);
}
.demo .card {
background-image: var(--back);
font-size: 2vh;
}
.demo .card > span {
position: relative;
top: 45%;
}
.demo .card:nth-of-type(1),
.demo .card:nth-of-type(2),
.demo .card:nth-of-type(3) {
width: 20vh;
height: 27.5vh;
box-shadow: inset 0 0 0 1px rgba(white, 0.4), 0 25px 15px -10px rgba(0, 0, 0, 0.5);
animation: none;
}
.demo .card:nth-of-type(1),
.demo .card:nth-of-type(2),
.demo .card:nth-of-type(3) {
&:before, &:after {
animation: none;
}
}
.demo .card:nth-of-type(1) {
&:before, &:after { display: none; }
}
.demo .card:nth-of-type(2) {
background: none;
&:before { display: none; }
}
.demo .card:nth-of-type(3) {
background: none;
&:after { display: none; }
}
.operator {
display: inline-block;
vertical-align: middle;
font-size: 6vh;
}
html, body {
height: 100%;
background-color: #333844;
padding: 0;
z-index: 1;
transform: translate3d(0, 0, 0.1px);
}
body {
color: white;
font-family: "Heebo", sans-serif;
text-align: center;
}
h1 {
display: block;
margin: 30px 0;
}
p {
margin-top: 5px;
font-weight: 200;
}
#app {
position: relative;
}
.demo,
.cards {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
perspective: 2000px;
position: relative;
z-index: 1;
transform: translate3d(0.1px, 0.1px, 0.1px);
}
.demo {
flex-direction: row;
justify-content: center;
}
@media screen and (min-width: 600px) {
.cards {
flex-direction: row;
}
}
.cards .card {
&:nth-child(2) {
&, &:before, &:after {
animation-delay: 0.25s;
}
}
&:nth-child(3) {
&, &:before, &:after {
animation-delay: 0.5s;
}
}
&:nth-child(4) {
&, &:before, &:after {
animation-delay: 0.75s;
}
}
}
p {
font-weight: 400;
font-size: 18px;
padding: 1em;
background: rgba(0, 0, 0, 0.3);
margin-top: 0;
animation: rubberBand 1.5s linear 3s 1;
}
p a {
color: cyan;
}
html, body, main {
min-height: 100%;
}
@keyframes rubberBand {
from {
transform: scale3d(1, 1, 1);
}
30% {
transform: scale3d(1.25, 0.75, 1);
}
40% {
transform: scale3d(0.75, 1.25, 1);
}
50% {
transform: scale3d(1.15, 0.85, 1);
}
65% {
transform: scale3d(0.95, 1.05, 1);
}
75% {
transform: scale3d(1.05, 0.95, 1);
}
to {
transform: scale3d(1, 1, 1);
}
}
$cards.forEach(function($card) {
$card.addEventListener("mousemove", function(e) {
var pos = [e.offsetX, e.offsetY];
e.preventDefault();
if (e.type === "touchmove") {
pos = [e.touches[0].clientX, e.touches[0].clientY];
}
var l = pos[0];
var t = pos[1];
var h = $card.clientHeight;
var w = $card.clientWidth;
var px = Math.abs(Math.floor(100 / w * l) - 100);
var py = Math.abs(Math.floor(100 / h * t) - 100);
var pa = (50 - px) + (50 - py);
var lp = (50 + (px - 50) / 1.5);
var tp = (50 + (py - 50) / 1.5);
var px_spark = (50 + (px - 50) / 7);
var py_spark = (50 + (py - 50) / 7);
var p_opc = 20 + (Math.abs(pa) * 1.5);
var ty = ((tp - 50) / 2) * -1;
var tx = ((lp - 50) / 1.5) * 0.5;
var grad_pos = `background-position: ${lp}% ${tp}%;`
var sprk_pos = `background-position: ${px_spark}% ${py_spark}%;`
var opc = `opacity: ${p_opc / 100};`
var tf = `transform: rotateX(${ty}deg) rotateY(${tx}deg)`;
var style = `
.card:hover:before { ${grad_pos} } /* gradient */
.card:hover:after { ${sprk_pos} ${opc} } /* sparkles */
`;
$cards.forEach(card => card.classList.remove("active"));
$card.classList.remove("animated");
$card.setAttribute("style", tf);
$style.innerHTML = style;
if (e.type === "touchmove") {
return false;
}
clearTimeout(x);
});
$card.addEventListener("mouseout", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
x = setTimeout(function() {
$card.classList.add("animated");
}, 2500);
});
$card.addEventListener("touchend", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
x = setTimeout(function() {
$card.classList.add("animated");
}, 2500);
});
$card.addEventListener("touchcancel", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
x = setTimeout(function() {
$card.classList.add("animated");
}, 2500);
});
});
Certainly! To remove the auto movement (animation) when the page loads, you can simply delete or comment out the .animated class and its associated keyframes, or remove that class from the element. Here’s how you can modify your CSS and JavaScript accordingly:
.animated class effects:.card.animated {
transition: none;
animation: none; /* Modify this line to disable animation */
}
.card.animated:before {
transition: none;
animation: none; /* Modify this line to disable animation */
}
.card.animated:after {
transition: none;
animation: none; /* Modify this line to disable animation */
}
@keyframes holoCard {
0%, 100% {
transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
}
5%, 8% {
transform: rotateZ(0deg) rotateX(6deg) rotateY(-20deg);
}
13%, 16% {
transform: rotateZ(0deg) rotateX(-9deg) rotateY(32deg);
}
35%, 38% {
transform: rotateZ(3deg) rotateX(12deg) rotateY(20deg);
}
55% {
transform: rotateZ(-3deg) rotateX(-12deg) rotateY(-27deg);
}
}
@keyframes holoGradient {
0%, 100% {
opacity: 0.5;
background-position: 50% 50%;
filter: brightness(0.5) contrast(1);
}
5%, 9% {
background-position: 100% 100%;
opacity: 1;
filter: brightness(0.75) contrast(1.25);
}
13%, 17% {
background-position: 0% 0%;
opacity: 0.88;
}
35%, 39% {
background-position: 100% 100%;
opacity: 1;
filter: brightness(0.5) contrast(1);
}
55% {
background-position: 0% 0%;
opacity: 1;
filter: brightness(0.75) contrast(1.25);
}
}
@keyframes holoSparkle {
0%, 100% {
opacity: 0.75; background-position: 50% 50%; filter: brightness(1.2) contrast(1.25);
}
5%, 8% {
opacity: 1; background-position: 40% 40%; filter: brightness(0.8) contrast(1.2);
}
13%, 16% {
opacity: 0.5; background-position: 50% 50%; filter: brightness(1.2) contrast(0.8);
}
35%, 38% {
opacity: 1; background-position: 60% 60%; filter: brightness(1) contrast(1);
}
55% {
opacity: 0.33; background-position: 45% 45%; filter: brightness(1.2) contrast(1.25);
}
}
In your existing JavaScript, the class .animated is added back to the card after a timeout period. You should remove that part if you want to stop the animation permanently.
Remove or comment out the following lines in your JavaScript:
$card.classList.remove("animated");
Also, comment out or remove the timeout function that adds the .animated class back:
x = setTimeout(function() {
$card.classList.add("animated");
}, 2500);
After making these changes, your CSS and JavaScript sections should look like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive Card</title>
<style>
:root {
--color1: rgb(0, 231, 255);
--color2: rgb(255, 0, 231);
--back: url(https://cdn2.bulbagarden.net/upload/1/17/Cardback.jpg);
--charizard1: #fac;
--charizard2: #ddccaa;
--charizardfront: url(https://assets.codepen.io/13471/charizard-gx.webp);
}
.card {
width: 71.5vw;
height: 100vw;
}
@media screen and (min-width: 600px) {
.card {
width: clamp(12.9vw, 61vh, 18vw);
height: clamp(18vw, 85vh, 25.2vw);
}
}
.card {
position: relative;
overflow: hidden;
margin: 20px;
z-index: 10;
touch-action: none;
border-radius: 5% / 3.5%;
box-shadow:
-5px -5px 5px -5px var(--color1),
5px 5px 5px -5px var(--color2),
-7px -7px 10px -5px transparent,
7px 7px 10px -5px transparent,
0 0 5px 0px rgba(255, 255, 255, 0),
0 55px 35px -20px rgba(0, 0, 0, 0.5);
transition: transform 0.5s ease, box-shadow 0.2s ease;
will-change: transform, filter;
background-color: #040712;
background-image: var(--front);
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
transform-origin: center;
}
.card:hover {
box-shadow:
-20px -20px 30px -25px var(--color1),
20px 20px 30px -25px var(--color2),
-7px -7px 10px -5px var(--color1),
7px 7px 10px -5px var(--color2),
0 0 13px 4px rgba(255, 255, 255, 0.3),
0 55px 35px -20px rgba(0, 0, 0, 0.5);
}
.card.charizard {
--color1: var(--charizard1);
--color2: var(--charizard2);
--front: var(--charizardfront);
}
.card:before,
.card:after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-repeat: no-repeat;
opacity: 0.5;
mix-blend-mode: color-dodge;
transition: all 0.33s ease;
}
.card:before {
background-position: 50% 50%;
background-size: 300% 300%;
background-image: linear-gradient(
115deg,
transparent 0%,
var(--color1) 25%,
transparent 47%,
transparent 53%,
var(--color2) 75%,
transparent 100%
);
filter: brightness(0.5) contrast(1);
z-index: 1;
}
.card:after {
background-image: url("https://assets.codepen.io/13471/sparkles.gif"),
url(https://assets.codepen.io/13471/holo.png),
linear-gradient(125deg, #ff008450 15%, #fca40040 30%, #ffff0030 40%, #00ff8a20 60%, #00cfff40 70%, #cc4cfa50 85%);
background-position: 50% 50%;
background-size: 160%;
background-blend-mode: overlay;
z-index: 2;
transition: all 0.33s ease;
opacity: 0.75;
}
.card.active:after,
.card:hover:after {
opacity: 1;
}
.card.active,
.card:hover {
animation: none;
transition: box-shadow 0.1s ease-out;
}
.card.active:before,
.card:hover:before {
background-image: linear-gradient(
110deg,
transparent 25%,
var(--color1) 48%,
var(--color2) 52%,
transparent 75%
);
background-size: 250% 250%;
opacity: 0.88;
filter: brightness(0.66) contrast(1.33);
}
.card.active:before,
.card:hover:before,
.card.active:after,
.card:hover:after {
animation: none;
transition: none;
}
.operator {
display: inline-block;
vertical-align: middle;
font-size: 6vh;
}
html, body {
height: 100%;
background-color: #333844;
padding: 0;
z-index: 1;
transform: translate3d(0, 0, 0.1px);
}
body {
color: white;
font-family: "Heebo", sans-serif;
text-align: center;
}
h1 {
display: block;
margin: 30px 0;
}
p {
margin-top: 5px;
font-weight: 200;
}
#app {
position: relative;
}
.demo,
.cards {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
perspective: 2000px;
position: relative;
z-index: 1;
transform: translate3d(0.1px, 0.1px, 0.1px);
}
.demo {
flex-direction: row;
justify-content: center;
}
@media screen and (min-width: 600px) {
.cards {
flex-direction: row;
}
}
.cards .card {
&:nth-child(2) {
&, &:before, &:after {
animation-delay: 0.25s;
}
}
&:nth-child(3) {
&, &:before, &:after {
animation-delay: 0.5s;
}
}
&:nth-child(4) {
&, &:before, &:after {
animation-delay: 0.75s;
}
}
}
p {
font-weight: 400;
font-size: 18px;
padding: 1em;
background: rgba(0, 0, 0, 0.3);
margin-top: 0;
animation: rubberBand 1.5s linear 3s 1;
}
p a {
color: cyan;
}
html, body, main {
min-height: 100%;
}
@keyframes rubberBand {
from {
transform: scale3d(1, 1, 1);
}
30% {
transform: scale3d(1.25, 0.75, 1);
}
40% {
transform: scale3d(0.75, 1.25, 1);
}
50% {
transform: scale3d(1.15, 0.85, 1);
}
65% {
transform: scale3d(0.95, 1.05, 1);
}
75% {
transform: scale3d(1.05, 0.95, 1);
}
to {
transform: scale3d(1, 1, 1);
}
}
</style>
</head>
<body>
<main id="app">
<section class="cards">
<div class="card charizard"></div>
</section>
<style class="hover"></style>
</main>
<script>
var x;
var $cards = document.querySelectorAll(".card");
var $style = document.querySelector(".hover");
$cards.forEach(function($card) {
$card.addEventListener("mousemove", function(e) {
var pos = [e.offsetX, e.offsetY];
e.preventDefault();
if (e.type === "touchmove") {
pos = [e.touches[0].clientX, e.touches[0].clientY];
}
var l = pos[0];
var t = pos[1];
var h = $card.clientHeight;
var w = $card.clientWidth;
var px = Math.abs(Math.floor(100 / w * l) - 100);
var py = Math.abs(Math.floor(100 / h * t) - 100);
var pa = (50 - px) + (50 - py);
var lp = (50 + (px - 50) / 1.5);
var tp = (50 + (py - 50) / 1.5);
var px_spark = (50 + (px - 50) / 7);
var py_spark = (50 + (py - 50) / 7);
var p_opc = 20 + (Math.abs(pa) * 1.5);
var ty = ((tp - 50) / 2) * -1;
var tx = ((lp - 50) / 1.5) * 0.5;
var grad_pos = `background-position: ${lp}% ${tp}%;`
var sprk_pos = `background-position: ${px_spark}% ${py_spark}%;`
var opc = `opacity: ${p_opc / 100};`
var tf = `transform: rotateX(${ty}deg) rotateY(${tx}deg)`;
var style = `
.card:hover:before { ${grad_pos} } /* gradient */
.card:hover:after { ${sprk_pos} ${opc} } /* sparkles */
`;
$cards.forEach(card => card.classList.remove("active"));
$card.removeAttribute("class","animated");
$card.setAttribute("style", tf);
$style.innerHTML = style;
if (e.type === "touchmove") {
return false;
}
clearTimeout(x);
});
$card.addEventListener("mouseout", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
});
$card.addEventListener("touchend", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
});
$card.addEventListener("touchcancel", function() {
var $card = this;
$style.innerHTML = "";
$card.removeAttribute("style");
});
});
</script>
</body>
</html>
These modifications will ensure that the initial automatic animation of the card is removed, and the interactive hover effects remain intact.