Create waxing crescent moon in svg using path
i want to create any moon phases like waxing crescent and other phases on this svg.
svg code must dynamic to create any phase of moon from 1 phase to 28 moon phase
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" >
<g><circle cx="60" cy="60" r="50" fill="#fff" stroke="#000" stroke-width="7"/>
<path d="m60 8a48 52 0 0 0 0 105l0-105z"/></g></svg>
like this but not have any background here is like blue
svg
add a comment |
i want to create any moon phases like waxing crescent and other phases on this svg.
svg code must dynamic to create any phase of moon from 1 phase to 28 moon phase
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" >
<g><circle cx="60" cy="60" r="50" fill="#fff" stroke="#000" stroke-width="7"/>
<path d="m60 8a48 52 0 0 0 0 105l0-105z"/></g></svg>
like this but not have any background here is like blue
svg
add a comment |
i want to create any moon phases like waxing crescent and other phases on this svg.
svg code must dynamic to create any phase of moon from 1 phase to 28 moon phase
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" >
<g><circle cx="60" cy="60" r="50" fill="#fff" stroke="#000" stroke-width="7"/>
<path d="m60 8a48 52 0 0 0 0 105l0-105z"/></g></svg>
like this but not have any background here is like blue
svg
i want to create any moon phases like waxing crescent and other phases on this svg.
svg code must dynamic to create any phase of moon from 1 phase to 28 moon phase
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" >
<g><circle cx="60" cy="60" r="50" fill="#fff" stroke="#000" stroke-width="7"/>
<path d="m60 8a48 52 0 0 0 0 105l0-105z"/></g></svg>
like this but not have any background here is like blue
svg
svg
edited Mar 2 '18 at 4:37
Imran
asked Mar 2 '18 at 3:52
ImranImran
225
225
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
To imitate the phases of the moon, I used two circles.
The bottom circle of the yellow color is fill =" # E7D68C "
imitates the full moon.
The upper black circle moves to the left overlapping the yellow circle, immitting the movement of the earth overlapping the moon from the sun's rays.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49062563%2fcreate-waxing-crescent-moon-in-svg-using-path%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To imitate the phases of the moon, I used two circles.
The bottom circle of the yellow color is fill =" # E7D68C "
imitates the full moon.
The upper black circle moves to the left overlapping the yellow circle, immitting the movement of the earth overlapping the moon from the sun's rays.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
add a comment |
To imitate the phases of the moon, I used two circles.
The bottom circle of the yellow color is fill =" # E7D68C "
imitates the full moon.
The upper black circle moves to the left overlapping the yellow circle, immitting the movement of the earth overlapping the moon from the sun's rays.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
add a comment |
To imitate the phases of the moon, I used two circles.
The bottom circle of the yellow color is fill =" # E7D68C "
imitates the full moon.
The upper black circle moves to the left overlapping the yellow circle, immitting the movement of the earth overlapping the moon from the sun's rays.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
To imitate the phases of the moon, I used two circles.
The bottom circle of the yellow color is fill =" # E7D68C "
imitates the full moon.
The upper black circle moves to the left overlapping the yellow circle, immitting the movement of the earth overlapping the moon from the sun's rays.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" viewBox="0 0 73 73" >
<defs>
<radialGradient id="RadialGrad"
fx="50%" fy="50%" r="65%"
spreadMethod="pad">
<stop offset="0%" stop-color="#E7D68C" stop-opacity="1"/>
<stop offset="100%" stop-color="#FFFEED" stop-opacity="1" />
</radialGradient>
</defs>
<rect width="100%" height="100%" />
<g transform="rotate(-20 35.5 35.5)">
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="url(#RadialGrad)" />
<circle cx="35.5" cy="35.5" r="35" stroke="none" fill="black" >
<animate id="youngMoon" attributeName="cx" values="35.5;-35.5;" begin="1s;oldMoon.end+1s" dur="10s" fill="freeze" />
<animate id="oldMoon" attributeName="cx" values="105;35.5;" begin="youngMoon.end+1s" dur="10s" fill="freeze" />
</circle>
</g>
</svg>
edited Jan 2 at 14:50
answered Mar 2 '18 at 7:51
Alexandr_TTAlexandr_TT
2,3332523
2,3332523
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49062563%2fcreate-waxing-crescent-moon-in-svg-using-path%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown