-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
<title>women's day</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<style>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 97vh;
}
.container svg {
width: 50%;
height: 50%;
}
</style>
<!-- aa2 -->
<style>
* {
margin: 0;
padding: 0;
}
.body-letter {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #fae1dd;
}
.letter {
position: relative;
z-index: 1;
}
.valentines {
position: relative;
top: 50px;
cursor: pointer;
animation: up 3s linear infinite;
}
@keyframes up {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-30px);
}
}
.envelope {
position: relative;
width: 300px;
height: 200px;
background-color: #f08080;
}
.envelope:before {
background-color: #f08080;
content: "";
position: absolute;
width: 212px;
height: 212px;
transform: rotate(45deg);
top: -105px;
left: 44px;
border-radius: 30px 0 0 0;
}
.card {
position: absolute;
background-color: #eae2b7;
width: 270px;
height: 170px;
top: 5px;
left: 15px;
box-shadow: -5px -5px 100px rgba(0, 0, 0, 0.4);
}
.card:before {
content: "";
position: absolute;
border: 3px solid #003049;
border-style: dotted;
width: 240px;
heighT: 140px;
left: 12px;
top: 12px;
}
.text {
position: absolute;
font-family: 'Brush Script MT', cursive;
font-size: 28px;
text-align: center;
line-height: 25px;
top: 19px;
left: 85px;
color: #003049;
}
.heart {
background-color: #d62828;
display: inline-block;
height: 30px;
margin: 0 10px;
position: relative;
top: 110px;
left: 105px;
transform: rotate(-45deg);
width: 30px;
}
.heart:before,
.heart:after {
content: "";
background-color: #d62828;
border-radius: 50%;
height: 30px;
position: absolute;
width: 30px;
}
.heart:before {
top: -15px;
left: 0;
}
.heart:after {
left: 15px;
top: 0;
}
.hearts {
position: absolute;
top: 0
}
.one,
.two,
.three,
.four,
.five {
background-color: red;
display: inline-block;
height: 10px;
margin: 0 10px;
position: relative;
transform: rotate(-45deg);
width: 10px;
top: 50px;
}
.one:before,
.one:after,
.two:before,
.two:after,
.three:before,
.three:after,
.four:before,
.four:after,
.five:before,
.five:after {
content: "";
background-color: red;
border-radius: 50%;
height: 10px;
position: absolute;
width: 10px;
}
.one:before,
.two:before,
.three:before,
.four:before,
.five:before {
top: -5px;
left: 0;
}
.one:after,
.two:after,
.three:after,
.four:after,
.five:after {
left: 5px;
top: 0;
}
.one {
left: 10px;
animation: heart 1s ease-out infinite;
}
.two {
left: 30px;
animation: heart 2s ease-out infinite;
}
.three {
left: 50px;
animation: heart 1.5s ease-out infinite;
}
.four {
left: 70px;
animation: heart 2.3s ease-out infinite;
}
.five {
left: 90px;
animation: heart 1.7s ease-out infinite;
}
@keyframes heart {
0% {
transform: translateY(0) rotate(-45deg) scale(0.3);
opacity: 1;
}
100% {
transform: translateY(-150px) rotate(-45deg) scale(1.3);
opacity: 0.5;
}
}
.front {
position: absolute;
border-right: 180px solid #f4978e;
border-top: 95px solid transparent;
border-bottom: 100px solid transparent;
left: 120px;
top: 5px;
width: 0;
height: 0;
z-index: 10;
}
.front:before {
position: absolute;
content: "";
border-left: 300px solid #f8ad9d;
border-top: 195px solid transparent;
left: -120px;
top: -95px;
width: 0;
height: 0;
}
.shadow {
position: absolute;
width: 330px;
height: 25px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.3);
top: 265px;
left: -15px;
animation: scale 3s linear infinite;
z-index: -1;
}
@keyframes scale {
0%,
100% {
transform: scaleX(1);
}
50% {
transform: scaleX(0.85);
}
}
.hover-animation {
animation: hover 1.75s ease-in-out infinite;
}
#castle {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #fae1dd;
}
.dustDef {
position: absolute;
background-color: white;
border-radius: 100%;
box-shadow: 0 0 3px 1px white;
opacity: 0;
}
@keyframes hover {
0% {
margin-top: 60px;
}
50% {
margin-top: 50px;
}
100% {
margin-top: 60px;
}
}
@keyframes glow {
0% {
box-shadow: 0 0 25px 0 #e8b2ca;
}
50% {
box-shadow: 0 0 45px 0 #e8b2ca;
}
100% {
box-shadow: 0 0 25px 0 #e8b2ca;
}
}
@keyframes fall {
5% {
top: 209px;
left: 105px;
transform: rotate(55deg) scale(0.9, 0.95) skew(-18deg);
opacity: 0.9;
}
30% {
left: 90px;
}
55% {
left: 130px;
}
60%,
100% {
top: 380px;
transform: rotate(30deg) scale(0.9, 0.95) skew(-32deg);
opacity: 0;
}
}
@keyframes floatAnimate {
0% {
background-size: 105% 120%;
background-position: 0 0;
opacity: 0.7;
}
50% {
background-size: 100% 100%;
background-position: 0 0;
opacity: 0.5;
}
100% {
background-size: 105% 120%;
background-position: 0 0;
opacity: 0.7;
}
}
</style>
<style>
svg {
width: 80%;
display: block;
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
}
text {
fill: #e6668a;
font-family: consolas;
font-size: 9px;
}
p {
position: absolute;
z-index: 2
}
label {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
opacity: .8
}
/* style letter */
/* .box-content.active {
opacity: 1;
visibility: visible;
transform: scale(1);
}
.box-content {
position: fixed;
width: 100%;
height: 100%;
z-index: 100000000000;
top: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.7);
transform: scale(0.01);
visibility: hidden;
transition: 0.5s;
}
.fa-xmark {
position: absolute;
right: 5%;
top: 5%;
font-size: 40px;
color: #fff;
cursor: pointer;
}
.fa-xmark:hover {
filter: drop-shadow(0 0 10px #fff);
}
.image-decorate {
display: flex;
width: 700px;
z-index: 10;
height: 100%;
}
.content1 {
position: absolute;
width: 700px;
height: 500px;
background-image: radial-gradient(circle farthest-corner at center, #f9edf3 10%, #ffd3ee 100%);
border-radius: 10px 70px 10px 70px;
box-shadow: 5px 5px 10px rgb(0, 0, 0);
cursor: pointer;
}
.textLetter {
width: 100%;
flex-direction: column;
justify-content: center;
display: flex;
align-items: center;
user-select: none;
}
.textLetter h2 {
font-size: 30px;
font-family: 'Dancing Script', cursive;
}
.textLetter .contentLetter {
font-size: 19px;
text-align: center;
padding: 0px 30px;
margin-top: 10px;
font-family: 'Dancing Script', cursive;
position: initial;
} */
.letters {
position: absolute;
width: 65px;
transition: 10s ease-in-out;
cursor: pointer;
z-index: 1000;
}
.letters img {
width: 100%;
}
.wrapperLetterForm {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 1000;
background: rgba(0, 0, 0, 0.7);
display: none;
}
.boxLetter {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.boxLetter .formLetter {
position: relative;
width: 600px;
height: 350px;
background-color: #FFEBEB;
border-radius: 20px;
z-index: 100;
padding: 20px 15px;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}
.formLetter .wrapperLetter {
position: relative;
width: 100%;
height: 100%;
border: 2px dashed #FF6666;
border-radius: inherit;
display: flex;
}
.boxLetter .before {
position: absolute;
width: 600px;
height: 350px;
background: #fff;
transform: rotate(-15deg);
border-radius: 20px;
z-index: 10;
}
.formLetter .heartLetter {
position: absolute;
width: 30px;
height: 30px;
border-radius: 50%;
background: #FFEBEB;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
}
.heartLetter .heartLetterItem {
position: relative;
width: 10px;
height: 10px;
transform: rotate(45deg);
background: #FF6666;
}
.heartLetter:first-child {
right: 5px;
top: 10px;
}
.heartLetter:nth-child(2) {
left: 5px;
bottom: 10px;
}
.heartLetterItem::before,
.heartLetterItem::after {
position: absolute;
content: '';
width: 100%;
height: 100%;
border-radius: 50%;
background: inherit;
}
.heartLetterItem::before {
top: -50%;
}
.heartLetterItem::after {
left: -50%;
}
.textLetter {
width: 100%;
flex-direction: column;
justify-content: center;
display: flex;
align-items: center;
user-select: none;
}
.textLetter h2 {
font-size: 30px;
font-family: 'Dancing Script', cursive;
}
.textLetter .contentLetter {
font-size: 19px;
text-align: center;
padding: 0px 30px;
margin-top: 10px;
font-family: 'Dancing Script', cursive;
position: initial;
}
.fa-xmark {
position: absolute;
right: 20px;
top: 20px;
color: #fff;
cursor: pointer;
font-size: 25px;
}
.show {
display: block;
}
.heartAnimation {
position: absolute;
width: 200px;
bottom: 0;
}
.heartAnimation img {
width: 100%;
}
.mewmew1,
.mewmew2 {
position: absolute;
width: 90px;
}
.mewmew1 {
bottom: 0;
left: 0;
}
.mewmew2 {
bottom: 0;
right: 0;
}
.mewmew1 img,
.mewmew2 img {
width: 100%;
}
</style>
<svg style="display: none;" id="theSvg" viewBox="-120 -30 240 180" enable-background="new 0 0 174 148"
xml:space="preserve">
<defs>
<filter id="f" filterUnits="userSpaceOnUse" x="-120" y="-30" width="120%" height="120%">
<feGaussianBlur in="SourceAlpha" stdDeviation="5" result="blur"></feGaussianBlur>
<feOffset in="blur" dx="3" dy="5" result="shadow"></feOffset>
<feFlood flood-color="rgba(3,0,0,1)" result="color" />
<feComposite in="color" in2="shadow" operator="in" />
<feComposite in="SourceGraphic" />
</filter>
<path id="shape" d="M0, 21.054
C0, 21.054 24.618, -15.165 60.750, 8.554
C93.249, 29.888 57.749, 96.888 0, 117.388
C-57.749, 96.888 -93.249, 29.888 -60.750, 8.554
C-24.618, -15.165 -0, 21.054 -0, 21.054z
" />
<path id="partialPath" />
</defs>
<text dy="-2">
<textPath style="font-family: fantasy;" xlink:href="#partialPath" startOffset="12">
🌹Happy Women's Day
🌹.........................................................................................................................................🌹From
With Love 20/10!🌹
</textPath>
</text>
<use id="useThePath" xlink:href="#partialPath" stroke="white" stroke-width=".5" stroke-opacity=".5" fill="none"
style="display:none;" />
</svg>
<script>
let rid = null; // request animation id
const SVG_NS = "http://www.w3.org/2000/svg";
const pathlength = shape.getTotalLength();
let t = 0; // at the begining of the path
let lengthAtT = pathlength * t;
let d = shape.getAttribute("d");
// 1. build the d array
let n = d.match(/C/gi).length; // how many times
let pos = 0; // the position, used to find the indexOf the nth C
class subPath {
constructor(d) {
this.d = d;
this.get_PointsRy();
this.previous = subpaths.length > 0 ? subpaths[subpaths.length - 1] : null;
this.measurePath();
this.get_M_Point(); //lastPoint
this.lastCubicBezier;
this.get_lastCubicBezier();
}
get_PointsRy() {
this.pointsRy = [];
let temp = this.d.split(/[A-Z,a-z\s,]/).filter(v => v); // remove empty elements
temp.map(item => {
this.pointsRy.push(parseFloat(item));
}); //this.pointsRy numbers not strings
}
measurePath() {
let path = document.createElementNS(SVG_NS, "path");
path.setAttributeNS(null, "d", this.d);
// no need to append it to the SVG
// the lengths of every path in dry
this.pathLength = path.getTotalLength();
}
get_M_Point() {
if (this.previous) {
let p = this.previous.pointsRy;
let l = p.length;
this.M_point = [p[l - 2], p[l - 1]];
} else {
let p = this.pointsRy;
this.M_point = [p[0], p[1]];
}
}
get_lastCubicBezier() {
let lastIndexOfC = this.d.lastIndexOf("C");
let temp = this.d
.substring(lastIndexOfC + 1)
.split(/[\s,]/)
.filter(v => v);
let _temp = [];
temp.map(item => {
_temp.push(parseFloat(item));
});
this.lastCubicBezier = [this.M_point];
for (let i = 0; i < _temp.length; i += 2) {
this.lastCubicBezier.push(_temp.slice(i, i + 2));
}
}
}
let subpaths = [];
// create new subPaths
for (let i = 0; i < n; i++) {
// finds the of nth C in d
let newpos = d.indexOf("C", pos + 1);
if (i > 0) {
// if it's not the first C
let sPath = new subPath(d.substring(0, newpos));
subpaths.push(sPath);
Metadata
Metadata
Assignees
Labels
No labels