UNPKG

@nicecode/funny

Version:

funny,一些有趣的代码,funny code

103 lines (90 loc) 1.83 kB
@property --rotate { syntax: "<angle>"; initial-value: 132deg; inherits: false; } :root { --amazingCard-height: 65vh; --amazingCard-width: calc(var(--amazingCard-height) / 1.5); } .cont { position: relative; min-height: 400px; height: 500px; background: #212534; display: flex; align-items: center; flex-direction: column; padding-top: 2rem; padding-bottom: 2rem; box-sizing: border-box; z-index: 0; } .amazingCard { display: flex; background: #191c29; width: 200px; height: 300px; padding: 3px; position: relative; border-radius: 6px; justify-content: center; align-items: center; text-align: center; font-size: 1.5em; cursor: pointer; font-family: cursive; } .amazingCard:hover { color: rgb(88 199 250 / 100%); transition: color 1s; } .amazingCard:hover:before, .amazingCard:hover:after { animation: none; opacity: 0; } .amazingCard::before { content: ""; width: 104%; height: 102%; border-radius: 8px; background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2); position: absolute; z-index: -1; top: -1%; left: -2%; animation: spin 2.5s linear infinite; } .amazingCard::after { position: absolute; content: ""; top: calc(var(--amazingCard-height) / 6); left: 0; right: 0; z-index: -1; height: 100%; width: 100%; margin: 0 auto; transform: scale(0.8); filter: blur(calc(var(--amazingCard-height) / 6)); background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2); opacity: 1; transition: opacity .5s; animation: spin 2.5s linear infinite; } @keyframes spin { 0% { --rotate: 0deg; } 100% { --rotate: 360deg; } } .amazingCard a { color: #212534; text-decoration: none; font-family: sans-serif; font-weight: bold; margin-top: 2rem; }